<p>The coinbase transaction is like every other transaction except it has only 1 special coinbase input which you can read about here: <a href="https://bitcoin.org/en/developer-reference#coinbase" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#coinbase</a>. 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.</p>

CC BY-SA 3.0
2017-08-27T04:04:04.710Z
2017-08-27T04:04:04.710Z
Ava Chow
<p>look at core's <code>getblocktemplate</code> RPC call<br>
<a href="https://en.bitcoin.it/wiki/Getblocktemplate" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Getblocktemplate</a></p>

CC BY-SA 3.0
2017-08-27T09:44:09.903Z
2017-08-27T09:44:09.903Z
Albert S
<p>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).</p>

<mining-theory><coinbase-transaction><c><source-code>
How create / generate a coinbase transaction for a new block?
Kleber Mota
# How create / generate a coinbase transaction for a new block?

(Asked by: username_0 on 2017-08-26)

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

**Tags:** mining-theory, coinbase-transaction, c, source-code


---

## 2 answers

### Answer by username_1 on 2017-08-27. Score: 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.


---

### Answer by username_2 on 2017-08-27. Score: 0

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


---

