Block Header
Quick Definition
A block header is the compact 80-byte bundle of metadata that summarizes a Bitcoin block. By chaining and securing these headers together, miners protect the blockchain, and nodes can verify it efficiently.
Key Takeaways
Field | Purpose | Size |
---|---|---|
Version | Signals which consensus rules the miner followed when creating the block. | 4 bytes |
Previous Block Hash | Cryptographically links the block to the one before it, forming the chain. | 32 bytes |
Merkle Root | Single 32-byte hash that commits to every transaction inside the block. | 32 bytes |
Timestamp | When the miner claims the block was found. | 4 bytes |
nBits | Encodes the current difficulty target the header’s hash must meet. | 4 bytes |
Nonce | 32-bit counter miners iterate to search for a valid hash below the target. | 4 bytes |
- 80 bytes total: The fixed size is critical for bandwidth and storage efficiency, as nodes keep only headers for lightweight validation.
- Double-SHA-256: Each header is hashed twice; the result must be ≤ target to satisfy proof-of-work.
- SPV (Simplified Payment Verification): Wallets that don’t download full blocks can verify payments by checking chains of headers plus Merkle proofs, relying on this succinct summary.
In-Depth Explanation
Chaining & Immutability
The Previous Block Hash field forces every block to reference its parent’s header hash. A change in any historical header propagates forward, requiring new proof-of-work for every descendant, a deterrent to attackers. This makes retroactive tampering computationally impractical, forming the backbone of Bitcoin’s security.
Transaction Commitment
All transactions are hashed into a Merkle tree whose top hash (the Merkle Root) lives in the header. This lets nodes prove a transaction’s inclusion with only log₂(n) hashes, keeping SPV proofs lightweight.
Difficulty & Nonce Dance
- nBits encodes the difficulty target as a compact representation.
- Miners vary the Nonce (and occasionally extra-nonce data in the coinbase transaction, an additional field adjusted when the nonce is exhausted) to find a header hash below that target.
- Roughly every two weeks (2,016 blocks), nodes recompute difficulty to ensure a valid header is found about every 10 minutes.
Version Signaling
The Version field allows miners to indicate support for soft forks (e.g., SegWit, Taproot). Nodes track these bits to measure activation thresholds without disrupting consensus.
Timestamp Constraints
Nodes reject headers with timestamps more than two hours into the future relative to their clocks or earlier than the median time of the last 11 blocks, guarding against denial-of-service and difficulty-manipulation attacks.
By packing these six fields into an 80-byte structure, the block header provides Bitcoin with a tamper-evident audit trail that anyone, full node or mobile wallet, can verify quickly, forming the backbone of the network’s security and decentralization.