Bitcoin Forum
September 20, 2024, 07:06:33 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Merkle tree and Bitcoin block  (Read 151 times)
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
January 15, 2020, 05:11:47 PM
 #1

Merkle tree has a big adavantage compared to simple hash list: if we have 1000 transactions and must test one transaction, we compute only 10 hashes, not 1000.
But is problem - I analysed Bitcoin block and there is no hashes stored, there are transactions with inputs and outputs, hashes of transactions are computed, I don't see hashes of highest level, only merkleRoot.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3500
Merit: 6833


Just writing some code


View Profile WWW
January 15, 2020, 05:18:34 PM
Merited by fillippone (2), darosior (2), ABCbits (1), nc50lc (1)
 #2

That's because blocks don't contain the hashes. If it did, then you'd lose the transaction data itself which means you can't validate the transactions themselves.

The merkle tree is used for proving to clients that don't have the full block that a given transaction is in that block. A full node can provide such a client the block header and the path of merkle branches to a particular transaction so the client can be sure that that transaction was in the block.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!