Home
Glossary
Merkle Tree

Merkle Tree

Intermediate
A Merkle tree is a way of organizing and structuring large amounts of data to make it more straightforward to process. In the case of cryptocurrency and blockchain, the Merkle tree is used to structure transaction data in a way that is less demanding on resources.
When a cryptocurrency transaction is made in a Merkle tree structure, it is hashed and then given an equivalent hash value. After each transaction is hashed in the Merkle tree, the hash values that are produced are paired with another hash value and then hashed again. For example, the hash values ‘AB’ and ‘AC’ are combined to create ‘ABC’.
This process of pairing hash values is repeated until a final hash value is produced. The final hash value, the Merkle root, provides a summary of all the transactions it contains. The Merkle root summary is then inserted into the block header.


Data security

A Merkle tree structure provides an easy-to-access record of the transactions in a block. So, its very simple to check whether the data in a block have been changed or tampered with. This is true because any change to a transaction (or any other related data) in the Merkle tree would lead to an entirely different corresponding Merkle root.


Efficient use of resources

If cryptocurrencies didn't use Merkle trees, every verification request would involve enormous amounts of information being sent across the network. Structuring transaction data in a Merkle tree is a far more efficient use of resources. Validating a transaction does not require a complete copy of the ledger as the hashed transaction data can be verified in a Merkle root, requiring much less information being sent across the nodes and, thus, less computing power to analyze the overall data integrity.

Merkle trees are used in Proof of Reserve verifications. In a Proof of Reserve verification, auditors ensure that custodians, like crypto exchanges, are holding their clients’ funds in full. The auditor takes a snapshot of all account balances on an exchange and then converts the fund data to a Merkle tree.

There are other ways a Merkle tree is used. A Merkle tree structure also enables users to verify that an individual transaction has been included in a block without having to go through the process of downloading the entire blockchain. The technology is an important tool for cryptocurrencies to organize transaction data and function as efficiently as they do. Without Merkle trees, it's likely that the greater demand for resources would result in fewer nodes participating in the network.