edgecase
Author: StJohn Piano
This page is subject to change at any time. It is not signed by its author or by Edgecase Datafeed.
587 words - 127 lines - 4 pages



Edgecase's working definition of a nonstandard transaction:
- It has at least one input and at least one output.
- At least one input or output address is not a standard Pay-To-Public-Key-Hash (P2PKH) address.

Nonstandard Pay-To-Script-Hash (P2SH) addresses begin with the character '3'. Example:
The address
328cTqexYnQRbN5Dgs12D89sYiPPvtWVbF

begins with a '3' and is therefore a P2SH address.

Currently, Edgecase software only supports nonstandard Bitcoin transactions that contain a single standard input and a single nonstandard Pay-To-Script-Hash (P2SH) output.

You will need:
- The private key of each input address.
- 32 bytes of entropy per input address. The article Recipe for generating entropy bytes using dice describes one way to generate this entropy. The transaction must be signed by each input (using the private key), and each signature requires 32 bytes of entropy.
- An offline computer with Python 2.7.x installed. The code has been developed under Python 2.7.13 running on Mac OS X 10.6.8 (Snow Leopard), and should run successfully on other versions of Python 2.7.
- The details of each unspent output that you want to use as an input in the transaction. These are: The txid of the original transaction that sent the unspent output to its current address, the index of the unspent output in the list of outputs in the original transaction, and the value of the unspent output. The txid is a 64-hex-character string, the index is an integer, and the value can be either in satoshi (an integer) or in bitcoin (a decimal value with up to 8 decimal places).
- Access to several important Bitcoin tools or services. Please visit this page for details:
Services needed for creating Bitcoin transactions

Browse to the article Recipe for creating and signing a nonstandard Bitcoin transaction. Use this recipe to create and sign a nonstandard Bitcoin transaction with one standard P2PKH input and one nonstandard P2SH output.


Example nonstandard Bitcoin transaction:
0100000001cde23540f3033b59d8c00fd9d8703c80d5928a177244b12fec8d580f34dbce070f0000008a473044022005fc767d513f285c38f718f4c9cfb0909d4ba2d80131aed21b3f26aa630a79f002203e7ee9b0529ee2c624e71735bfceb08e66c166281984f07e0cfde34c026c7b500141043ab692792d6c8838fd30c2ff45bf3cbd44286a5cac52ba64dc06452810202b3206f5c7799c3b72ff77fd1976f105ced3cd7700b0412e11266f3888b88c3052c3ffffffff0146d402000000000017a91430d540a50d464852194a195529ebfa44af521bbb870000000001000000




Projects that involved the creation and signing of a nonstandard Bitcoin transaction:

- Browse to the article Creating and signing a standard raw Bitcoin transaction. In this project, a nonstandard transaction was created that transferred bitcoin back from a standard address to a P2SH receiving address at a Bitcoin exchange. Read the Goal and Brief Summary sections, then decide whether to read further.

- Browse to the article Creating and signing a standard raw Bitcoin transaction: Iteration #2. In this project, a nonstandard transaction was created that transferred bitcoin back from a standard address to a P2SH receiving address at a Bitcoin exchange. Read the Goal and Brief Summary sections, then decide whether to read further.

- Browse to the article Using a transaction to validate a Bitcoin address. In this project, a nonstandard transaction was created that transferred bitcoin back from a standard address to a P2SH receiving address at a Bitcoin exchange. Read the Goal and Brief Summary sections, then decide whether to read further.

- Browse to the article Storing bitcoin on an offline Raspberry Pi. In this project, four nonstandard transactions were created that transferred bitcoin back from a standard address to a P2SH receiving address at a Bitcoin exchange. Two of these transactions were mined. Of the remaining two, one had a low fee and the other was a double-spend attempt. Read the Goal and Brief Summary sections, then decide whether to read further.