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

Hash a pair of nodes

Combine two fixed-width digests under an explicit rule.

LET’S PICTURE IT

Two record fingerprints form the input for one parent fingerprint.

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.

Use complete child hashes

Each child digest has thirty-two bytes. Concatenating two children therefore gives sixty-four input bytes before applying the parent hash.

Apply the chosen ordering

The local tool sorts the two hash values before concatenation. This makes the pair operation commutative, unlike a position-sensitive left-then-right convention.

Hash bytes rather than labels

Displayed abbreviations such as abcd…1234 are only labels. The calculation uses the complete child bytes and does not include an ellipsis.

Reuse the rule consistently

Building and verifying must use the same pair operation at every level. One unsorted step can produce a different 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

Are abbreviated hash labels valid inputs for reproducing the parent?

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.