Merkle Inclusion Proofs
A visual, step-by-step guide to proving a transaction lives in a block
01The Merkle Tree
A block contains 8 transactions. Each is hashed to form a leaf, then pairs are hashed together upward until a single Merkle Root remains. This root is stored in the block header.
02Pick a Transaction to Prove
Select a transaction below. The proof consists of the sibling hashes (orange) needed at each level. The verification path (green) shows what you recompute.
Siblings needed:
Proof size: 3 hashes × 32 bytes = 96 bytes
03Step-by-Step Verification
Walk through the verification algorithm. At each level, combine the running hash with the sibling in the correct order.
x₁ = H( x₀ ‖ b7c2 ) = 5c2d
x₂ = H( x₁ ‖ 8e7f ) = f6e3
x₃ = H( x₂ ‖ 7a5b ) = 2d8f
Proof accepted! ✓
04Why This Works
04aCompleteness
If the transaction is truly in the tree and the prover gives correct siblings, the verifier recomputes exactly the same parent hashes the tree originally computed — all the way up to the root. It's a simple induction on levels.
04bSoundness
To fake a proof for a transaction not in the tree, the attacker would need to find different inputs that produce the same hash at some internal node — i.e., a hash collision. Under standard cryptographic assumptions, this is computationally infeasible.
Above: a fake leaf (red) would need to “repair” the mismatch at some level — requiring a hash collision (✕).
05The Logarithmic Payoff
A proof needs only one sibling per level. For a tree of N transactions with depth ⌈log₂ N⌉, the proof is tiny: