Merkle trees

Everyone knows the blockchain, but not the Merkle tree

Recently, when I studied the paper of Satoshi Nakamoto, he mentioned Merkle tree, which made me very curious. I plan to study it. Who knows that almost all kinds of articles on the Internet are defined as:

Merkle trees are a fundamental part of blockchain.

Well, it’s not wrong to say this, but there is a Merkle tree first, and then there is a blockchain. Did the person who defined it at that time have the function of prediction, knowing that this structure will definitely be applied to the blockchain.

So I think that when the Merkle tree structure came out, it should have nothing to do with the blockchain.

Merkle tree, originally called hash tree, was patented by Ralph Merkle in 1979, so the name was changed to Merkle trees from that time. Seeing this, I just want to say, I X, the original software data structure can still apply for a patent. I don't know the meaning of the patent. Can others not use it, or do I need to pay him royalties?

Well, let’s get down to business. Let’s talk about this data structure. First of all, it is a tree-like data structure, which can be binary or multi-forked, but binary is widely used. All leaf nodes of the tree store the hash value of the data block, and all non-leaf nodes store the hash value of all its own child nodes, and then hash all the way up.



These are Merkle trees. It is actually a derivative of hash list and hash linked list.

use

Merkle tree can be very efficient to verify the storage, processing and transmission of any data between computers. Especially in a peer-to-peer network, you can confirm that the data you receive has not been corrupted or tampered with, and you can also verify that other nodes do not maliciously send you false data (is it starting to get a little closer to the advantages of the blockchain?).

At the top of the Merkle tree, this is a top hash (or root hash, main hash). In a peer-to-peer network, you can usually obtain the top hash from a friend or a trusted third party (certificate authority) before downloading the file. Once you have the top hash, you can simply come here and download the entire Merkle tree from any untrusted node, such as any other node in a peer-to-peer network. This is because you only need to check whether the hash value of the root node of the downloaded tree is the same as the one you obtained before. If it is inconsistent, give up and find another node to download until you find the same hash value as yours.


Reference :

  • Java implementation of Merkle tree: https://github.com/richpl/merkletree
  • Ralph_Merkle https://en.wikipedia.org/wiki/Ralph_Merkle


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324779304&siteId=291194637