<p>The coinbase (or output with the mining reward) can only be spent after <code>COINBASE_MATURITY</code> has been reached which is set to <a href="https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h#L19" rel="nofollow noreferrer">100 blocks</a>. Hence a miner spending a coinbase that is later reversed is only a problem if there is a greater than a 100 block re-org. The chances of this happening on Bitcoin mainnet is infinitesimally small.</p>

CC BY-SA 4.0
2021-10-24T18:41:31.183Z
2021-10-24T18:41:31.183Z
Michael Folkson
<p>You have to distinguish between nodes' local view of the chain, and your global view when discussing here.</p>
<p>Every chain (meaning: a block together with all its direct and indirect ancestors) is a version of history. Within that chain, the block pays out to whomever mined the block. As far as miners on that chain goes, they are extending the chain they believe to be legitimate, and see themselves as being paid in the process. So B's miner believes it is being paid by B, and believes A is being paid by the parent block. Similar with C, seeing A and B being paid.</p>
<p>However, when the reorganization occurs, A, B, and C's miners, along with any nodes which saw those blocks first, realize they were working on a version of history that the network will (probably) not accept, and they switch over to the D-E-F-G chain, in which they are not paid.</p>
<p>Now, there is a rule in Bitcoin called <em>maturity</em>, which prevents the coins minted in blocks from being spent until 100 blocks have been mined on top. This prevents a situation where many transactions are invalidated because of a reorganization that removes the coinbase that formed the initial credit. After 100 blocks, it is highly unlikely a reorganization will still occur.</p>

