Skip to content
LearnBitcoin

LearnGlossary

Block Header

The 80-byte summary at the top of a block: version, previous block hash, Merkle root, timestamp, difficulty target (bits), and nonce.

The block header is the 80-byte summary at the top of every Bitcoin block. It's tiny, but it's everything that matters for proof-of-work.

The six fields:

  1. Version (4 bytes) - signals which protocol rules the block follows.
  2. Previous block hash (32 bytes) - the hash of the prior block's header. This is what makes Bitcoin a chain.
  3. Merkle root (32 bytes) - a single hash that commits to every transaction in the block. Change any transaction and this changes.
  4. Timestamp (4 bytes) - the miner's claim of when the block was mined. Loosely constrained: it must be later than the median of the previous 11 blocks' timestamps (the median time past) and no more than two hours ahead of the receiving node's clock.
  5. Bits (4 bytes) - a compact encoding of the current difficulty target.
  6. Nonce (4 bytes) - the field miners vary while searching for a valid hash.

To mine a block, you compute SHA-256(SHA-256(header)) and check whether the result is at or below the target encoded in bits. If not, change the nonce and try again. (When you exhaust all 4 billion nonce values, you tweak the coinbase transaction's extranonce, which changes the Merkle root, and start over.)

Because a header is only 80 bytes, a node can check a block's proof-of-work before it has the block itself. Bitcoin Core has synced headers first since version 0.10 (2015), and since BIP 130 a peer can ask to have new blocks announced by their headers rather than by hash alone. Lightweight clients (SPV wallets) follow the chain by checking only the headers - about 4.2 MB per year, as the whitepaper worked out - without storing the gigabytes of full transaction data.

See Mining rabbit hole for the search process; Block for what the header is summarizing.

Key takeaways

  • Contains the essential hashing elements for proof-of-work
  • Links to previous block and summarizes transactions via the Merkle root
  • Miners focus on finding a valid header hash to produce a new block

Sources (6)

External references (1)

Related terms (13)

Published . Revised . No corrections logged for this page.

Edit this page on GitHub