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

Odd leaf construction choices

An unmatched node needs a documented construction rule.

LET’S PICTURE IT

An odd number of teams leaves one group without a partner.

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.

Locate the unmatched node

A level with three nodes has one complete pair and one remaining node. The tree algorithm must decide what happens to that remainder.

Describe promotion

The playground promotes an unpaired node unchanged to the next level. It does not hash that node with itself merely because a sibling is absent.

Compare duplication

Another convention may duplicate the last node and hash the pair. That construction can produce a different root for the same original leaves.

Verify under the exact rule

A proof path may omit a sibling at a promoted level. The tree builder and verifier must agree on shape and promotion behavior.

Follow the proof model

Three leaves A, B, C
level 1: hashPair(A,B), C
root: hashPair(hashPair(A,B), C)

A, B and C here denote their leaf hashes.

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

What does this site’s playground do with an unmatched node?

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.