Merkle Tree

A hash-based tree structure that lets blockchains verify data integrity efficiently by summarizing many transactions into one root hash.

A Merkle tree, also called a hash tree, is a cryptographic data structure that summarizes a large set of data into a single fingerprint known as the Merkle root. It is built by hashing individual data items at the “leaves,” then repeatedly hashing pairs of hashes until only one hash remains at the top. Any change to any underlying data item produces a different Merkle root, making tampering easy to detect.

How a Merkle tree works

In a blockchain context, the leaf nodes commonly represent transaction hashes. These hashes are combined two at a time, and each pair is hashed again to form a parent node. This process repeats level by level until the final top hash, the Merkle root. Because cryptographic hashes are collision-resistant in practice, it is extremely difficult to alter a transaction without changing its leaf hash, which then changes every parent hash all the way up to the root.
This structure also enables compact proofs. Instead of downloading every transaction in a block, a user can verify that a specific transaction is included by checking a Merkle proof, which is the minimal set of sibling hashes needed to recompute the Merkle root. If the computed root matches the root recorded in the block header, the transaction’s inclusion is verified.

Why blockchains use Merkle trees

Merkle trees are a core building block in systems like Bitcoin, where each block header commits to all transactions in the block via the Merkle root. This helps lightweight clients, sometimes called SPV clients, validate inclusion without storing full block data. Similar ideas appear beyond payments, including audit logs, distributed storage, and other protocols that need efficient integrity checks.

Why it matters

Merkle trees improve scalability and trust by making data verification fast, bandwidth-efficient, and tamper-evident, which is essential for decentralized networks where not every participant can store everything.