Bitcoin Forum
May 09, 2024, 01:58:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Merkle tree of transaction exists in raw data file or just in memory?  (Read 116 times)
maplelake (OP)
Jr. Member
*
Offline Offline

Activity: 47
Merit: 8


View Profile
December 18, 2019, 12:39:16 PM
 #1

Each block contains many transactions. In raw data, these transactions are organized like a tree or just flat array of transactions ?

As my understanding, the transactions are stored like array in raw data, and bitcoin cline will build a Merkle tree for these transactions in memory. These Merkle tree , actually a group a hash value, are not written into file. Just in memory. When the bitcoin client quit, the Merkle tree is released. They are not saved in raw data.
1715263101
Hero Member
*
Offline Offline

Posts: 1715263101

View Profile Personal Message (Offline)

Ignore
1715263101
Reply with quote  #2

1715263101
Report to moderator
1715263101
Hero Member
*
Offline Offline

Posts: 1715263101

View Profile Personal Message (Offline)

Ignore
1715263101
Reply with quote  #2

1715263101
Report to moderator
1715263101
Hero Member
*
Offline Offline

Posts: 1715263101

View Profile Personal Message (Offline)

Ignore
1715263101
Reply with quote  #2

1715263101
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715263101
Hero Member
*
Offline Offline

Posts: 1715263101

View Profile Personal Message (Offline)

Ignore
1715263101
Reply with quote  #2

1715263101
Report to moderator
1715263101
Hero Member
*
Offline Offline

Posts: 1715263101

View Profile Personal Message (Offline)

Ignore
1715263101
Reply with quote  #2

1715263101
Report to moderator
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
December 18, 2019, 01:07:21 PM
Merited by joniboini (2), ABCbits (1), darosior (1)
 #2

Each block contains many transactions. In raw data, these transactions are organized like a tree or just flat array of transactions ?
in an array. each transaction comes after the other like a chain.

Quote
As my understanding, the transactions are stored like array in raw data, and bitcoin cline will build a Merkle tree for these transactions in memory. These Merkle tree , actually a group a hash value, are not written into file. Just in memory. When the bitcoin client quit, the Merkle tree is released. They are not saved in raw data.
when a node first receives the block it has to first build each branch of the merkle tree to get to the root and then see if the hash of it is the same hash that was included in the block header (that is the only hash that is stored). then it is discarded after verification (no need to quit).

There is a FOMO brewing...
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!