Chapter 2 - Assessment

Question 1

Using the raw transaction data provided and the hashing calculator, calculate the output of each round of SHA256 hashing and the TXID.

Bitcoin Raw Transaction String (A)

SHA256 HASH

HASH256 or TXID (Little Endian)

TXID or HASH256 (Big Endian)

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1

103588004045345c0005d000000912e0000ffffffff0201000000000000001976a91470a419336ae604dd

f73e4f8199f1d03b3c2f260b88ac97141d95000000001976a91463dd7f90e949f8e354415233e51d3392d4d8f55288ac00000000

350e0c9b1ba7224206a917c462f1fbc8a995946bff6d6a43d3e591187ddaf5a4

e08e75e177ed3c415ea001af6c8c67b09348e002f042685ef2d792817f49ff7e

7eff497f8192d7f25e6842f002e04893b0678c6caf01a05e413ced77e1758ee0

Question 2

Given the following four transactions, calculate their TXID and Merkle root of the set.

TX

RAW TX DATA

0

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1103588004045345c0005d000000912e0000ffffffff0201000000000000001976a91470a419336ae604ddf73e4f8199f1d03b3c2f260b88ac97141d95000000001976a91463dd7f90e949f8e354415233e51d3392d4d8f55288ac00000000

1

0100000001e827447379859411abecbc15ae3347b1656b495038dc8af467b9c174e4727aaa000000006a47304402201739402c0f77393b5242309113b6a6a99e5952515815411d36e1c74e2f1d682b022074052e3337ca3d525f39d4c6d434dfb7e59a23468ef65e9f09d24ef5d76279d10121034a37823f75ea150715b6ae880cf2d09246026df1fa957646572f384176ef9ab7ffffffff0200b4c404000000001976a9144203cd42e702127b4c3702b743a9aa6155b38f8a88ac054d5011000000001976a9145b6e91c7f89f8691bc9c31bcaa22a06d26cbf0cb88ac00000000

2

010000000187af517c7751cdb6180452ce26862ce3fb1f5a258179b53d6999df95aad5c372000000006a4730440220755869f300053c894984910b92b1777904506d8b531e36df15908752b89a6123022077937770f73d5122d1d4fdf6d49c7259e534ce48de861989decae0e0e1da0637012102ee79173df806b1945922e548b502934e48a202fdb5dd7684fcf0d4d272b6e58cffffffff0290581700000000001976a9142df4aebf50cee7444411a956ad97f90782f8bdf088ac201e9c02000000001976a9144f4252a0182bdc66fe59cf5b8a5da4275ea5cbc688ac00000000

3

0100000001f253cf794a7a0aff45144c8ea1fc4271be683952ae8241ee1524266b46375246000000006b4830450221008f8c069a2e8aa0cce2455374916ff1dedc40da58680c7fab925b0d8206ed4e48022013bd576c0ed17448525d282ca4ddc55245c788da88eee7e35a2084b7bed78caa01210302e3a61057a9c9616291b17085c16d9e1f22821395e3ba792f4492f61d57169bffffffff0130c11d00000000001976a914800311626c5e50a10ea7d84f42471c0e7c17a4a088ac00000000

Merkle Root (Big Endian)

264cd613206b74d5b9cff0d18a9226b23ab39362798cc3f85484b65c7818d8ab

Merkle Root (Little Endian) or HASH256 (0-1 || 2-3)

abd818785cb68454f8c38c796293b33ab226928ad1f0cfb9d5746b2013d64c26

HASH 256 [0 || 1]

HASH 256 [2 || 3]

c9210201ac73d134b2bd74a7e00d952f6c056b7e989d8b7ea3a7ede4b1ec8c5a

01dcb25c68c7925b0b265ab24660ce27d7204c2dd74e305a9b646faa38560a49

HASH256 (Little Endian)

HASH256 (Little Endian)

HASH256 (Little Endian)

HASH256 (Little Endian)

e08e75e177ed3c415ea001af6c8c67b09348e002f042685ef2d792817f49ff7e

70359eea510ca107ee73540e228fad703fde19420e1d204067ba10e4d61661de

cf365afd3a1f8b6fa9218370dc4b2f23c1c3d3fc3071e49ec52e121629f1a78a

4d4d3a36db90b29ef2f8abb8ec157f2b47e248489ee2993c96f13427c6202a0a

TXID or HASH256 [0] (Big Endian)

TXID or HASH256 [1] (Big Endian)

TXID or HASH256 [2] (Big Endian)

TXID or HASH256 [3] (Big Endian)

7eff497f8192d7f25e6842f002e04893b0678c6caf01a05e413ced77e1758ee0

de6116d6e410ba6740201d0e4219de3f70ad8f220e5473ee07a10c51ea9e3570

8aa7f12916122ec59ee47130fcd3c3c1232f4bdc708321a96f8b1f3afd5a36cf

0a2a20c62734f1963c99e29e4848e2472b7f15ecb8abf8f29eb290db363a4d4d

Question 3

Given the raw transaction data for a fifth transaction, append its hash to the Merkle tree and calculate the Merkle root on a new layer of the tree.

TX Index

RAW TX DATA

4

01000000017201c91b9ac083dbe65684bf2d8f131c3346700c337370c32705fe4793a2c12b000000006b48304502210083d7bd7bc3a1bb7f58b83841272856b0e044b86530fa5f838672695e738af74702203e5bbb8580140ba79f33093ea7d1227ca98007ced40c79ded5c3fb7c5fac8894012103493f703ce93ec19a65d7d3ac98817debf3ed42deeeeede76b7f8616bbfd01341ffffffff03cd4b6601000000001976a91469c1d9d31dcb24ac89eaad0929b1f167166cdc9f88acfc5f5c01000000001976a914a1945188b897d3a6575481d9f7910c1387187a7088ac49a38003000000001976a9145f8b027ff8179ca0d1601752364fb9e8fae1630a88ac00000000

Merkle Root (Big Endian)

b0f695a6a21da83cc1b806d56012c3e8f8694bf1ab931aa4e79a74c122d332d1

Merkle Root (Little Endian)

d132d322c1749ae7a41a93abf14b69f8e8c31260d506b8c13ca81da2a695f6b0

HASH256 [ 0-1 || 2-3 ]

HASH256 [ 4,4 || 4,4 ]

abd818785cb68454f8c38c796293b33ab226928ad1f0cfb9d5746b2013d64c26

1611d4e649adbe4cb6432b98ae7399098b29e789ae86cdd9d2efd011f00db231

HASH256 [ 4 || 4 ]

ec0f83202c381a7c83ac5d382577e9a65d8808ec0a8be15222da4b1a57ffaba2

HASH256 (Little Endian)

b49ce5eab6ee28e88e1e53271678e801f4606796956fd274bbb0572206b17e12

TXID or HASH256 [4] Big Endian

127eb1062257b0bb74d26f95966760f401e8781627531e8ee828eeb6eae59cb4

Last updated