Merkle tree is defined as a way data is organized so that if it were visualized, it would look similar to a tree. Merkle trees are used for efficiently summarizing, verifying, and securing large amounts of data. The process of making a merkle tree involves a mathematical process known as “hashing”.
In 1979 Ralph Merkle, a computer scientist, created a patent for Merkle trees. A Merkle tree uses a math process known as “hashing” to take information and turns it into letters and numbers of a certain length.
For example, “I like bitcoin” can be hashed and will equal: ad3e58f21b94f32dcadca6b71df4c31a18179f38011551a17a80d0ff065d22c5
If I were to capitalize the “b” in bitcoin, so it says, “I like Bitcoin” the hash will be completely different: d988ca30eaa88c0410ad6e48a5297c0d505dcee572f9884f1a6fa2cbc8dedc86
Hashes cannot be reversed to get the original text. But you can verify the above hashes are correct simply by going to this website and typing in the same text as above: https://www.movable-type.co.uk/scripts/sha256.html
A Merkle tree works like this:
- Two units of information are individually hashed. These are known as Merkle leaves.
- Those two hashes are then hashed together. These are known as Merkle branches.
- Multiple branches are hashed together finally getting one single hash. This is known as a Merkle root.
A Merkle tree is useful because it allows computers to verify information at the bottom of the tree, the leaves, without having to store the entire set of information.