A Merkle tree is a way to organize data that helps computers quickly check and secure large amounts of information. It arranges data in a tree shape, using small pieces called hashes that connect to larger groups of data above them.
At the bottom of a Merkle tree are hashes that each stand for a single piece of data, called leaf nodes. The next layer combines two leaf hashes into a new hash, and this process repeats, pairing and hashing, until only one hash remains at the top. This final hash is called the Merkle root and represents all the data in the tree.
Merkle trees are named after Ralph Merkle, the researcher who first described them in the late 20th century. They are also called “hash trees” because the structure is built by hashing pairs of nodes.
When new data is added, such as transactions in a blockchain, each piece is turned into a hash. If any part of the data changes, its hash will also change completely. Computers then pair these hashes, combine them, and create new hashes. This repeats until the final top hash is made. This setup means that even a small change in the data will change the top hash, making it easy to spot any changes.
Merkle trees are common in blockchains. In these networks, each block has many transactions. Rather than storing every transaction in the block header, only the Merkle root is included. This lets nodes prove a transaction is in a block by checking just a few hashes, not all of them. As a result, verification is faster and uses fewer resources.
This structure saves both time and space. Since the tree uses hashes instead of full data sets, systems do not have to process or share all the details to prove something is correct. This is especially important in networks where many computers must agree on the same information.