edgecase
Author: StJohn Piano
Published: 2020-06-20
Datafeed Article 147
This article has been digitally signed by Edgecase Datafeed.
This article has been digitally signed by its author.
1335 words - 649 lines - 17 pages




GOAL



Assemble a set of nonstandard Bitcoin transactions, including the private keys, for use in future tests of Bitcoin software. These transactions must have already been added to the Bitcoin blockchain.




CONTENTS



- Goal
- Contents
- Summary
- Notes
- Bitcoin Nonstandard Transaction Test Set




SUMMARY



I have collected 8 nonstandard transactions.

Actions:
- Read through previous articles. Record any nonstandard Bitcoin transactions. Record the input addresses corresponding to the input private keys. Record the onchain txid of the transaction.
- Generate the addresses from the input private keys. Confirm that the new addresses are identical to the original ones.
- Construct the transactions from the input data values. Confirm that the new transactions are identical to the original ones.

To generate the addresses, I used the recipe and assets from this article:
Recipe for generating a Bitcoin address

To construct the transactions, I used the assets listed in the Downloadable Assets section of this article:
Creating a Bitcoin transaction with two outputs
and I used the recipe from this article:
Recipe for creating and signing a nonstandard Bitcoin transaction




NOTES



My working definition of a standard transaction:
- It has at least one input and at least one output.
- All input and output addresses are Pay-To-Public-Key-Hash (P2PKH).
- All input scriptSigs contain uncompressed public keys.

Pay-To-Public-Key-Hash (P2PKH) addresses start with the character '1'.
Example: The address
1AGygbyEFYduWkkmZbbvirgS9kuBBMLJCP

begins with a '1' and is therefore a P2PKH address.

My 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.

Example of a nonstandard address:
- A Pay-To-Script-Hash (P2SH) address.

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.

Per the article Bitcoin transaction test set, the following pieces of information are the necessary input and output components for a standard Bitcoin transaction:

1) For each input:
- The txid of the previous transaction that transferred the unspent output to the input address. When its byte order is reversed, it becomes the "previous_output_hash".
- The index of this unspent output in the previous transaction (the "previous_output_index"). This index is implicit and starts at zero, and can be found by examining the list of outputs in the previous transaction, and looking for the particular unspent output that you wish to transfer.
- The private key (in hex bytes) of the input address.
- The bitcoin amount (or satoshi amount) contained within the unspent output. Let's call this the "input amount".
- A 32-byte random value (1 per input). The transaction will be signed once using each input and each signature requires 32 bytes of entropy.

2) For each output:
- The output address.
- The bitcoin amount (or satoshi amount) that you wish to transfer to the output address. Let's call this the "output amount".

3) For the whole transaction:
- The fee (in satoshi). The fee must be an integer e.g.
"225"
.

Additionally:
- For each input, I have recorded the "input address" that corresponds to the input private key.
- For each transaction, I have recorded the "change address" setting.

For some transactions, in the source article, the hash type (4 bytes,
01000000
) was erroneously appended to the final signed form of the transaction. This has been noted in each case. For further details, see the Bitcoin Transaction Toolset Hash Type Problem section of the article Creating a Bitcoin transaction with two outputs.










BITCOIN NONSTANDARD TRANSACTION TEST SET











Source: Creating and signing a standard raw Bitcoin transaction


Transaction name: "transaction 2"

Input 1:
- txid:
4bdd5f653d0100ea4735953e8e22e92321af9074926b3bd33c279c289f2d975a
- previous_output_index:
0
- private key:
000000000000000000000000000000007468655f6579655f6f665f6172676f6e
- address:
12RbVkKwHcwHbMZmnSVAyR4g88ZChpQD6f
- amount (in bitcoin or satoshi):
199775 satoshi
- random value:
000072616e646f6d5f627974655f737472696e675f6468636d726c636874646a
- input type:
p2pkh

Output 1:
- address:
36CQfj2Yt54sZttJYTb5ywuS7YGEQLfzCE
- amount (in bitcoin or satoshi):
199550 satoshi
- output type:
p2sh

Change address:
36CQfj2Yt54sZttJYTb5ywuS7YGEQLfzCE

Fee (satoshi):
225


Signed transaction:
01000000015a972d9f289c273cd33b6b927490af2123e9228e3e953547ea00013d655fdd4b000000008a473044022062871814a752fd4cd73679d03ec4f4c24638e4eca8aebb235e8e04fc46ea9dff02203c08ce95d0d00b15fdd8967985817c18fd0461f729527d75998dc0ca307186550141040567b4b55f25ddaff277931f00f2ccc131a3f342eb08563ee61b993b5f321c39b796a3c641185a58f1a7012a5d7469cb78728f9312dba33788a4ac98285f806affffffff017e0b03000000000017a914316f8d5c41d88d3a0df179fc5ad765d57f7f46678700000000


