Block chain basic Knowledge series The Merkel in the block chain of the third lesson

Source: Internet
Author: User

" block chain is a kind of technology to realize distributed General Ledger without center." In addition to the typical block chain with blocks and chains, there are other ways to achieve the requirement of distributed General Ledger. the basic unit of General ledger technology is ' trading ', the whole ledger is made up of a section of the transaction. ' block ' is similar to the page in the ledger, each page records a number of transactions, a page of the Account page in chronological order, the formation of a complete ledger-' Block chain '. ' Block ' is the container of the transaction, ' block ' is connected by the cryptography algorithm, forming a ' chain ' of time series. The advantage of this kind of organization Ledger is that the cryptography algorithm guarantees the inability to tamper with the individual transactions on the chain, unless the integrity of the tamper . ”

According to the description, we can see that"block" is the container of the transaction . Each transaction is placed inside the container, and the entire container is connected with a cryptographic algorithm to form a complete chain.

The best way to organize this data is that it's easy to keep the data intact and more secure from a cryptography perspective . However, the benefits are at a cost--the data keeps growing.

For bitcoin system, this problem is not big, because so far, Bitcoin is still a block every 10 minutes, each block 1MB, even after 100 years, the total amount of data will not be large to stand-alone processing. But for some enterprise-class application of the block chain system, the situation is completely different. Each chunk can be very large and the blocks can be generated very quickly. In this case, the amount of data in the chunk chain is growing fast. How to solve the problem of too much data volume.

In our traditional data system, there are also problems of increasing data and large amount of data. Take the traditional transaction type system as an example, because the core design idea of the system is to save the final state of the account, only need to move the historical transaction process data to other specialized storage devices, the host database keeps the latest status of the account and the transaction record of the most recent time. (therefore, when we look up historical transactions in the net bank, there is usually a time limit.) )

But in the block chain system, especially in the block chain system which uses the Utxo way to store the transaction, the transaction process is preserved. If an account has not been traded, it will not appear in the latest block.

Then the way to delete historical data in traditional databases as long as there is a transaction in one block that has not been followed up (that is, no one is using the output account of the transaction), in order to maintain the cryptographic integrity and security of the entire block chain system, the block must be preserved, and all the blocks after this block must also be retained.

How to solve this problem. In fact, there are many ways to solve, at first, in the Ben Cong design bitcoin system, has reserved an optimal solution: Merkel (Merkle tree) algorithm.

In the Bitcoin block chain system, the structure of the block is shown in the following illustration:

The HASH1 in each block is the hash value of all transactions in this block. But this hash value does not connect all the transactions into a long string and compute the hash value, but instead uses the Merkel (Merkle tree) algorithm to compute the hash value, which we call Merkle root.

The Merkel tree algorithm does not directly compute the hash value of the entire string, but each transaction calculates a hash value, and then the 22 connection computes the hash again, until the Merkle root at the topmost level.

The biggest advantage of the Merkel (Merkle tree) algorithm is that each transaction can be deleted separately, leaving only the hash value of the transaction . In this way, the whole block has not changed the security and integrity of his cryptography, but the amount of data can be greatly reduced. (The hash value is 32 bytes and a transaction typically takes more than 400 bytes). If only one transaction in a block has no subsequent transactions, then all other transactions are deleted, and the amount of data in the entire block is greatly reduced.

Therefore, in the Utxo accounting model, using the Merkel tree structure, there is usually no need to worry about the data volume has been growing to cause the problem of too big.

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.