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

Build a membership proof

Collect the sibling needed at each step toward the root.

LET’S PICTURE IT

A route to the top needs the neighboring branch at each junction.

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.

Select one leaf

For the four-leaf example, choose A’s leaf hash. The proof should not include every other original item when a smaller sibling path is enough.

Collect its first sibling

A needs sibling B to reconstruct parent AB. Under sorted pairing, their complete hashes are sorted before the pair is hashed.

Collect the next sibling

Parent AB needs sibling parent CD to reconstruct the root. The proof for A therefore contains B and the combined CD node.

Preserve the verification order

The verifier consumes siblings from the leaf level upward. Reordering the proof list can change the computed root.

Follow the proof model

Convention: UTF-8 leaves, Keccak-256, lexicographically sorted hash pairs
leaf A: 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760
sibling B: 0x1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111
parent AB: 0x69de756fea16daddbbdccf85c849315f51c0b50d111e3d2063cab451803324a0
sibling parent CD: 0xe62e1dfc08d58fd144947903447473a090c958fe34e2425d578237fcdf1ab5a4
root: 0x4e2b32e9c7b10ee15f38192ed65b95656a84e32531157b9384ef0d3cabe95956

Binary examples use the stated local playground convention. They are not Ethereum account or storage trie proofs.

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

Which siblings prove A in this four-leaf example?

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.