Onchain txid:
87d230cad8ae3cc065ce9b52fbbd81140948e3e95b250c9015faa8048e1dee40


Note: A little work was required to change the original random value in raw bytes:
random_byte_string_dhcmrlchtdj

into a 32-byte hex value.










Source: Creating and signing a standard raw Bitcoin transaction: Iteration #2

Transaction name: "tx2"

Input 1:
- txid:
745e224ccba0a033c55ea80523f207da18b903418ac1f5d293eed62c19e0334d
- previous_output_index:
0
- private key:
0000000000000000000000000000000000726f6164736964655f7069636e6963
- address:
13xPBB175FtPbPQ84iB8KuawaVy3mHrady
- amount (in bitcoin or satoshi):
241777 satoshi
- random value:
000000004d696768747920697320427261686d61206468636d726c636874646a
- input type:
p2pkh

Output 1:
- address:
328cTqexYnQRbN5Dgs12D89sYiPPvtWVbF
- amount (in bitcoin or satoshi):
241552 satoshi
- output type:
p2sh

Change address:
328cTqexYnQRbN5Dgs12D89sYiPPvtWVbF

Fee (satoshi):
225 satoshi


Signed transaction:
01000000014d33e0192cd6ee93d2f5c18a4103b918da07f22305a85ec533a0a0cb4c225e74000000008a47304402201c26a71ec1993096081a9d8a39ad54613e428a4f28632a9bcb978a4321dfae4a0220546b3e0326be273ce3f2f780e269bec65346ed56fa99a0b65b42dd2f73782acf014104b60eb0f9211eb7778ef54963b0a55c986d69f4dee4642ef7e7a16fc16c85eeda9a764032b5836c43e05ba520edd2a9040b9409b74b27da5b2fb1bfa48687b1a1ffffffff0190af03000000000017a91404d73b326fb56e5d09e5f0b4bb3b83b7ff5fb05f8700000000


Onchain txid:
598f47dfb44da351c8576fb975bdab3b023777bb1c1d8ba727afd528ca4d7cf2


Notes:
- A little work was required to change the original random value in raw bytes:
Mighty is Brahma dhcmrlchtdj

into a 32-byte hex value.
- In the source article, the hash type (4 bytes,
01000000
) was erroneously appended to the final signed form of the transaction.










Source: Using a transaction to validate a Bitcoin address


Transaction name: "tx1"

Input 1:
- txid:
bf7a16ef4bf8763b7bf7f02b03155c9a2f9b997d19e64a770bf3f7d3f24cc48b
- previous_output_index:
0
- private key:
a26e15954d2dafcee70eeaaa084eab8a4c1a30b0f71a42be4d8da20123bff121
- address:
1AGygbyEFYduWkkmZbbvirgS9kuBBMLJCP
- amount (in bitcoin or satoshi):
78989 satoshi
- random value:
258f67ebadfc5c460f0f939ba600d49c3eef672241d21f164897d19fb6fe64c9
- input type:
p2pkh

Output 1:
- address:
3QpwGejV9Dyai72HDhXZVkYBWioyuLVjti
- amount (in bitcoin or satoshi):
78768 satoshi
- output type:
p2sh

Change address:
3QpwGejV9Dyai72HDhXZVkYBWioyuLVjti

Fee (satoshi):
221


Signed transaction:
01000000018bc44cf2d3f7f30b774ae6197d999b2f9a5c15032bf0f77b3b76f84bef167abf000000008a4730440220419ecae5ca010db8a2c7ec04cdebaa58a921b0102034db08d6456087c793494e022048cf345bf504905a23021b3dbd95d7a53d8786678505a3c5cd72e03ea259df230141049d8a4c3947fb596c2664218f279be9ba2c0421ca006888243877cdb0c0146202a2a2af299928cc634d58976db32023facf269c1fb7069d9af25c54c07e85eb8effffffff01b03301000000000017a914fdca5619962026e5d80a84d3e25f5cea931ce3858700000000


Onchain txid:
dfd0304f6bd018d8d97e63e387eeab0696b61d9632d50d28f1618daf434a7ba3


Note: In the source article, the hash type (4 bytes,
01000000
) was erroneously appended to the final signed form of the transaction.










Source: Storing bitcoin on an offline Raspberry Pi


Transaction name: "tx1c"

