0

Here's my idea from the quick research:

  1. Miners use getblocktemplate RPC method.

  2. In the obtained block template, they remove some transaction and instead place in other transaction that wouldn't normally get there (e.g. 0 fee transaction for a friend).

  3. They use generateblock RPC method and provide the updated block template.

Questions:

  1. Does it work something like this?

  2. I imagine the node software is constantly updating the block to maximize the amount of fees received. Does it mean it overrides the transaction I added manually?

  3. Is there some UI that allows you to do this? E.g. displays the current block template + transactions in mempool and allows you to replace transaction in a block template with transaction from the mempool? If not, I might attempt to build something in that fashion.

1 Answer 1

3
  1. Does it work something like this?

No, not really.

generateblock is a testing only RPC that actually mines a block using the internal CPU miner, itt does not make a block template. So it's completely irrelevant to this.

There are basically two ways of inserting a transaction:

  1. The miner would put the transaction in their own mempool (and possibly end up broadcasting it) by using sendrawtransaction. Then they would use prioritisetransaction to artificially set the transaction's fee so that it will appear in a block template generated by getblocktemplate.
  2. They are using some external block template generator that will do the insertion itself. This software may begin with a block template created by getblocktemplate, but it will have to also implement a lot of the block assembly code itself to verify that the template it ends up producing is valid.
  1. I imagine the node software is constantly updating the block to maximize the amount of fees received. Does it mean it overrides the transaction I added manually?

If they used method 1, no there would not be any overriding of the manual transaction since bitcoind remembers the modified fee and will continue to account for it until that transaction is confirmed.

For method 2, the external template software is doing the insertion so it will remember. That external software may even be (re)building the template anyways, so it's basically what bitcoind is doing in method 1.

  1. Is there some UI that allows you to do this? E.g. displays the current block template + transactions in mempool and allows you to replace transaction in a block template with transaction from the mempool? If not, I might attempt to build something in that fashion.

I don't think there are any such software that is publicly available. These days, block templates are produced by pools, and these pools often use custom software, so they may have tooling that does this. But it would not be available to the public.

1
  • Much clearer now, thank you for the explanation!
    – pycan
    Apr 20 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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