3

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!

1 Answer 1

3

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

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.