Author

Topic: What is the purpose of the Merkle Root in a Bitcoin block? (Read 255 times)

newbie
Activity: 23
Merit: 853
The Merklre Tree greatly interferes with this process since its hashes are compressed from roots to the top.  
Even changing one value for a transaction at the base of the tree, change to all the hash values, up to the root's hash value.
Thus a single value prove all the transactions under it and not need to hash the full list of transactions.


source:
https://github.com/bitcoinbook/bitcoinbook/blob/14a25a6fd9e97002c57a46f1fe9faf48cd5d6e46/ch07.asciidoc#merkle-trees

Exactly, my previous words just summarized that. Changing the all set of the hash values in sequence of the  blocks (including attacked one and those that go after him)   so that their roots were consistent with all "leafs"   on Merkle Tree  would be a task that requires enormous computational power to solve. 
member
Activity: 68
Merit: 23
Quote
In case you've missed this info from that link and from this thread as well:
the merkle root is part of the Block header and if you hash the block header, you indirectly hashed all the transactions in that block because the merkle root is the root hash of all the txs in the block.


That's true.  Thanks for that further point.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
Quote
Even if it isn't about SPV nodes, by constructing the merkle root, you're basically telling everyone all the transactions that has been included in the block. Only the block header is hashed, the individual transactions aren't.
My next question is why are the Transactions not included in the Block Header Hash as well.  
Since you're talking about "Block Header Hash", it's about mining, then that quote from the "decent answer" is the answer.

In case you've missed this info from that link and from this thread as well:
the merkle root is part of the Block header and if you hash the block header, you indirectly hashed all the transactions in that block because the merkle root is the root hash of all the txs in the block.
member
Activity: 68
Merit: 23
Quote
Even if it isn't about SPV nodes, by constructing the merkle root, you're basically telling everyone all the transactions that has been included in the block. Only the block header is hashed, the individual transactions aren't.


I see only the Block Header is hashed, so the Merkle Root confirms the data integrity of the Transactions Data.

My next question is why are the Transactions not included in the Block Header Hash as well. 

A decent answer is here https://bitcoin.stackexchange.com/questions/60676/why-is-only-the-block-header-sha256-hashed-and-not-the-whole-block

Quote
it makes the speed of mining independent from the number of transactions.
legendary
Activity: 1596
Merit: 1288
The Merklre Tree greatly interferes with this process since its hashes are compressed from roots to the top.  
Even changing one value for a transaction at the base of the tree, change to all the hash values, up to the root's hash value.
Thus a single value prove all the transactions under it and not need to hash the full list of transactions.


source:
https://github.com/bitcoinbook/bitcoinbook/blob/14a25a6fd9e97002c57a46f1fe9faf48cd5d6e46/ch07.asciidoc#merkle-trees
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
I suggest you to read about "merkle path" in page 167-168 of Andreas M. Antonopoulos's Mastering Bitcoin.
You'll understand how SPV nodes can efficiently verify its transactions using the merkle root which is in the blockheader.

Here's the wiki page with links: https://en.bitcoin.it/wiki/Mastering_Bitcoin
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
SPV wallets do not download the entire block. They only download the block headers.

The block header contains the merkle root among other stuff. By downloading the block headers only, the SPV wallet saves a lot of bandwidth and space. With the block header, the SPV node can verify if the block has sufficient target and can also use the merkle root to verify if a transaction has indeed been included in that specific block.

Even if it isn't about SPV nodes, by constructing the merkle root, you're basically telling everyone all the transactions that has been included in the block. Only the block header is hashed, the individual transactions aren't. Merkle root is the way to include transactions in your block. Read up on how the bitcoin block is constructed to get a more in depth understanding.
member
Activity: 68
Merit: 23
Hello Bitcoin Expert,

I understand how Merkle trees are created and how they are used to quickly verify a transaction in a block but I don’t understand how or why they are used.

A google search presents the following:

Quote
Merkle trees enable SPV nodes on the blockchain to check if miners have verified the transactions in a block without downloading all the transactions in a block.

What I don’t understand is that once a Transaction is in a confirmed Block why does it have to be verified?  Once it is in a confirmed Block the transaction is verified and immutable. 

I watched this video by Andreas https://www.youtube.com/watch?v=OdjEhNdvTNM and he mentions Side Chains but I still don't understand why we need to confirm a transaction has been verified in a confirmed block.

Thank you.
Jump to: