Blockchain and Cryptocurrency Intermediate - Blockchain CryptoGraphy: The Merkle Trees and Its Importance in Blockchain

in Project HOPElast year

image.png
Source

Merkle tree which is also known as a hash tree is one of the common terms in blockchain technology. It is basically a tree that makes use of cryptographic hash functions for the storage of hash outputs instead of storing the raw data in each of the nodes. There is a cryptographic hash of the original raw data that is contained in each of the leaf node and the parent node is the hash that is as a result of the combined child node hashes. In the merkle tree, the root is simply the top node of the tree, which means that the combination of both the left and right sub-trees is represented by hash output.

The way this works is that, In blockchain technology, the hash is generated from a block of transactions that is run through an special algorithm. The hash is the string of alphanumeric value. Since the blockchain doesn’t run the entire block of transaction through the hash function in a single time, instead, each transaction sent is hashed, followed by each pair of transactions that is then mathematically linked together and hashed together as well. This would continue until there is one single hash for the entire block in the chain.

To visually demonstrate how a markle tree looks like and works, let’s take for instance a block that contains 4 transactions. The bottom row of the markle tree is the leaves with “Tx” is the transactions. The hashes are the branches and the top of the tree is the root. From the illustration, we can see that there are 4 transactions labelled Tx 0, Tx 1, Tx 2, Tx 3. The transactions are then hashed to generate the hash 0, hash 1, hash 2, hash 3. Hash 0 and hash 1 form a pair to generate hash 0 1, and hash 2 and hash 3 form a pair to generate hash 2 3. In the final stage, hash 0 1 and hash 2 3 pair up in the root hash 0 1 2 3.

markle tree.jpg

The Importance of merkle tree

In blockchain technology, the markle tree structure play a very important role. One of the main importance of the markle tree in blockchain is that it allows a user to verify whether a transaction has been added to a block. This is very useful because without the markle tree structure, a user would have to download the entire blockchain just to verify a single transaction. This increases efficiency in the network.

Also, the Merkle tree structure in a blockchain helps to decrease the amount of data that must be present for verification purposes.

Another importance of the markle tree is that it makes it possible to prove both the validity and integrity of data in the blockchain.

Another benefit of the markle tree in blockchain technology is that it increases efficiency since it helps reduce the memory usage.

image.png

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.030
BTC 59590.12
ETH 2551.09
USDT 1.00
SBD 2.54