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).

2 Answers 2


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.


look at core's getblocktemplate RPC call

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.