What is Merkle Tree

Share:

A Merkle tree is a data structure that combines hashes in a hierarchy. A single value at the top, the Merkle root, acts as a commitment to the data represented by the tree. A proof can show that a particular item belongs to the committed dataset without supplying every item.

Build a four-leaf tree

A     B     C     DH(A)  H(B)  H(C)  H(D)  H(AB)       H(CD)         Root

In this simplified illustration, H(AB) means hashing the concatenated digests of A and B. The root is calculated by hashing the two parent digests. Changing A normally changes the hashes above it and the root.

What an inclusion proof establishes

To check A, a verifier can combine its digest with the sibling digest for B and the other parent digest. The computed root must match a trusted root. This proves inclusion under the tree's assumptions, not that the underlying transaction is legally valid or that all data remains available.

Bitcoin uses a specific Merkle tree construction in block headers. Other networks use different structures. See cryptographic hash and data availability for the related concepts.

Terms in addition to the Merkle Tree