Blocks
A Bitcoin block is a data structure containing (in a simplified view) a header, along with the list of transactions confirmed within the block. Each block header has a specific set of fields that are listed in Table 3.4. In particular, a block header contains a pointer to the former block, effectively creating a blockchain.
Blockchain
As mentioned above, each block contains a pointer to the former block; the chain of blocks therefore constructs the blockchain (see Figure 3.5). The blockchain starts with a genesis block that has been generated by the creator of Bitcoin.
The blockchain is extended by appending blocks to the last block that has been added to the blockchain. The process of creating blocks is commonly referred to as mining, and it requires providing a proof-of-work that we detail in the next paragraphs.
Because different miners perform mining concurrently, it can happen that competing blocks are created at the same block height. This event is commonly
Table 3.4
Bitcoin Block Header Format
|
Field |
Description |
Size |
|
Version |
Block version number |
4 bytes |
|
Hash of previous block |
Hash of previous block header |
32 bytes |
|
Merkle root hash |
Transaction Merkle root hash |
32 bytes |
|
Time |
Unix time stamp |
4 bytes |
|
nBits |
Current difficulty of the network |
4 bytes |
|
Nonce |
Allows miners to search a block |
4 bytes |
Figure 3.5 Chain of blocks starting from the genesis block forms the blockchain.
referred to as forking and is depicted in Figure 3.6. Eventually, only one blockchain, the longest, can prevail. Blocks that are not part of the longest chain are therefore discarded and are referred to as orphan blocks.