Foundations & cryptography

Merkle tree

A Merkle tree is a way of fingerprinting a whole pile of items so that you can prove any single item belongs in the pile without showing the whole pile. You start by hashing each item; then you hash those hashes together in pairs, then hash those results in pairs, and so on, climbing upward until a single hash remains at the top. That top value is called the Merkle root, and it is a compact summary of every item below it.

The clever part is the proof of membership. To convince someone that one particular transaction is in a block, you do not hand over every transaction — you hand over just the handful of partner hashes needed to walk from your item up to the root. The verifier re-does those few combinations, and if the result matches the known root, the item must be genuine and unaltered. It is like proving your name is in a giant ledger by showing only the short trail of receipts leading to a single seal on the cover, instead of opening every page.

This is what lets lightweight devices trust a blockchain without storing all of it. A phone wallet can confirm that its payment was included in a block by checking a tiny Merkle proof against the block's root, rather than downloading gigabytes of data. The same structure also makes tampering obvious: change any single item and its fingerprint changes, which ripples upward and changes the root.

A block stores only the single Merkle root in its header, yet that one value commits to every transaction the block contains.

Also called
hash tree默克尔树哈希树默克爾樹