Merkle Trees

So what is a Merkle Root, and what do we mean by a summary of transactions? Does this mean that we have contained all information about our transactions in one piece of information? Well, it actually means that we have contained all fingerprints of information in one piece of data . The Merkle Root is the top of a Merkle Tree, which is a cryptographic data structure.

This is definitely complicated, so let’s take it slow and start from the very beginning.

First and foremost, a tree in Computer science is a data structure that has some root node and some children, which may also be the roots of other trees.

A binary tree is a tree in which every node has at most two children.

A Merkle Tree is just a very specific version of a binary tree, where two things are true: there are a power of two children on the bottommost level, and the lowest level is made of the hashes of the information that you would like to summarize.

Perhaps a better way to explain the Merkle Tree is to describe its construction.

We start off with a set of transactions that we have verified.

We lay them out one by one.

We hash each one to get a level of hashes.

We then hash each pair together, making a new level with half as many hashes.

We continue this process until we finally have only one hash at the top.

This hash at the very top is the Merkle Root.

This way, we can detect any transaction changes after the commitment with the Merkle Root.

Merkle Trees: Tamper Detection