Merkel Trees & Merkel Proofs

Merkle Proofs and Simplified Payment Verification (SPV) in Bitcoin

Beginner LevelBy Pratima Sharma

A Merkle Proof allows a lightweight client to verify that a transaction is included in a block without downloading the entire block.

How it works:

  1. SPV clients store only the block headers, which include the Merkle Root.
  2. To verify a transaction Tx3, the client requests the Merkle path from a full node:
  • H3 → H4 (sibling hash) → H12 (parent hash)
  1. The client reconstructs the Merkle Root using the hashes along the path and checks if it matches the root in the block header.

Example – SPV Verification:

  • Alice wants to verify her Bitcoin transaction in block #100,000.
  • SPV client knows the Merkle Root from the block header.
  • Alice provides Tx3 and its Merkle path (H4, H12).
  • Client calculates:
    • H34 = SHA256(H3 || H4)
    • Root = SHA256(H12 || H34)
  • If this equals the Merkle Root in the block header → Transaction verified without downloading all transactions in the block.

Benefits for Blockchain:

  • Saves storage and bandwidth.
  • Enables mobile/lightweight wallets to participate securely.
  • Ensures trustless verification using cryptography instead of relying on a full node.

Summary:

  • Merkle Tree: Binary tree of transaction hashes; root summarizes all transactions.
  • Transaction Integrity: Any modification in a transaction changes the root, allowing tamper detection.
  • Merkle Proofs & SPV: Lightweight clients can verify inclusion of a transaction using only the Merkle path, not the full block.
  • Widely used in Bitcoin, Ethereum, and many other blockchains to improve efficiency, security, and scalability.

Continue Learning

Explore more topics in Cryptography in Blockchain or browse other tutorials.