Merkle Trees

From the everyday intuition, to how the tree is built, to proving one transaction is in a billion with a handful of hashes.

The Friends and the Name Game

Imagine you have 20 friends, and each has written their name on a slip of paper in a pile on your desk. You want to know whether your friend Sophia is in the group.

The slow way: check each slip one by one until you find Sophia or reach the end of the pile.

The smart way: fingerprints on fingerprints

Instead of just names, we get clever:

  1. Give each name a unique digital fingerprint (a hash).
  2. Pair the fingerprints and hash each pair into a new fingerprint.
  3. Keep pairing and hashing until one fingerprint remains at the top: the root.

That single root is a fingerprint of the whole group. Change any name and the root changes. And as you'll see next, it lets you prove someone is in the group by checking only a handful of fingerprints, not all 20.