Bitcoin Forum
November 18, 2024, 08:39:04 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Does the transaction order WITHIN blocks matter?  (Read 985 times)
konstantin718 (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
December 17, 2013, 04:01:18 AM
Last edit: December 17, 2013, 04:11:44 AM by konstantin718
 #1

Hi folks,

I've been reading up on the bitcoin protocol non-stop and have a couple of questions that I haven't been able to answer:

  • When a node assembles a new block to mine, how does it determine which transactions from the list of unconfirmed transactions to include in that block that it will mine?
  • When a node assembles a new block to mine, does the order of the transactions that it picks to be in the new block matter?  My guess is that it should but I couldn't find any literature confirming or denying that.  Can anyone explain?

Thank you!
Konstantin

kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
December 17, 2013, 04:22:51 AM
 #2

1.  The node uses whatever criteria it wishes to use when building the block.  The reference client prefers fees first, but tends to also include a few free transactions of high priority.  Also, (approximately) no one uses the reference client to build blocks for mining.

2.  Depends what you mean.  Different orderings will give different merkle tree hashes, so the header calculated for a given ordering is only valid for that one ordering.  But as long as the block matches the header, all valid* orderings are acceptable to the network.

* There are validity rules specific to order:  The generation transaction must be first, and the first transaction must be generation.  If transaction B spends transaction A and both are in the same block, A must come before B.  Why are these in a footnote?  I consider the generation transaction to not be in the permutable set, and UTXO->A->B in a single block is rare and unusual.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
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!