Suppose a friend hands you a million records and swears not a single byte was changed in transit. How do you check without re-downloading and re-comparing everything? The clever answer, invented by Ralph Merkle in 1979, is to fold all that data into one short hash — and to do it so cleverly that you can later prove any one record belongs, using only a handful of extra hashes.
The trick is to hash the data in pairs, level by level, up to a single root. Each parent is the hash of its two children; the lone hash at the top — the Merkle root — depends on every leaf below it. Change one byte in one leaf and the root changes completely.
That single number is a fingerprint for the whole dataset. And because the tree has only about log(n) levels, you can prove membership of any leaf by revealing just the hashes along one path to the top. This is the quiet engine inside Git, Bitcoin, and the certificate logs that keep the web honest.
Comments
Loading comments...