1

I am coding a miner program with C, and right now I need some info of how create / generate a coinbase transaction to add to the block before submit it to the bitcoin network. Someone can indicate any article / tutorial explaining this (i am searching for this for a while now, and finding nothing useful of this sorts).

Kleber Mota
  • 131
  • 2
  • 9

2 Answers2

1

The coinbase transaction is like every other transaction except it has only 1 special coinbase input which you can read about here: https://bitcoin.org/en/developer-reference#coinbase. The outputs must have a value which sum to the block subsidy (currently 12.5) plus any transaction fees in the block. Those are the only stipulations for a coinbase transaction.

Andrew Chow
  • 67,209
  • 5
  • 76
  • 149
0

look at core's getblocktemplate RPC call
https://en.bitcoin.it/wiki/Getblocktemplate

Albert S
  • 1,600
  • 10
  • 21