Glossary termData structure

Merkle Tree

Also known as: Hash tree

Tree data structure in which each non-leaf node holds a hash of its children, enabling efficient and secure verification of large data sets.

A Merkle tree summarizes a large collection of data with a single value. Each piece of data is hashed to form a leaf, pairs of hashes are combined and hashed again, and the process repeats until one hash remains at the top, called the Merkle root. Because every level depends on the one below, changing any piece of data changes the root. Proving that a particular item is included requires only the hashes along its path to the root, a number that grows with the logarithm of the data size.

The structure is named after Ralph Merkle, who described hash trees in 1979 in work on digital signatures. Bitcoin block headers contain the Merkle root of the block's transactions, allowing lightweight clients to check that a transaction is included without downloading the whole block. Git stores history in a related hash-linked structure, Certificate Transparency logs use Merkle trees to make certificate records auditable, and file systems such as ZFS and distributed storage such as IPFS rely on similar designs.

Merkle trees provide tamper evidence and efficient synchronization: two parties can compare roots and then examine only the branches that differ. Their security depends on the underlying cryptographic hash function, and a proof is only meaningful if the verifier trusts the root it is checked against. Hash-based signature schemes built on Merkle trees are part of post-quantum cryptography, since their security rests on hash functions rather than on problems that quantum computers could solve. They are a basic building block of the blockchain.

Key points

  • A Merkle root changes if any piece of underlying data changes.
  • Inclusion proofs need only a small number of hashes, even for huge data sets.
  • Bitcoin, Git, Certificate Transparency and IPFS all use Merkle-style structures.
  • Hash-based signatures built on Merkle trees are candidates for post-quantum security.

Related entries

Glossary term

Cryptographic Hash Function

CybersecurityBlockchain

Function that maps data of any size to a fixed-length digest in a way that is practically impossible to reverse or to match with different input.

Glossary term

Blockchain

Blockchain

Append-only ledger made of blocks of records linked by cryptographic hashes and replicated across a network that agrees on updates by consensus.

Technology

Git

ProgrammingDevOpsFOSS

Free and open-source distributed version control system created by Linus Torvalds in 2005, used to track changes in source code.

Technology

IPFS

BlockchainFOSS

Open peer-to-peer protocol suite for storing and sharing data addressed by its content, using cryptographic hashes rather than locations.

Technology

ZFS

DevOpsHardwareFOSS

Combined file system and volume manager, created at Sun Microsystems, that pools disks and checksums every block to protect data integrity.

Glossary term

Post-Quantum Cryptography

CybersecurityHardware

Cryptographic algorithms designed to remain secure against attacks by large quantum computers, replacing vulnerable public-key methods such as RSA.

Glossary term

Hierarchical data structure of nodes connected by edges, with a single root and no cycles, used for file systems, indexes and parsers.

Featured in guides

Referenced by

Other entries that discuss or point to Merkle Tree.