How create / generate a coinbase transaction for a new block?

1

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

Posted 2017-08-26T23:35:56.733

Reputation: 131

Answers

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

Posted 2017-08-26T23:35:56.733

Reputation: 40 910

1

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

Albert s

Posted 2017-08-26T23:35:56.733

Reputation: 1 344