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
Why do miners hash the block header instead of the full block?
The header is only 80 bytes, while a full block can be over a megabyte. Hashing a smaller fixed-size input is far faster. The Merkle root inside the header already cryptographically commits to all transactions, so nothing is sacrificed by hashing just the header.
What is the nonce in a block header?
The nonce is a 32-bit number miners increment billions of times per second, trying to find a value that makes the block header hash fall below the current difficulty target. It is the main variable adjusted during mining.
What happens when a miner exhausts all nonce values?
With only about four billion possible nonce values, miners can exhaust the entire space in seconds with modern hardware. When this happens, they modify another field such as the timestamp or the extra nonce in the coinbase transaction to get a new set of header values to hash.