How a merkle tree is generated?

+1 vote

I have heard that SPV nodes doesn't need the copy of entire blockchain for verification. It is said that Merkle trees are used by such nodes. I have a doubt that how Merkle tree path is generated and how does it help in validating transaction??

Apr 5, 2018 in Blockchain by Christine
• 15,790 points

edited Apr 5, 2018 by Christine 75 views

2 answers to this question.

+1 vote

In a Merkle tree, transaction IDs (txid) are checked to place the incoming transaction at the right location at the bottom of the Merkle tree, and the Merkle path is returned to the SPV for checking the content.

It's easier for the servers to return the Merkle path than to check very transaction to reduce the work-load. Hence, the whole process works out.

The transactions at the bottom are sorted by txid, and the hashed values are calculated for the entire transaction block.

answered Apr 5, 2018 by Shashank
• 10,330 points
0 votes
Merkle trees are generated like this: The hash of leaf node pair is created and the parent hash is generated. Then these parent pair are hashed to generate their parent hash and this continues until there's only on parent left(the root node).
answered Aug 8, 2018 by Krishna

Related Questions In Blockchain

+4 votes
5 answers

How is Blockchain a distributed database?

Think of blockchain as a relatively slow, ...READ MORE

answered Mar 26, 2018 in Blockchain by Christine
• 15,790 points
146 views
+1 vote
1 answer

How does a miner get to know that a transaction is verified by all the nodes?

Contrary to the popular belief, it is ...READ MORE

answered Mar 26, 2018 in Blockchain by Johnathon
• 9,070 points
54 views
+1 vote
1 answer

How is a smart contract stored on a Blockchain?

Smart contract template and transaction events are ...READ MORE

answered Apr 4, 2018 in Blockchain by Christine
• 15,790 points
119 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
103 views
0 votes
1 answer
0 votes
1 answer

How can we decrypt a transaction payload when confidentiality is on?

You can try the following: you can only ...READ MORE

answered May 2, 2018 in Blockchain by Shashank
• 10,330 points
55 views
+1 vote
1 answer

How is Blockchain used for provenance purposes?

Let me tell you how Blockchain could ...READ MORE

answered Apr 3, 2018 in Blockchain by Shashank
• 10,330 points
26 views