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

Proof size and tree depth

Balanced binary trees provide logarithmic-sized membership paths.

LET’S PICTURE IT

A branching directory needs one choice per level rather than one record per entry.

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.

Count levels for a full tree

A full balanced binary tree with eight leaves has three edges from a leaf to the root. A basic membership proof uses three sibling hashes.

Translate hashes into bytes

Three thirty-two-byte siblings occupy ninety-six raw hash bytes. Serialization, leaf data and other metadata can add to the complete transmitted proof size.

Handle incomplete shapes

Odd-node promotion and other construction choices can produce paths of differing lengths. Do not apply a perfect-tree count without checking the actual shape.

Separate verification cost

A shorter path generally needs fewer pair hashes, but total application gas includes input handling and surrounding checks. Proof size is not the whole transaction cost.

Follow the proof model

2 leaves → 1 sibling
4 leaves → 2 siblings
8 leaves → 3 siblings

Perfect balanced binary examples.

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

How many siblings are in a basic path for a full eight-leaf binary tree?

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.