Skip to content
Kriptofoni
Crypto GlossaryBlockchain & Technology

What Is Merkle Tree?

Also known as: Hash Tree, Merkle Hash Tree

In short

A Merkle tree is a data structure that combines the hashes of many pieces of data pairwise into a single summary value (the Merkle root), making it possible to efficiently verify that a piece of data belongs to the set.

In the structure, named after computer scientist Ralph Merkle, the hash of each piece of data, for example each transaction in a block, is computed first; these form the leaves of the tree. Then neighboring hashes are combined in pairs and hashed again, and this continues until a single hash remains at the top. This final value is called the Merkle root. On Bitcoin, each block's header contains the Merkle root representing all the transactions in that block.

The structure's strength comes from the fact that the smallest change in the data completely changes the root; this way, the root value acts as a short fingerprint for the integrity of the data. To prove that a transaction is included in a block, there is no need to download all the transactions; a few hashes on the relevant branch are enough. Light clients (SPV) take advantage of this feature by keeping only block headers and can verify individual transactions.

Merkle trees are also used outside blockchains, in version control systems such as Git and in distributed file systems. Ethereum uses an improved variant called the Merkle Patricia Trie to store account states; alternative structures such as Verkle trees are being researched to reduce proof sizes. Merkle trees are also used in exchanges' proof of reserves publications.

Last updated: · This content is for information purposes only and is not investment advice.

Related terms