CC BY-SA 4.0
2021-10-24T18:57:14.210Z
Thank you. So in the first picture, where the blue chain gets to be the longest chain: 1. Does C get a reward at all? 2. Is it true that A and B still do get the reward, but they will never be able to spend them because the green chain doesn't satisfy maturity? 3. If 2 is true, does that mean the total amount of bitcoins will practically decrease, because the nobody can ever spend the rewards on orphan chains?
Erin
CC BY-SA 4.0
2021-10-24T18:57:25.027Z
1. Within the A-B-C chain, yes; within the D-E-F-G chain, no. If you assume D-E-F-G is eventually the one that wins, and thus ~all nodes accept, in the long term, no.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T18:59:18.090Z
Sorry could you please refresh and get the latest version of my comment? :P I pressed enter thinking it would give me a new line but instead it posted my comment before it was done writing
Erin
CC BY-SA 4.0
2021-10-24T18:59:27.880Z
You have to realize: nodes don't see or care about the whole picture; the network rules don't consider the entire tree, they function *within one chain*, and thus the answers to all these questions are "it depends on which chain your local view currently accepts", which can change over time.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T19:01:16.177Z
2. A and B do get their reward, *within the chain they are building*. If that chain is extended by another 100 blocks, they will eventually be able to spend the coins *within that chain*.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T19:02:11.313Z
3. What the total number of coins in circulation is depends *on which chain you accept*. In a reorganization, that chain changes, and thus the number of coins in circulation can also change.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T19:05:57.050Z
Nodes accept among all otherwise valid (i.e. no invalid signatures etc.) chains, the chain with the highest total proof of work in it. If there are multiple, the one with the first-seen tip is accepted. Thus which chain a node accepts depends on aspects such as how close they are to miners, and their connectivity. There is no global consensus: nodes are _never_ sure about _any_ block that it will eventually be accepted by the rest of the network. It just becomes less and less likely to change, as more and more blocks are built on top.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T19:55:12.467Z
From the perspective of nodes that accept a chain which does not include blocks A and B, blocks A and B don't *exist*. They aren't part of history. They don't get to consume any subsidy, and thus they don't affect the 21 million limit.
Pieter Wuille
CC BY-SA 4.0
2021-10-24T18:46:33.567Z
2021-10-24T18:55:19.047Z
2021-10-24T18:55:19.047Z
Pieter Wuille
<p>I am aware this is related to <a href="https://bitcoin.stackexchange.com/questions/12462/what-happens-to-extinct-blockchains-and-transactions-inside-of-them">this question</a>. However, I am specifically curious about what would happen to the <strong>mining rewards</strong>, not the transactions, under a forking condition.</p>
<p><a href="https://i.sstatic.net/hHiva.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hHiva.png" alt="enter image description here" /></a>
As shown in the picture. Suppose at some point the blockchain starts branching. Each new block on each chain gets appended at the same time, until eventually the blue chain gets longer than the green chain due to <code>G</code> being mined faster. Then the green chain becomes invalid.</p>
<p>Does this mean the miners for A, B, C and D, E, F don't get mining rewards at all until a longer branch (in this case, the blue branch) is determined, then miners for D, E, F, G get rewards?</p>
<p>If so, what if a <em>selfish miner</em> releases two new blocks on the green chain after G is being appended? (As shown below) Does that mean the rewards get reversed again?</p>
<p><a href="https://i.sstatic.net/2NJ1B.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2NJ1B.png" alt="enter image description here" /></a></p>
<p>Thanks!</p>
<hr />
<p>Edits:</p>
<p>Following up with one of the answers, suppose what we have in the following is a GLOBAL view of all the blocks on the whole blockchain system:
<a href="https://i.sstatic.net/3FqLw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3FqLw.png" alt="enter image description here" /></a></p>
<p>So apparently the colored blocks become orphans. However, block #1 and block #3 seem to still get rewarded, except they can never spend those rewards. So does that mean the total number of bitcoins on the market will practically be smaller than 21 Million (after all the coins are mined), due to these orphan blocks? I.e., some coins are rewarded to the orphan blocks but they can never be used by anyone?</p>
<p>And do block 2, 4, and 5 also get rewarded (but can't spend those rewards)?</p>

<blockchain><mining-reward><reward-schedule>
How/When is mining reward given in the presence of forking / orphan chain?
Erin
# How/When is mining reward given in the presence of forking / orphan chain?

(Asked by: username_0 on 2021-10-24)

I am aware this is related to [this question](https://bitcoin.stackexchange.com/questions/12462/what-happens-to-extinct-blockchains-and-transactions-inside-of-them). However, I am specifically curious about what would happen to the **mining rewards**, not the transactions, under a forking condition.

[![enter image description here](https://i.sstatic.net/hHiva.png)](https://i.sstatic.net/hHiva.png)
As shown in the picture. Suppose at some point the blockchain starts branching. Each new block on each chain gets appended at the same time, until eventually the blue chain gets longer than the green chain due to `G` being mined faster. Then the green chain becomes invalid.

Does this mean the miners for A, B, C and D, E, F don't get mining rewards at all until a longer branch (in this case, the blue branch) is determined, then miners for D, E, F, G get rewards?

If so, what if a *selfish miner* releases two new blocks on the green chain after G is being appended? (As shown below) Does that mean the rewards get reversed again?

[![enter image description here](https://i.sstatic.net/2NJ1B.png)](https://i.sstatic.net/2NJ1B.png)

Thanks!

---

Edits:

Following up with one of the answers, suppose what we have in the following is a GLOBAL view of all the blocks on the whole blockchain system:
[![enter image description here](https://i.sstatic.net/3FqLw.png)](https://i.sstatic.net/3FqLw.png)

So apparently the colored blocks become orphans. However, block #1 and block #3 seem to still get rewarded, except they can never spend those rewards. So does that mean the total number of bitcoins on the market will practically be smaller than 21 Million (after all the coins are mined), due to these orphan blocks? I.e., some coins are rewarded to the orphan blocks but they can never be used by anyone?

And do block 2, 4, and 5 also get rewarded (but can't spend those rewards)?

**Tags:** blockchain, mining-reward, reward-schedule


---

## 2 answers

### Answer by username_2 on 2021-10-24. Score: 7 | Accepted answer

You have to distinguish between nodes' local view of the chain, and your global view when discussing here.

Every chain (meaning: a block together with all its direct and indirect ancestors) is a version of history. Within that chain, the block pays out to whomever mined the block. As far as miners on that chain goes, they are extending the chain they believe to be legitimate, and see themselves as being paid in the process. So B's miner believes it is being paid by B, and believes A is being paid by the parent block. Similar with C, seeing A and B being paid.

However, when the reorganization occurs, A, B, and C's miners, along with any nodes which saw those blocks first, realize they were working on a version of history that the network will (probably) not accept, and they switch over to the D-E-F-G chain, in which they are not paid.

Now, there is a rule in Bitcoin called *maturity*, which prevents the coins minted in blocks from being spent until 100 blocks have been mined on top. This prevents a situation where many transactions are invalidated because of a reorganization that removes the coinbase that formed the initial credit. After 100 blocks, it is highly unlikely a reorganization will still occur.

> **Comments:**
> **username_0**: Thank you. So in the first picture, where the blue chain gets to be the longest chain: 1. Does C get a reward at all? 2. Is it true that A and B still do get the reward, but they will never be able to spend them because the green chain doesn't satisfy maturity? 3. If 2 is true, does that mean the total amount of bitcoins will practically decrease, because the nobody can ever spend the rewards on orphan chains?  
> **username_2**: 1. Within the A-B-C chain, yes; within the D-E-F-G chain, no. If you assume D-E-F-G is eventually the one that wins, and thus ~all nodes accept, in the long term, no.  
> **username_0**: Sorry could you please refresh and get the latest version of my comment? :P I pressed enter thinking it would give me a new line but instead it posted my comment before it was done writing  
> **username_2**: You have to realize: nodes don't see or care about the whole picture; the network rules don't consider the entire tree, they function *within one chain*, and thus the answers to all these questions are "it depends on which chain your local view currently accepts", which can change over time.  
> **username_2**: 2. A and B do get their reward, *within the chain they are building*. If that chain is extended by another 100 blocks, they will eventually be able to spend the coins *within that chain*.  
> **username_2**: 3. What the total number of coins in circulation is depends *on which chain you accept*. In a reorganization, that chain changes, and thus the number of coins in circulation can also change.  
> **username_2**: Nodes accept among all otherwise valid (i.e. no invalid signatures etc.) chains, the chain with the highest total proof of work in it. If there are multiple, the one with the first-seen tip is accepted. Thus which chain a node accepts depends on aspects such as how close they are to miners, and their connectivity. There is no global consensus: nodes are _never_ sure about _any_ block that it will eventually be accepted by the rest of the network. It just becomes less and less likely to change, as more and more blocks are built on top.  
> **username_2**: From the perspective of nodes that accept a chain which does not include blocks A and B, blocks A and B don't *exist*. They aren't part of history. They don't get to consume any subsidy, and thus they don't affect the 21 million limit.  

---

### Answer by username_1 on 2021-10-24. Score: 1

The coinbase (or output with the mining reward) can only be spent after `COINBASE_MATURITY` has been reached which is set to [100 blocks](https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h#L19). Hence a miner spending a coinbase that is later reversed is only a problem if there is a greater than a 100 block re-org. The chances of this happening on Bitcoin mainnet is infinitesimally small.


---

