A Bitcoin block may contain thousands of transactions, but its header is only 80 bytes. The Merkle tree makes it possible to use this tiny amount of data to “lock in” every transaction in the block.
Each $BTC block header contains a Merkle root corresponding to all the transactions in that block. Currently 77,038.01 (24h -1.35%).
▍What kind of tree
A Merkle tree is a tree-like structure that hashes large amounts of data in pairs and combines the results layer by layer. The bottom layer consists of the hash of each transaction. Each pair of adjacent hashes is concatenated and hashed again to produce the next layer. This process continues until only one hash remains, called the Merkle root.
This structure is named after cryptographer Ralph Merkle. It was proposed in the late 1970s, long before blockchain.
▍Why tampering doesn’t work
Bitcoin’s block header contains the Merkle root. If any transaction in a block is changed, its hash changes. That change propagates up to the Merkle root, and the block hash changes too, so all subsequent blocks no longer match.
So by keeping an eye on just this one hash in the block header, you’re effectively keeping an eye on every transaction in the block.
▍How lightweight wallets verify transactions
To prove that a transaction is in a particular block, you don’t need the entire block—just a few hashes along the path from that transaction to the Merkle root. If the number of transactions doubles, you only need one more hash. For a block with thousands of transactions, a dozen or so hashes are enough.
This is how Simplified Payment Verification (SPV), described in Section 8 of the Bitcoin white paper, works: lightweight clients store only block headers, then ask a node for a Merkle path to confirm that a transaction has been included in a block.
▍Applications in proof of reserves
Exchanges also use Merkle trees for proof of reserves: the platform puts all users’ balances into a Merkle tree and publishes the root hash. Each user gets their own path and can verify for themselves that their balance has been included, without anyone else’s details being made public.
▍To wrap up
The idea behind a Merkle tree is simple: use one short root hash to represent a large amount of data. This design is what makes applications like mobile wallets and proof of reserves possible. When you hear claims of high returns, be skeptical.
Have you also misunderstood this point before?