How can you check one piece of a huge file without downloading the rest?
A single hash at the top of a tree can vouch for every block underneath it, letting you check one tiny branch instead of the whole forest.
▶ Start the storyImagine a file shared across a million computers, split into thousands of small pieces. How do you check that one single piece is genuine without downloading and hashing every other piece too? A Merkle tree solves this by hashing data in layers: every leaf is labelled with the hash of one data block, and every node above it is labelled with the hash of its children's labels, all the way up to one top hash, also called the root hash, that stands for the entire structure.

That layered structure is what makes verification cheap. Proving that a single leaf belongs to the tree takes a number of hashes proportional to the logarithm of the total number of leaves, while a plain list of hashes would need a number proportional to all the leaves themselves. In practice, that means one small branch of the tree can be downloaded and checked for integrity immediately, without needing the whole tree to be available yet.
The idea isn't new: it's named after Ralph Merkle, who patented it in 1979, decades before it became essential infrastructure. Today it's used in the Bitcoin and Ethereum peer-to-peer networks, among many other systems, usually built with a cryptographic hash function such as SHA-2 doing the actual hashing at every layer.
Like any clever trick, it has a known weak spot: because the Merkle root alone doesn't reveal how deep the tree is, an attacker can sometimes construct an entirely different document that produces the same root hash, a second-preimage attack. That's why some implementations add a safeguard, like marking leaf hashes and internal node hashes differently, so a forged document can't quietly pass as the original.
Quiz me
0/3
Recap
One root hash at the top can vouch for an entire tree of data underneath it.
Surprising fact · Verifying one leaf in a million-leaf tree takes only about twenty hashes thanks to the tree's logarithmic structure.
Sources (1)
No source, no claim. Every fact in this lesson (12 claims) cites at least one of these.