Input 1:
- txid:
07cedb340f588dec2fb14472178a92d5803c70d8d90fc0d8593b03f34035e2cd
- previous_output_index:
15
- private key:
c592e1dad5e9871fdeffb551b4544b0a1cf0378c6371d7a397ff5faf04c934ca
- address:
1vkb4YyPMFcxyC83Z5m5zuN45xASoHeNK
- amount (in bitcoin or satoshi):
0.002 bitcoin
- random value:
644dc86dd0cb4518d9d7f68db2d6e9455e34ceeb32c897df2616418c4c9bb040
- input type:
p2pkh

Output 1:
- address:
369Dpo9CrJASneaHLdwWfKym7N84XTUyvH
- amount (in bitcoin or satoshi):
0.00185414 bitcoin
- output type:
p2sh

Change address:
369Dpo9CrJASneaHLdwWfKym7N84XTUyvH

Fee (satoshi):
14586


Signed transaction:
0100000001cde23540f3033b59d8c00fd9d8703c80d5928a177244b12fec8d580f34dbce070f0000008b483045022100af984f21f3096c47b9684d9cccf76988597accbdb55ff0b66992ef4b3006160802205f6bad0dce3fc5c01ac3128f643302d55b952edf656be25ee996049d74a0e41c0141043ab692792d6c8838fd30c2ff45bf3cbd44286a5cac52ba64dc06452810202b3206f5c7799c3b72ff77fd1976f105ced3cd7700b0412e11266f3888b88c3052c3ffffffff0146d402000000000017a91430d540a50d464852194a195529ebfa44af521bbb8700000000


Onchain txid:
8b0f7ba372b61b195cd237429c9a5d079aaf9887e72dd094f2fa942a0f7ccfc0


Note: In the source article, the hash type (4 bytes,
01000000
) was erroneously appended to the final signed form of the transaction.




Transaction name: "tx3"

Input 1:
- txid:
af3888cc260b6b6bfb8eb256fb70fd1e761a1c7baac0e19cd11b47726f2327d2
- previous_output_index:
25
- private key:
c592e1dad5e9871fdeffb551b4544b0a1cf0378c6371d7a397ff5faf04c934ca
- address:
1vkb4YyPMFcxyC83Z5m5zuN45xASoHeNK
- amount (in bitcoin or satoshi):
1200000 satoshi
- random value:
f78c5ebf0efac89d60aedb38c30906ad5b22ae522a3e29819248c21d59e8397f
- input type:
p2pkh

Output 1:
- address:
36p1w3YrNKd2Q3xaXbe9ASUQkeynjVLfDx
- amount (in bitcoin or satoshi):
0.01197790 bitcoin
- output type:
p2sh

Change address:
36p1w3YrNKd2Q3xaXbe9ASUQkeynjVLfDx

Fee (satoshi):
2210


Signed transaction:
0100000001d227236f72471bd19ce1c0aa7b1c1a761efd70fb56b28efb6b6b0b26cc8838af190000008b483045022100f03c62521817e4faf31abd01782c7df2fcef8a2234400068f1a821b29fe129da02201185879e760fac3d9f2dbdc2e2af074c32c70088dd839108971c39905f5b5bbf0141043ab692792d6c8838fd30c2ff45bf3cbd44286a5cac52ba64dc06452810202b3206f5c7799c3b72ff77fd1976f105ced3cd7700b0412e11266f3888b88c3052c3ffffffff01de4612000000000017a914382b8c40b25f104e9d0277ed91ddf3c849aa34038700000000


Onchain txid:
00f630f5152f4fce9831933fcd4eb878428308755f9f8e31a3135de6a4754093


Note: In the source article, the hash type (4 bytes,
01000000
) was erroneously appended to the final signed form of the transaction.










Source: Creating a Bitcoin transaction with two outputs


Transaction name: "tx_2b"

Input 1:
- txid:
db2c3d84708cd9d0e40ae1754021f9146a0d6ab555fc0e1d547d7876c0c092f4
- previous_output_index:
0
- private key:
d45941cae4e31c824b041407053c9c15624e6234f9649bfd7d5bb5a93c53fe85
- address:
1KHDLNmqBtiBELUsmTCkNASg79jfEVKrig
- amount (in bitcoin or satoshi):
0.003 bitcoin
- random value:
11964601ab4e0f24d09509ad2b72a11cedb079cbc723cea092a3dc9ca36429d7
- input type:
p2pkh

Output 1:
- address:
36zGvt8hkRXFnp2S97ARKTLuwqWx5E9ozU
- amount (in bitcoin or satoshi):
0.00299668 bitcoin
- output type:
p2sh

