简体   繁体   中英

How can merkle trees help validate the content of a block in a blockchain

To my understanding the merkle-tree can be used to separate the actual transactions (or other content) of a block and its validation process, by recursively applying hash functions to the blocks content.

This makes it possible to implement simplified payment validation (or the validation of any other data within a block).

The linked definition states that SVP is a

[...] method for verifying if particular transactions are included in a block without downloading the entire block.

If the merkle tree is a method to check if a specific transaction was part of a block, this implies that we do not "trust the block" and are thus checking if the hash of the searched transaction is part of the tree. If we do not trust the block (or the original validator of the block) how come we trust the merkle tree, which could also be faked (or could it not?).

Are we "just" relying on the fact that has values are pseudo random and that it would be hard to create a fake tree with the same root-value, but one different node value?

Thanks!

Understanding Merkle Tree
Merkle tree allows us to mutliplex a number of transactions in a single block of the ledger. Every leaf node of the tree is representative of a single transaction. Whereas all other nodes are hashes of their children.

默克尔树表示

What is the benefit of this ?
The transaction block will need to store only the root of a Merkle Tree. The purpose that SPV states is that any client who is transacting on the chain can just store the path of hashes from the root to their transaction instead of storing the whole ledger, which can be very large in size.

We do not trust the block ?
Once your transaction is processed, you can verify that it has been added to the ledger by tracing the path from root provided in the block to the leaf node that is your transaction. So you verify to ensure if your transaction was actually processed or not.

Can it be faked ?
No. Once a block is accepted onto the main chain, which is usually the addition of about 5 or 6 more blocks in bitcoin, your transaction is irreversible. The very concept of blockchain is that the ledger is immutable. This means that the root of merkle trees are also permanently stored in the ledger and cannot be modified. Now to keep track of your transaction, you can just store the headers and the path from root to your transactions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM