Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
The Deepest Crypto Knowledge Base
crypto-bible.com
LATEST
SpaceX IPO Confirms 18,712 BTC Holdings: Average Cost $35,324, 8th Largest Corporate Holder — Far Exceeding Pre-IPO Estimates  ·  BlackRock BITA 4th Amended S-1: 0.65% Fee Undercuts Rivals, Covered Call Strategy Lets BTC Holders Earn Monthly Income — July Launch Imminent  ·  Solana 2026: DEX Volume Surpasses Ethereum, TVL Only One-Tenth — What This Gap Actually Means  ·  Choosing a Crypto Exchange: It's Not Just About Fees — A Complete Evaluation Framework for Security, Compliance, and Fiat Access  ·  Bitcoin vs Ethereum: Both Lead Crypto, but They Made Completely Different Choices on the Most Fundamental Design Questions  ·  Israel's Crypto Tax Amnesty Got Only 58 Filers: A Failed Policy Experiment That Exposes the Global Taxation Dilemma
Glossary · blockchain-fundamentals

Merkle Tree

blockchain-fundamentals Advanced

30-Second Version · For the impatient
A Merkle tree is a tree-shaped data structure derived from cryptographic hash functions, developed by computer scientist Ralph Merkle in 1979. In blockchain, it's used to efficiently summarize and verify the integrity of all transactions in a block: each transaction is hashed, pairs are hashed together, this process repeats level by level upward until a single Merkle Root is produced. This root is recorded in the block header. Any tampered transaction changes its hash, cascading to change all parent hashes, ultimately changing the root — making tampering immediately detectable.
Full Explanation +
01 · What is this?

What are the Merkle tree's computation steps, and why is it more efficient than simply hashing all transactions once? Merkle tree computation can be illustrated with four transactions (A, B, C, D). Step 1, leaf nodes: compute hash values for each transaction separately, getting Hash(A), Hash(B), Hash(C), Hash(D). Step 2, intermediate nodes: pair adjacent hashes and hash again, getting Hash(AB) = Hash(Hash(A) + Hash(B)), Hash(CD) = Hash(Hash(C) + Hash(D)). Step 3, root node (Merkle Root): repeat this process for the final layer until only one hash remains — the Merkle Root. Why more efficient than hashing all transactions directly: to verify transaction A is in this block, you don't need all other transactions' content — just Hash(B) (paired with Hash(A)) and Hash(CD) (paired with Hash(AB)) plus the root hash, verifiable in three steps. Even for blocks with 1,000 transactions, verifying any one transaction only requires ~10 hash values (log₂ 1000), not downloading all 1,000 full transaction records.

02 · Why does it exist?

What are the specific applications of Merkle trees in Bitcoin and Ethereum, and what are the differences? In Bitcoin: each block header contains a Transaction Merkle Root, summarizing the integrity fingerprint of all transactions in the block. Bitcoin's light nodes (SPV nodes) only need to download block headers (~80 bytes each) rather than complete blocks (potentially several MB), using Merkle Proof paths to verify whether specific transactions are on-chain — dramatically reducing verification resource requirements. In Ethereum: Ethereum uses a more complex structure with three Merkle tree variants — Merkle Patricia Trie (MPT): Transaction Trie, Receipts Trie, and most importantly the State Trie. The State Trie records the current state of every Ethereum address (balance, contract code, storage data), letting anyone verify the current global state without replaying entire history. Extended application: Proof of Reserves widely uses Merkle trees — exchanges put all user account balances into a Merkle tree, letting users verify their balance is included in total reserves without seeing other users' balances (privacy protection).

03 · How does it affect your decisions?

What is a Merkle Proof, and how does it let light nodes verify transactions without downloading the entire block? A Merkle Proof (also called a Merkle inclusion proof) is a cryptographic tool that lets you prove with minimal data that a transaction genuinely exists in a specific block. Using a block with 4 transactions (A, B, C, D) to verify whether Transaction A is in the block: you hold Hash(A) and the Merkle Root. Your node requests the Merkle Proof from a full node, which returns: Hash(B) (the sibling needed to pair with Hash(A)) and Hash(CD) (the sibling needed for Hash(AB) to compute upward). You compute Hash(AB) from Hash(A) and Hash(B), then compute your own reconstructed root from Hash(AB) and Hash(CD) — if it equals the known Merkle Root, Transaction A is indeed in this block. The entire process requires only 2 hash values (not downloading all block transactions) with minimal computation. For a block with 10 million transactions, the Merkle proof length is still only log₂(10M) ≈ 23 hash values.

04 · What should you do?

Why is the Merkle tree so important in both ZK Rollups and Proof of Reserves? In ZK Rollups: ZK Rollup validity proofs are essentially a mathematical statement about the correctness of a batch of transactions' execution. Constructing this statement requires a verifiable transaction set summary — achieved through Merkle trees (specifically Merkle Patricia Tries or similar structures). When an L1 contract verifies a validity proof, it simultaneously verifies that the state root of these transactions is correct — and the state root is the Merkle tree's root hash. In Proof of Reserves: after FTX's collapse, the industry began widely using Merkle trees for exchange reserve transparency proofs — each user's account balance as a leaf node, all users' balance Merkle root publicly disclosed, and any user can request a Merkle inclusion proof to verify their account is included in the exchange's announced total reserves without revealing other users' privacy. Common thread: Merkle trees make it possible to verify partial content without revealing complete data — a bridge between privacy and verifiability.

Real-World Example +

Illustrate Merkle trees' practical significance using Bitcoin's light node (SPV wallet). You use a mobile Bitcoin light node wallet (like some Bitcoin wallet apps). This wallet doesn't download the complete Bitcoin blockchain (over 600 GB) but only downloads all block headers — ~80 bytes each, with total Bitcoin history headers amounting to roughly 60 MB. When you want to confirm whether a specific transaction (e.g., a transfer you received) has been confirmed, your light node wallet requests that transaction's Merkle Proof from a full node. The full node returns roughly 30-40 hash values (even if a Bitcoin block has thousands of transactions, the Merkle proof length is only log₂(thousands) ≈ 12-13 hash values). Your phone locally computes with these hashes, verifying whether the reconstructed root matches the known block header — if it matches, the transaction is genuinely in that block. The entire process uses only a few KB of data and milliseconds of computation, not downloading hundreds of GB of blockchain data. This is the core mechanism by which Merkle trees make it possible to trustworthily verify Bitcoin transactions on resource-constrained devices.

Diagram
Merkle Tree: Transaction Hashing Structure默克爾樹結構圖以樹狀圖形式呈現哈希計算過程:最底層(葉節點)為四筆交易(Transaction A、B、C、D,綠色方塊);第二層為兩個父節點(藍色方塊),分別是 Hash(A) 和 Hash(B) 合并後的 Hash(AB),以及 Hash(C) 和 Hash(D) 合并後的 Hash(CD);頂層(深藍色方塊)為默Merkle Tree: Transaction Hashing StructureRoot HashMerkle Root: AB12...XYHash(AB): 3d8f...2aHash(CD): 9f1b...7eHash(Tx A)Hash(Tx B)Hash(Tx C)Hash(Tx D)Transaction ATransaction BTransaction CTransaction DChange any single transaction → its hash changes → parent hash changes → Root changes. Tamper-evident.Crypto Bible · crypto-bible.com
Feel free to share. Please credit the source.
Common Misconceptions +
✕ Misconception 1
× Misconception 1: Merkle trees make blockchain completely impossible to tamper with. Not entirely. Merkle trees make tampering with transactions in a specific block immediately detectable (because the root hash changes), but they're not the only mechanism making blockchain immutable — they also need Proof of Work or Proof of Stake consensus to make the cost of modifying history extremely high. Specifically: changing a historical Bitcoin transaction requires not just recomputing that block's Merkle Root but also that block's PoW (consuming vast computation), then all subsequent blocks — making tampering costs extreme in both mathematical and practical terms, but not absolutely impossible.
✕ Misconception 2
× Misconception 2: Merkle trees were invented for blockchain. Wrong. Ralph Merkle developed Merkle trees in 1979, nearly 30 years before Satoshi Nakamoto's Bitcoin whitepaper (2008). Merkle trees are a general-purpose cryptographic data structure widely used in digital signatures, certificate revocation (like X.509 certificates), version control systems (like Git's commit hashes), and many other areas — blockchain is just one of their many applications.
The Missing Link +
Direct Impact

Merkle tree's core trade-off is between verification efficiency and update overhead. Read efficiency (verifying whether a specific transaction exists) is extremely high — regardless of how much data is in the tree, verification requires only log n hash values. But write/update overhead is non-zero: modifying any leaf node's data requires recomputing all hash values along the path from that node to the root — modifying a depth-k leaf requires recomputing k parent node hashes. This isn't a problem for Bitcoin's static blocks (once confirmed, transactions don't change); but Ethereum's state tree requires frequent updates (every transaction may modify some account's state), leading Ethereum to use the more complex Merkle Patricia Trie (combining Merkle tree and Patricia trie characteristics) for better balance between read efficiency and update overhead.

Ask a Question
Please enter at least 10 characters