What is a Merkle Tree?
A Merkle Tree is a data structure used in computer science applications. In bitcoin and other cryptocurrencies, Merkle trees serve to encrypt blockchain data more efficiently and securely. They are also called binary hash tree( binary hash trees ).
How does a Merkle Tree work?
In the bitcoin blockchain, a block of transactions is run through an algorithm to generate a hash, which is a string of numbers and letters that can be used to verify that a given set of data is the same as the original set of transactions. beginning, but not to get the original set of transactions. Bitcoin’s software does not run an entire block of transaction data — the equivalent of 10 minutes of transaction on average — through the hash function. Instead, each transaction is hashed, then each pair of transactions is concatenated and hashed together, and so on until there is a hash for the entire block. (If there is an odd number of transactions, a transaction is duplicated and its hash concatenated with itself.)
Visualize, this structure resembles a tree. In the diagram below, “T” designates a transaction, “H” a hash. Note that the image is highly simplified; an average block contains more than 500 transactions, not eight.
The hashes in the bottom row are called the “leaves”, the intermediate hashes are the “branches” and the hash at the top are the “roots”. The Merkle root of a given block is stored in the header:
Example: Merkle root of block # 482819 to be
The root is combined with other information (software version, hash of the previous block, timestamp, target difficulty, and nonce) and then run through the hash to produce a unique hash of the block:
This hash is not actually included in the relevant block, but as the next block it is different from the Merkle root.
The Merkle tree is useful because it allows users to verify a specific transaction without downloading the entire blockchain (more than 130 gigabytes at the end of August 2017). For example, let’s say you want to verify that the transaction TD is included in the block in the diagram above. If you have the original hash (THEABCDEFGH), the process is like a game of sudoku: you query the net for HD and it returns THEMOLD, HAB and THEYEFGH. Merkle trees allow you to verify that everything is calculated using three hashes: HAB, HOLD, HEFGH and THEYABCDEFGH, HEASY root (unique hash is missing) must be in the data.
Ethereum uses three different Merkle roots in each block:
- The first root is of the transactions in the block
- The second root represents the state
- Third Root for Transaction Receipts
Ethereum uses a special type of hash tree called the ‘Merkle Patricia Tree’.
The Merkle Tree is a powerful and indispensable tool for miners and users on the blockchain. They are extremely powerful and are at the heart of several peer-to-peer networks such as BitTorrent, Git, Bitcoin, and Ethereum.
Merkle trees are named after Ralph Merkle, who proposed them in a 1987 paper titled “Digital Signatures Based on Conventional Encryption Functions”. Merkle is also the inventor of cryptographic hashing.
According to TapchiBitcoin
Follow the Twitter page | Subscribe to Telegram channel | Follow the Facebook page