2

I don't know how getblocktemplate works exactly, but it seems to include transactions based on priority.

Selecting transactions based on priority isn't the most profitable method for building a block (as opposed to fee/byte), so is getblocktemplate only going to be used by miners who haven't figured out how to construct their own blocks?

Why would anyone use getblocktemplate otherwise?

3

Getblocktemplate builds a block based on configuration parameters. In recent versions, the default is to use fee per byte as criterion for the entire block.

History

In versions of Bitcoin up to 0.6, priority based selection was used for the entire block. It was a means to encourage the young Bitcoin economy to grow. However, it also had a minimum transaction fee that increased as the space in blocks grew closer to the limit.

In version 0.7 the -blockprioritysize setting was introduced, which divided blocks in a priority area and a fee area. The priority area was there to support a small number of low-fee transactions to continue, and was limited to 27 kB by default (50 kB since version 0.9). The fee area is sorted by fee per byte, and maximizes total fees for miners.

Recent versions

In Bitcoin Core 0.12 the default setting for the priority size was reduced to 0. It also introduced a more efficient algorithm for selecting transactions, which works suboptimally for the priority area.

In the upcoming Bitcoin Core 0.13 release the algorithm selection algorithm will be improved again and use Child-pays-for-parent (CPFP) logic. This logic uses fees from unconfirmed descendant transactions to determine whether to include parents. It increases the total fees that can be taken compared to the previous algorithm, and allows wallets to increase fees on a transaction by spending its change outputs with higher fee.

  • Thank you, Peter. Whilst I have you, does getblocktemplate return the list of transactions in any particular order? – inersha Jun 26 '16 at 17:28
  • Yes, in the order they were selected for inclusion. This means the highest priority/fee_per_byte first. – Pieter Wuille Jun 26 '16 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.