1

I am aware this is related to this question. However, I am specifically curious about what would happen to the mining rewards, not the transactions, under a forking condition.

enter image description here 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

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

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

Erin
  • 15
  • 4

2 Answers2

7

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.

Pieter Wuille
  • 105,497
  • 9
  • 194
  • 308
  • 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 Oct 24 '21 at 18:57
  • 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 Oct 24 '21 at 18:57
  • 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 Oct 24 '21 at 18:59
  • 1
    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 Oct 24 '21 at 18:59
  • 1
  • 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 Oct 24 '21 at 19:01
  • 1
  • 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 Oct 24 '21 at 19:02