<p>The first transaction of each block is special according to the Bitcoin Protocol, and people give it a special name: <em>generation transaction</em> (because it can generate new bitcoins) or <em>coinbase transaction</em> (because it's the only transaction to contain a field called the "coinbase" [the company Coinbase is named after this field, but is otherwise unrelated]).</p>

<p>Generation transations have the following rules (among others not relevant to your question):</p>

<ol>
<li><p>One, and exactly one, generation transaction must be present in every block.  (If you've ever heard of "empty blocks", that just means a block with nothing besides the generation transaction.)</p></li>
<li><p>They can only have one input.</p></li>
<li><p>That input "spends" an output (outpoint) of all zeroes.  This doesn't correspond to any actual transaction output.</p></li>
<li><p>That all-zero outpoint is considered to contain the newly-generated bitcoins (subsidy) for this block as well as the transaction fees paid in this block (fees), which are collectively known as the <em>block reward</em>.</p></li>
<li><p>The special input has a field called the <em>coinbase field</em> where the signature script (scriptSig) would go in a regular transaction.  Anything put in this field is validated like in a normal transaction, but in the original Bitcoin protocol, miners were not required to put anything in this field at all---they didn't need to provide a signature since the only person who could've created this transaction as the first in the block was the miner themselves.  Since them, <a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="nofollow noreferrer">BIP34</a> and <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki" rel="nofollow noreferrer">BIP141</a> have changed the rules somewhat, but not in a way relevant to your question.  Also not particularly relevant, the coinbase field is limited to 100 bytes in length.</p></li>
</ol>

<p>Actual validation works like this:</p>

<ol>
<li><p>When a node receives a new block, it starts by looking at all of the transactions <em>besides</em> the generation transaction.  It calculates how much transaction fee they all pay.</p></li>
<li><p>Then the node calculates the amount of new bitcoins (subsidy) the miner is eligible to claim, for example 50 BTC for the first 210,000 blocks or 12.5 BTC as of this writing (blocks 420,000-629,999).</p></li>
<li><p>The node adds these two numbers together.  This is the maximum amount of block reward the miner can claim.</p></li>
<li><p>Now the node looks at the generation transaction, makes sure it follows all of the other rules, and validates that its outputs spend a total of less than or equal to the block reward computed above.</p></li>
</ol>

<p>Of interesting historical note, the generation transactions in <a href="https://medium.com/@alcio/how-to-destroy-bitcoins-255bb6f2142e" rel="nofollow noreferrer">over 1,000 blocks</a> did not claim all the block reward they were eligible to claim.  This seems to have mostly occurred <a href="https://twitter.com/random_walker/status/948590112576868354" rel="nofollow noreferrer">early on.</a>  What happened to those bitcoins?  They can't be claimed by the miners of those blocks after the fact and nobody else can claim them, so they're permanently lost.</p>

CC BY-SA 4.0
2018-05-22T15:51:16.943Z
2018-05-22T15:51:16.943Z
David A. Harding
<p>from the wiki:</p>

<blockquote>
  <p>The coinbase is the content of the 'input' of a generation transaction. While regular transactions use the 'inputs' section to refer to their parent transaction outputs, a generation transaction has no parent, and creates new coins from nothing.</p>
</blockquote>

<p>So the miner who mines the block is free to send the newly created coins to any address he wants. There is nothing to validate (other than it is the correct amount).</p>

CC BY-SA 4.0
2018-05-22T14:54:13.463Z
2018-05-22T14:54:13.463Z
Mike D
<p>I'm trying to understand how Bitcoin works but there's a concept I can't get my head around. </p>

<p>I understand that transactions are validated by checking the signatures of each input is valid. However how do you validate new bitcoins or rewards that have entered the system through mining if these don't contain any any inputs? </p>

<p>For example if you're checking a transactions inputs are valid eventually you'll reach the point when the inputs were originally mined, so how would you know these were created legitimately?</p>

<coinbase-transaction>
How are newly created bitcoins are validated?
Chris Edgington
# How are newly created bitcoins are validated?

(Asked by: username_0 on 2018-05-22)

I'm trying to understand how Bitcoin works but there's a concept I can't get my head around.

I understand that transactions are validated by checking the signatures of each input is valid. However how do you validate new bitcoins or rewards that have entered the system through mining if these don't contain any any inputs?

For example if you're checking a transactions inputs are valid eventually you'll reach the point when the inputs were originally mined, so how would you know these were created legitimately?

**Tags:** coinbase-transaction


---

## 2 answers

### Answer by username_1 on 2018-05-22. Score: 3 | Accepted answer

The first transaction of each block is special according to the Bitcoin Protocol, and people give it a special name: *generation transaction* (because it can generate new bitcoins) or *coinbase transaction* (because it's the only transaction to contain a field called the "coinbase" [the company Coinbase is named after this field, but is otherwise unrelated]).

Generation transations have the following rules (among others not relevant to your question):

1. One, and exactly one, generation transaction must be present in every block. (If you've ever heard of "empty blocks", that just means a block with nothing besides the generation transaction.)
2. They can only have one input.
3. That input "spends" an output (outpoint) of all zeroes. This doesn't correspond to any actual transaction output.
4. That all-zero outpoint is considered to contain the newly-generated bitcoins (subsidy) for this block as well as the transaction fees paid in this block (fees), which are collectively known as the *block reward*.
5. The special input has a field called the *coinbase field* where the signature script (scriptSig) would go in a regular transaction. Anything put in this field is validated like in a normal transaction, but in the original Bitcoin protocol, miners were not required to put anything in this field at all---they didn't need to provide a signature since the only person who could've created this transaction as the first in the block was the miner themselves. Since them, [BIP34](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki) and [BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki) have changed the rules somewhat, but not in a way relevant to your question. Also not particularly relevant, the coinbase field is limited to 100 bytes in length.

Actual validation works like this:

1. When a node receives a new block, it starts by looking at all of the transactions *besides* the generation transaction. It calculates how much transaction fee they all pay.
2. Then the node calculates the amount of new bitcoins (subsidy) the miner is eligible to claim, for example 50 BTC for the first 210,000 blocks or 12.5 BTC as of this writing (blocks 420,000-629,999).
3. The node adds these two numbers together. This is the maximum amount of block reward the miner can claim.
4. Now the node looks at the generation transaction, makes sure it follows all of the other rules, and validates that its outputs spend a total of less than or equal to the block reward computed above.

Of interesting historical note, the generation transactions in [over 1,000 blocks](https://medium.com/@alcio/how-to-destroy-bitcoins-255bb6f2142e) did not claim all the block reward they were eligible to claim. This seems to have mostly occurred [early on.](https://twitter.com/random_walker/status/948590112576868354) What happened to those bitcoins? They can't be claimed by the miners of those blocks after the fact and nobody else can claim them, so they're permanently lost.


---

### Answer by username_2 on 2018-05-22. Score: 0

from the wiki:

> The coinbase is the content of the 'input' of a generation transaction. While regular transactions use the 'inputs' section to refer to their parent transaction outputs, a generation transaction has no parent, and creates new coins from nothing.

So the miner who mines the block is free to send the newly created coins to any address he wants. There is nothing to validate (other than it is the correct amount).


---

