I know that the outputs coinbase transaction can be spent only after receiving 100 confirmations. So is it that a miner who mined an orphan block receives the outputs of coinbase transaction but can never spend them? In such a case the number of bitcoins in circulation would reduce overtime due to creation of orphan blocks. If your answer is that a miner doesn't get paid for orphan block, when will a miner get the block reward , is it after 100 confirmations? But if he gets the block reward after 100 confirmations, the coinbase transaction would have been created at the time of creation of the block itself right, so what about it?
2 Answers
So is it that a miner who mined an orphan block receives the outputs of coinbase transaction but can never spend them?
Kind of.
In such a case the number of bitcoins in circulation would reduce overtime due to creation of orphan blocks.
No, that's not how miners are paid.
Miners are essentially paid by themselves; they are allowed to produce coins out of thin air in the coinbase transaction. There is not some central money supply that the coins come from that pays coins to miners for creating a block.
When an orphan block is mined, the coinbase transaction is basically forgotten. The coins it produces never go into circulation and don't actually exist. Instead they are "replaced" by the block that was accepted by the rest of the network. So no coins are lost.
It's not that the transaction exists and the miner can't spend from it. Rather the transaction doesn't exist (it isn't in the main chain, so to the network it doesn't exist) so the miner can't spend from it. Because it is not part of the main chain it has no effect on Bitcoin's money supply.
-
Do you mean to say that the coins the miners produced during the coinbase transaction become a part of the 21 million BTC only after 100 confirmations for the block?– VasistaCommented Feb 13, 2018 at 7:46
-
Miners get paid by including their own coinbase transaction in the block and assigning the mining reward to themselves in the output of the coinbase transaction. Coinbase transaction outputs can only be spent when they have 100 confirmations. When two blocks are found at the same height, only one block can become part of the best chain. From the perspective of the best chaintip, the stale block might as well not exist, it’s transactions are not part of the transaction journal of the best chain, so the miner that mined the block never got paid according to the canonical truth of the Bitcoin network. The stale block’s reward could never be spent, because it never got 100 confirmations.