network

block header

The block header is the 80-byte metadata section of each Bitcoin block. It contains six fields: the previous block hash, the Merkle root of all transactions, a timestamp, the difficulty target, the version, and the nonce — the value miners vary to find valid proof-of-work.

The block header is an 80-byte data structure that sits at the top of every Bitcoin block. It contains exactly six fields: the protocol version number, the hash of the previous block header (which links it to the chain), the Merkle root (a single hash that commits to every transaction in the block), a Unix timestamp, the encoded difficulty target (called bits), and the nonce. These six fields together are what miners repeatedly hash in the process of mining.

The Merkle root is particularly important: it is derived by hashing transactions in pairs until a single root hash remains. This means that if any transaction in the block is altered, the Merkle root changes, which changes the block header hash, invalidating the block. The entire transaction set is therefore committed to in just 32 bytes within the header.

Miners hash only the 80-byte header, not the full block, which can be several megabytes. This is efficient: the SHA-256 hashing algorithm can process the 80-byte header extremely fast, allowing modern ASICs to perform trillions of hash attempts per second. When a miner adjusts the nonce and exhausts all four billion possible values without finding a valid hash, they modify other fields such as the timestamp or the coinbase transaction to reset the nonce space.

Frequently asked questions