mining idea – Why does decoded block information not match coinbase transaction enter?
I’m wanting on the particular block at top 680175.
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 : int.from_bytes(byte_arr[80:81], "little", signed=False) Out: 253 In : tnx_count = byte_arr[81:83] ...: tnx_count = int.from_bytes(tnx_count, "little", signed=False) In : tnx_count Out: 1702
There are certainly 1702 transactions which might be verified through
./bitcoin-cli getblock 00000000000000000004dbd66fa71fdcd62658bf8c8e2e153521257ad5858c71 2 within the attribute
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 : tnx_part = byte_arr[83:] In : model = tnx_part[:4] In : int.from_bytes(model, "little", signed=False) Out: 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 : int.from_bytes(information[4:5], "little", signed=False) Out: 0 In : information[4:10] Out: bytearray(b'x00x01x01x00x00x00')
Am I lacking one thing? The enter of the coinbase transaction appears to not match the outline.