<p>The coinbase transaction is added to a block template by a miner:</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/miner.cpp#L157-L167" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/miner.cpp#L157-L167</a></p>

<p>When the block is solved, the entire block is broadcast to the network.</p>

<p>Outside of a new block, you'll never see a subsidy transaction being broadcast on their own. Here's the logic that rejects subsidy transactions from mempool acceptance:</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/validation.cpp#L575-L577" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/validation.cpp#L575-L577</a></p>

CC BY-SA 4.0
2020-05-27T00:13:29.233Z
2020-05-27T00:38:48.850Z
2020-05-27T00:38:48.850Z
pinhead
<p>I'm taking a look at Bitcoin core and am looking for where the TX is effectively "generated" and send out to an address. I've found the nSubsidy block reward, but I'm currently looking for where the transaction is sent out and recorded on the blockchain. If I don't understand something right, please correct me, otherwise, if you have an answer please tell me!</p>

<bitcoin-core><bitcoin-core-development>
Where is the block reward system coded in Bitcoin core?
whoff
# Where is the block reward system coded in Bitcoin core?

(Asked by: username_0 on 2020-05-26)

I'm taking a look at Bitcoin core and am looking for where the TX is effectively "generated" and send out to an address. I've found the nSubsidy block reward, but I'm currently looking for where the transaction is sent out and recorded on the blockchain. If I don't understand something right, please correct me, otherwise, if you have an answer please tell me!

**Tags:** bitcoin-core, bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2020-05-27. Score: 3 | Accepted answer

The coinbase transaction is added to a block template by a miner:

<https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/miner.cpp#L157-L167>

When the block is solved, the entire block is broadcast to the network.

Outside of a new block, you'll never see a subsidy transaction being broadcast on their own. Here's the logic that rejects subsidy transactions from mempool acceptance:

<https://github.com/bitcoin/bitcoin/blob/4af01b37d40246cd1fdb54719855927e36a36b46/src/validation.cpp#L575-L577>


---

