mining idea – Why does decoded block information not match coinbase transaction enter?


I’m wanting on the particular block at top 680175.

Through bitcoin-cli getblock 00000000000000000004dbd66fa71fdcd62658bf8c8e2e153521257ad5858c71 0 I obtained the serialized, hex-encoded block information. In accordance with the part Serialized Blocks the txn_count begins at Byte #81. Following the outline of CompactSize Unsigned Integers I get:

In [115]: int.from_bytes(byte_arr[80:81], "little", signed=False)
Out[115]: 253

In [116]: tnx_count = byte_arr[81:83]
     ...: tnx_count = int.from_bytes(tnx_count, "little", signed=False)

In [117]: tnx_count
Out[117]: 1702

There are certainly 1702 transactions which might be verified through ./bitcoin-cli getblock 00000000000000000004dbd66fa71fdcd62658bf8c8e2e153521257ad5858c71 2 within the attribute nTx.

Now I do know that the remainder of the block information is the transactions’ half. In accordance with the part Uncooked Transaction Format the primary 4 bytes are the model:

In [118]: tnx_part = byte_arr[83:]

In [119]: model = tnx_part[:4]

In [120]: int.from_bytes(model, "little", signed=False)
Out[120]: 1

This appears to be right, too. So, the subsequent bytes decide the variety of tx_in depend, however there I get 0 which is fake. And the enter of the coinbase transaction doesn’t begin with a 32-byte null:

In [121]: int.from_bytes(information[4:5], "little", signed=False)
Out[121]: 0

In [122]: information[4:10]
Out[122]: bytearray(b'x00x01x01x00x00x00')

Am I lacking one thing? The enter of the coinbase transaction appears to not match the outline.

Supply hyperlink

Leave a reply