In this track: Trees, roots and proofs
advanced · 8 MIN READ

Merkle trees and proofs

Prove that one item belongs to a set using a short path of hashes.

LET’S PICTURE IT

A big family tree of fingerprints lets you check one leaf by carrying its siblings on the way to the top.

SEE IT FOR YOURSELF
Build a root and follow one membership proofStep 1 / 4
Build a root and follow one membership proofA0x03783f…b760B0x1f675b…9111C0x017e66…8f72D0x6c3fd3…79f2A0x03783f…b760B0x1f675b…9111C0x017e66…8f72D0x6c3fd3…79f2hash(A,B)0x69de75…24a0hash(C,D)0xe62e1d…b5a4A0x03783f…b760B0x1f675b…9111C0x017e66…8f72D0x6c3fd3…79f2hash(A,B)0x69de75…24a0hash(C,D)0xe62e1d…b5a4ROOT0x4e2b32…5956A0x03783f…b760B0x1f675b…9111C0x017e66…8f72D0x6c3fd3…79f2hash(A,B)0x69de75…24a0hash(C,D)0xe62e1d…b5a4ROOT0x4e2b32…5956

This example hashes UTF-8 A, B, C and D. The displayed hashes are abbreviated, and the tree uses the playground’s sorted-pair convention.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Build from the bottom

Hash each item to create leaves. Combine neighboring leaf hashes and hash them into parents. Repeat until a single root remains. Change one item and the hashes along its path change, including the root.

A proof carries siblings

To check a leaf against a trusted root, use the sibling hash at each level and recompute the path. With a balanced binary tree, this takes far fewer hashes than sharing every item. The proof only means something if you know which root you trust.

Conventions must match

Our Merkle playground hashes UTF-8 items, sorts each pair of hashes, concatenates the raw bytes and hashes the pair. An unpaired last node is promoted. This is an educational convention; it is not Ethereum’s state-trie format or a drop-in proof for every allowlist contract.

Roots are commitments

A successful proof shows membership under the chosen hashing and tree rules. It does not show that the data is truthful or that the root came from the right source. Ethereum uses more specialized authenticated structures for state; read the primary reference to explore that next.

TURN UNDERSTANDING INTO PRACTICEOpen the Merkle trees →
QUICK CHECK · NO PRESSURE

What must the verifier trust before a membership proof is useful?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.