Merkle tree
A Merkle tree is a hierarchical hash structure where each leaf is a data hash and each parent is the hash of its children, allowing a large dataset's integrity to be verified with a single root hash.
In Bitcoin each block uses a Merkle tree to summarise all transactions in a single merkle root in the block header. This enables two things: compact block headers (80 bytes), and SPV proofs — a light client can prove a transaction is in a block with just log(n) hashes, without downloading the whole block. Merkle trees also underpin Git, ZFS, IPFS and countless other systems.
Example
A block with 4096 transactions has a 32-byte merkle root. Proving transaction #1247 is inside takes only 12 hashes (log₂(4096)) — visible efficiently in any SPV wallet.
Frequently asked questions
What is a Merkle proof?
The list of sibling hashes on the path from leaf to root. With those plus the transaction, anyone can recompute the root — without seeing the other 4095 transactions.
Collision-vulnerable?
Bitcoin uses double SHA-256. Theoretically birthday-attack at 128-bit effective strength, practically infeasible before large-scale quantum. Safe for the foreseeable future.
Related terms
Further reading
- → Our service: Bitcoin & Fintech