Blockchain
As we discussed in Chapter 1, Blockchain 101, a blockchain is a distributed ledger of transactions. Specifically, from Bitcoin's perspective, the blockchain can be defined as a public, distributed ledger holding a timestamped, ordered, and immutable record of all transactions on the Bitcoin network. Transactions are picked up by miners and bundled into blocks for mining. Each block is identified by a hash and is linked to its previous block by referencing the previous block's hash in its header.
The data structure of a Bitcoin block is shown in the following table:
Field | Size | Description |
Block size | 4 bytes | The size of the block. |
Block header | 80 bytes | This includes fields from the block header described in the next section. |
Transaction counter | Variable | The field contains the total number of transactions in the block, including the coinbase transaction. Size ranges from 1-9 bytes. |
Transactions | Variable | All transactions in the block. |
The block header mentioned...