What is Merkle tree?

Source: Internet
Author: User

This was found when I recently studied a paper. I did not know what it was, so I checked some information.

What is Merkle tree?

Merkle tree is a tree, most of which is called Merkle hash tree on the Internet. This is because all the Merkle tree nodes it constructs are hash values.

Merkle tree has the following features:

1. It is a tree. It can be a binary tree or a multi-Cross Tree. No matter how many cross trees are, it has all the features of the tree structure;

2. You specify the value of the Merkle tree leaf node. This mainly depends on your design. For example, Merkle hash tree uses the hash value of data as the value of the leaf node;

3. The value of a non-leaf node is obtained based on the values of all the leaf nodes under it and calculated according to certain algorithms. For example, the non-leaf node value calculation method of Merkle hash tree

Is to combine all the child nodes of the node, and then calculate the hash value of the combined result.

For example, if it is a Merkle hash tree, the hash value of node 7 must be calculated by the values of nodes 15 and 16.

Why use Merkle hash tree?

Currently, in the computer field, most Merkle trees are used for comparison and verification. In application scenarios that process comparison or verification, especially in distributed environments,

Merkle tree greatly reduces the data transmission volume and computing complexity. For example, let's take Figure 1 as an example. For example, if the value of 15, 16,... and 30 is the hash value of each data block, I pass the data from

After the data is transmitted to B, I want to verify the validity of the data (whether the data received in B is exactly the same as the data in a), just verify, root of the Merkle tree constructed on B

If the values of the nodes are consistent, the data is valid and remains unchanged during transmission. It is easy to add the corresponding value of 15 during transmission to be tampered.

Locate the node by using the Merkle tree because the values of nodes, and 15 have all changed, and the time complexity of the positioning is O (log (n )).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.