Change address:
36zGvt8hkRXFnp2S97ARKTLuwqWx5E9ozU

Fee (satoshi):
332


Signed transaction:
0100000001f492c0c076787d541d0efc55b56a0d6a14f9214075e10ae4d0d98c70843d2cdb000000008b483045022100aadd9eaf24a0f1741c712670ca661081b7e6af0b7d02e22377d5e9dc27a92f2f022005720a2a3c72bd62b819627d4220d8cdeff132a97e61e9a87e33ac88af3749a0014104876224f0d418523de3770a2b5d7ce071932227fbf9f760f788b038edf04d5e6029903f6251a3e13701790982677209703b424411af8ee1cc86b8e992a568a363ffffffff01949204000000000017a9143a1c39fcbfd4a1407deddf47249bbfccb12a74788700000000


Onchain txid:
90ebf8803e37f4efea6d53ea61c706d1f253d5ef0e5bc6adab5d2c8ea0361ee1





Transaction name: "tx_3"

Input 1:
- txid:
db2c3d84708cd9d0e40ae1754021f9146a0d6ab555fc0e1d547d7876c0c092f4
- previous_output_index:
1
- private key:
1faf3c86105fe6ee328b29e94197de7e8500ddb8308385a9a8b0cba08d59ce27
- address:
1DLg5i1kBjXYXy9f82xZcHokEMC9dtct7P
- amount (in bitcoin or satoshi):
0.00299226 bitcoin
- random value:
7b088a64007d9d3b06d74ed15d92d6abe7b2796d5e3c4b8c3eebc51aab4576b5
- input type:
p2pkh

Output 1:
- address:
36zGvt8hkRXFnp2S97ARKTLuwqWx5E9ozU
- amount (in bitcoin or satoshi):
0.00298894 bitcoin
- output type:
p2sh

Change address:
36zGvt8hkRXFnp2S97ARKTLuwqWx5E9ozU

Fee (satoshi):
332


Signed transaction:
0100000001f492c0c076787d541d0efc55b56a0d6a14f9214075e10ae4d0d98c70843d2cdb010000008a47304402207d68b7bc903cd351ecfe5e69943d701e432ec6a7983e00af963299b1f67e43e9022025cbfd3b684292da7f1c69fb1d3fdf2d5a4f88a7d19c3a9aabd5ed8b3a6458890141040f46f336b1fca05f244d8d3fd651de5e0afc1ed8412b17026e7fa6f31e2854089277313988737a980bffdb67d8a01a374b9e6ab880b506dfe132ab81721976e7ffffffff018e8f04000000000017a9143a1c39fcbfd4a1407deddf47249bbfccb12a74788700000000


Onchain txid:
908a47f8364d3b16298b9d6d792b314ca3e24a5cec5b3f7c65fc365a86c57758











Source: Creating a Bitcoin transaction with two inputs


Transaction name: "tx3"

Input 1:
- txid:
92616e432f7807bf6d93252fcdca7efb139e56f7aa34835b50670ebc6a4b5649
- previous_output_index:
0
- private key:
419292d169b515be1aec881018157f0a41883ea54da2b2405e10fd8a6abb76ec
- address:
17PZ6uyL59vPirNqqpMnB1kjEXkU7ske7s
- amount (in bitcoin or satoshi):
399171 satoshi
- random value:
c35da685f448d8aca9aed2169e73ef4bde69d51ff574f4980b0b3c71469c88a7
- input type:
p2pkh

Output 1:
- address:
36aPuLiBnXwcx4L3rDc74E9aMvXYsE9dEC
- amount (in bitcoin or satoshi):
398927 satoshi
- output type:
p2sh

Change address:
36aPuLiBnXwcx4L3rDc74E9aMvXYsE9dEC

Fee (satoshi):
244


Signed transaction:
010000000149564b6abc0e67505b8334aaf7569e13fb7ecacd2f25936dbf07782f436e6192000000008b483045022100b94b19c0c6bc845a335004dc6f52a80100fcca3309ffc0fd22d6c95ee207340a0220158c4576cdca1644a1c37b2ec38da1b85babc2caee151cc49fde0a619170a065014104e7652b2b4a2080825bff6ac17eceb52487254e296577da6e0e2183632922ba46c6008d416eac91da3203ec0c728c06272bbb246ddc95c65daceb1636d9dd5a0cffffffff014f1606000000000017a914359810861535b9a53303f78169c0bfc5beab0b188700000000


Onchain txid:
833ebb5434d5ce55e1d0637b5deaf4881a76226d85701e4adb7b9fb8f2a8cf9c