In my article ‘Blockchain in a Nutshell’, I have mentioned Merkle tree as one of the metadata in a block of the blockchain. What actually is the Merkle tree?
In computer science, the Merkle tree is a branching data structure that is used to store hashes of individual data in a large
In blockchain, the Merkle tree(also known as the hash tree) encodes the blockchain data in an efficient and secure manner. Every transaction occurring on the blockchain network is subjected to a hashing algorithm to produce a hash, as shown in the figure below. Therefore, every transaction has a hash associated with it.
As there are thousands of transactions stored on a particular block, it will be very time consuming if every node has to deal with hundreds of thousands of transaction across the blockchain, synchronization
These hashes are not stored in a sequential order on the block, rather in the form of a tree-like structure such that each hash is linked to its parent following a parent-child tree-like relation. The hashing will go on until it produces a singular hash, the Merkle root. This Merkle root is the hash of the block and it is stored on the header of the block. The process is illustrated in the following diagram:
The Merkle Tree structure will enable the quick verification of blockchain data and quick movement of large amounts of data from one computer node to the other on the peer-to-peer blockchain network.