Merkle Trees: The Data Structure Behind Blockchain Verification

Every block in Ethereum Classic contains three Merkle tree roots: one for transactions, one for receipts, and one for the world state. These trees are the foundation of trustless verification.

## What Is a Merkle Tree?

A Merkle tree (or hash tree) is a data structure where every leaf node contains the hash of a data block, and every non-leaf node contains the hash of its children. The topmost hash is called the root.

## How It Works

1. **Leaf nodes**: Each transaction in a block is hashed individually
2. **Pairing**: Adjacent hashes are concatenated and hashed together
3. **Recursion**: This continues up the tree until a single hash remains — the Merkle root
4. **Inclusion proof**: To prove a transaction is in a block, you only need the transaction, the sibling hashes along the path to the root, and the root itself

## Three Trees in Every Block

### Transaction Trie
Contains all transactions in the block. The transaction root in the block header commits to every transaction.

### Receipt Trie
Contains the execution results (logs, gas used, status) for each transaction. The receipt root commits to every execution outcome.

### State Trie (Modified Merkle Patricia Trie)
The most complex of the three. It maps every account address to its state (balance, nonce, storage root, code hash). ETC uses a Modified Merkle Patricia Trie — a combination of a Patricia trie (for key-based lookup) and a Merkle tree (for cryptographic verification).

## Why Merkle Trees Matter

### Efficient Verification
A light client can verify that a transaction was included in a block using only ~log₂(n) hashes instead of downloading the entire block. For a block with 1,000 transactions, only ~10 hashes are needed.

### Tamper Detection
Changing any single transaction would change its leaf hash, which would cascade up the tree and change the root. Since the root is in the block header (which is part of the chain), any modification is immediately detectable.

### State Proofs
The state trie root allows anyone to prove the balance or storage of any account at any block height, without trusting the data provider.

## In Practice

When your wallet shows your ETC balance, it's ultimately verified against the state trie root in the latest block header. The entire security model of light clients and block explorers depends on these Merkle tree structures.