Bitcoin Forum
November 11, 2024, 12:28:12 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about transactions and blocks  (Read 669 times)
joecascio (OP)
Full Member
***
Offline Offline

Activity: 137
Merit: 100

Semi-retired software developer, tech consultant


View Profile WWW
September 27, 2012, 07:25:58 PM
 #1

Transactions are incorporated into blocks, right? That means every transaction that is incorporated into a block will change the block's hash. So let's say a server has just an average speed processor which might take a week or more to generate a block. Does it stop incorporating transactions when it's begun a search for a conforming hash, or does it just keep throwing them in there and changing the nonce as well? Seems like it has to be the latter.

Can someone clear this up for me? Thanks!!

Joe Cascio
Python/Django & Android developer
Twitter: @joecascio
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
September 27, 2012, 08:00:10 PM
Last edit: September 27, 2012, 08:15:34 PM by jgarzik
 #2

Transactions are incorporated into blocks, right?

Yes.

Each transaction's hash is incorporated into a hash tree, whose root is stored in the block header.  Every new transaction changes that merkle root.

Quote
That means every transaction that is incorporated into a block will change the block's hash. So let's say a server has just an average speed processor which might take a week or more to generate a block. Does it stop incorporating transactions when it's begun a search for a conforming hash, or does it just keep throwing them in there and changing the nonce as well? Seems like it has to be the latter.

Remember that you don't "lose" any progress, or work, by hashing a different block header, with an updated merkle root.

The probability of finding a hash is the same either way.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
joecascio (OP)
Full Member
***
Offline Offline

Activity: 137
Merit: 100

Semi-retired software developer, tech consultant


View Profile WWW
September 27, 2012, 08:12:58 PM
 #3

Transactions are incorporated into blocks, right?

Yes.

Each transaction's hash is incorporate into a hash tree, whose root is stored in the block header.  Every new transaction changes that merkle root.

Quote
That means every transaction that is incorporated into a block will change the block's hash. So let's say a server has just an average speed processor which might take a week or more to generate a block. Does it stop incorporating transactions when it's begun a search for a conforming hash, or does it just keep throwing them in there and changing the nonce as well? Seems like it has to be the latter.

Remember that you don't "lose" any progress, or work, by hashing a different block header, with an updated merkle root.

The probability of finding a hash is the same either way.



Yes, same probability is what I figured, but thanks for verifying that.


Joe Cascio
Python/Django & Android developer
Twitter: @joecascio
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!