Merkle Root
Merkle Root
A Merkle root is the hash of all the hashes of all the transactions that are
part of a block in a blockchain network.
Since there are numerous transactions stored on a particular block, all the
transaction hashes in the block are also hashed, which results in a Merkle
root.
Effectively, you get an upside-down binary tree, with each node of the tree
connecting to only two nodes below it (hence the name "binary tree"). It
has one root hash at the top, which connects to two hashes at level one,
each of which again connects to the two hashes at level three (leaf-level),
and the structure continues depending upon the number of transaction
hashes.
The hashing starts at the lowest level (leaf-level) nodes, and all four
hashes are included in the hash of nodes that are linked to it at level one.
Similarly, hashing continues at level one, which leads to hashes of hashes
reaching to higher levels, until it reaches the single top root hash.
This root hash is called the Merkle root, and due to the tree-like linkage of
hashes, it contains all the information about every single transaction hash
that exists on the block. It offers a single-point hash value that enables
validating everything present on that block.
For example, if one has to verify a transaction that claims to have come
from block #137, they only needs to check the block's Merkle tree, without
worrying about verifying anything on any other blocks on the blockchain,
like block #136 or block #138.
Enter the Merkle root, which further speeds up verification. Since it carries
all the information about the entire tree, one only needs to verify that
transaction hash, its sibling-node (if it exists), and then proceed upward
until it reaches the top.