🔍 Merkle Proofs: Verify Without Downloading Everything

Understand how SPV wallets verify transactions without the full blockchain

Previous
Tree Construction

✅ Merkle Proofs

Merkle proofs are the magic that makes light clients possible! Verify a transaction exists without downloading the entire block.

🎯 What is a Merkle Proof?

A Merkle proof is a sequence of hashes that allows you to verify a specific piece of data is part of the Merkle tree, using only the root hash and a few sibling hashes.

The Challenge:

You have a block with 1000 transactions (~1 MB). You want to verify TX #573 is in the block, but you only have the block header (80 bytes) with the Merkle root.

Without Merkle Proof: Download all 1000 transactions (1 MB) ❌
With Merkle Proof: Download TX + 10 hashes (~400 bytes) ✅

🎮 Interactive Proof Verification

Select a transaction to verify, then watch the proof verification process:

Select Transaction to Verify:

📊 Proof Size Comparison

TransactionsTree HeightProof SizeFull Data SizeEfficiency
104~128 bytes~2.5 KB95% smaller
1007~224 bytes~25 KB99.1% smaller
1,00010~320 bytes~250 KB99.9% smaller
10,00014~448 bytes~2.5 MB99.98% smaller
Key Insight: As transaction count increases, Merkle proofs become exponentially more efficient!

🔍 Proof Construction Process

To Create a Proof for TX #3:
1.
Start at leaf: Hash(TX3)
2.
Collect sibling: Need Hash(TX4) to compute parent
3.
Move up: Need Hash(TX1+TX2) to compute next level
4.
Reach root: Compare computed root with block header
Proof Components:
proof = [
Hash(TX4), // Sibling at level 0
Hash(TX1+TX2), // Sibling at level 1
Hash(TX5-8), // Sibling at level 2
]
// Only 3 hashes needed for 8 transactions!

💡 Key Benefits

📱
Light Clients Enabled

Mobile wallets can verify payments without downloading gigabytes of blockchain data. Essential for adoption!

Logarithmic Verification

Verify in O(log n) time and space. For 1 million transactions, only 20 hashes needed!

🔒
Tamper-Proof

Can't forge a proof without breaking the hash function. Cryptographically secure verification.

💾
Bandwidth Efficient

Save 99.9% bandwidth compared to downloading full blocks. Critical for resource-constrained devices.