<p>Blockchain forks occur when two blocks are found at the same height. Only one of the two chaintips can become part of the best chain. Each full node will consider the first block it saw to be the best block for that height, until proven otherwise by another chaintip accumulating a greater <em>total difficulty</em> (i.e. adding another block). When another chaintip pulls ahead, the node will reorganize to the best chain. The node reverts its current chaintip back to the last shared block and then applies the blocks from the best chain. A blockchain fork is generally resolved whenever a block for the next height is found. The &quot;best chain tip&quot; is always a probabilistic determination, but the confidence quickly rises as more blocks get added (hence the recommendation in the white paper to wait for six confirmations). Nothing prevents a miner to continue mining on a stale chaintip. However, a miner cannot spend the block reward if the block does not become part of the best chain, so in most cases, it is unreasonable to mine on a stale chaintip. A miner with a large portion of the hashrate may try to extend a stale chaintip if they authored the stale block in a <a href="/questions/tagged/selfish-mining" class="post-tag" title="show questions tagged &#39;selfish-mining&#39;" rel="tag">selfish-mining</a> attack.</p>
<p>Earlier in Bitcoin's history there were some two dozen cases in which blockchain forks consisted of multiple blocks before a best chain emerged. You can read more about that in <a href="https://bitcoin.stackexchange.com/a/4638/5406">What is the longest blockchain fork that has been orphaned to date?</a>. As far as I'm aware, we have not had a multi-block chainfork for multiple years.</p>
<p>If you have access to a Bitcoin Core instance that has been running for a long time, you can get all stale blocks it registered by calling the <code>getchaintips</code> rpc. Obviously, your node might not have seen all stale blocks that have occurred. Any node syncing later, will only download the best chain, and not acquire these stale chain tips.</p>
<p>Stale blocks were a fairly common occurrence in 2013-2015. IIRC, there would usually be one or more per day.
Headers-first sync introduced with Bitcoin Core 0.10.0 significantly reduced that. In 2016 the Fast Internet Bitcoin Relay Engine (<a href="/questions/tagged/fibre" class="post-tag" title="show questions tagged &#39;fibre&#39;" rel="tag">fibre</a>) replaced a previous effort (the &quot;Bitcoin Relay Network&quot;) to provide a supplementary relay network connecting especially mining entities that directly pushed new blocks to other participants.
The rate of stale blocks further dropped around the time that segwit got activated. Some people surmised back then that some miners had been running old versions of Bitcoin Core, and when segwit activation forced them to update to a segwit-compatible client, they leapfrogged a number of block relay improvements that had been added over the years. Another rumor was that some mining outlets (spending millions on mining hardware!) used micro-computers as their mining controllers which would take a while to validate new blocks, delaying their switch to the latest chaintip.</p>
<p>These days, it's common that the network goes weeks without any stale blocks. BitMEX Research runs a <a href="https://forkmonitor.info/nodes/btc" rel="noreferrer">forkmonitor</a> which offers an RSS feed to alert users when stale blocks (and other block related events) occur. Unfortunately, it seems to me that the RSS feeds item list was reset and I was unable to find a list of their history of fork alerts. In lieu of that, let me note that <a href="https://twitter.com/BitMEXResearch/status/1221673450986565633" rel="noreferrer">BitMEX Research tweeted on 2020-01-26</a> that they had seen a stale block at height 614,732 and that this was the first stale block they had registered since 2019-10-16. Searching <a href="https://twitter.com/search?q=%40bitmexresearch%20stale&amp;f=live" rel="noreferrer">BitMEX Research's tweets for &quot;stale&quot;</a>, since 2020-01-26, they also tweeted about stale blocks on 2020-07-10, 2020-06-09, 2020-03-03, 2020-02-27, and 2020-02-22. <strong>Assuming BitMEX research tweeted about each, they have recorded seven stale blocks since 2019-10-16.</strong></p>
<p>Note that the &quot;<a href="https://www.blockchain.com/charts/n-orphaned-blocks" rel="noreferrer">orphan block chart</a>&quot; provided by blockchain.com appears to be broken.</p>

CC BY-SA 4.0
2022-09-01T17:16:17.377Z
Does this mean that sometimes nodes who provided PoW,  do not get a  reward for mining a block because it's not part of the best chain?
Sebi2020
CC BY-SA 4.0
2022-09-01T17:28:34.727Z
Yes, when two blocks are found at the same height, one of them will go stale, as the best blockchain can only have one block at every height.—Since the block reward can only be spent after a 100 block maturation period, generally only the one in the best chain ever produces a spendable output.
Murch
CC BY-SA 4.0
2020-07-25T20:59:24.730Z
2020-07-26T16:06:44.423Z
2020-07-26T16:06:44.423Z
Murch
<p>I was wondering, how often does temporary forks occur? They appear when there are two different blocks mined based on the same previous block (parent block), but what are chances for that? And if fork occurs, how long does it last (on average)? What is the moment in a chain when side branch gets discarded by the network, or when is the node certain that the branch he continues to mine on is really the longest one (following the longest chain rule)? <br/>
Thank you guys!!</p>

<blockchain-fork><chain-reorganization><best-chain><stale-block>
How often does temporary fork occur and how long does it last?
ddavi031
# How often does temporary fork occur and how long does it last?

(Asked by: username_0 on 2020-07-25)

I was wondering, how often does temporary forks occur? They appear when there are two different blocks mined based on the same previous block (parent block), but what are chances for that? And if fork occurs, how long does it last (on average)? What is the moment in a chain when side branch gets discarded by the network, or when is the node certain that the branch he continues to mine on is really the longest one (following the longest chain rule)?   
Thank you guys!!

**Tags:** blockchain-fork, chain-reorganization, best-chain, stale-block


---

## 1 answers

### Answer by username_1 on 2020-07-25. Score: 7 | Accepted answer

Blockchain forks occur when two blocks are found at the same height. Only one of the two chaintips can become part of the best chain. Each full node will consider the first block it saw to be the best block for that height, until proven otherwise by another chaintip accumulating a greater *total difficulty* (i.e. adding another block). When another chaintip pulls ahead, the node will reorganize to the best chain. The node reverts its current chaintip back to the last shared block and then applies the blocks from the best chain. A blockchain fork is generally resolved whenever a block for the next height is found. The "best chain tip" is always a probabilistic determination, but the confidence quickly rises as more blocks get added (hence the recommendation in the white paper to wait for six confirmations). Nothing prevents a miner to continue mining on a stale chaintip. However, a miner cannot spend the block reward if the block does not become part of the best chain, so in most cases, it is unreasonable to mine on a stale chaintip. A miner with a large portion of the hashrate may try to extend a stale chaintip if they authored the stale block in a [selfish-mining](/questions/tagged/selfish-mining "show questions tagged 'selfish-mining'") attack.

Earlier in Bitcoin's history there were some two dozen cases in which blockchain forks consisted of multiple blocks before a best chain emerged. You can read more about that in [What is the longest blockchain fork that has been orphaned to date?](https://bitcoin.stackexchange.com/a/4638/5406). As far as I'm aware, we have not had a multi-block chainfork for multiple years.

If you have access to a Bitcoin Core instance that has been running for a long time, you can get all stale blocks it registered by calling the `getchaintips` rpc. Obviously, your node might not have seen all stale blocks that have occurred. Any node syncing later, will only download the best chain, and not acquire these stale chain tips.

Stale blocks were a fairly common occurrence in 2013-2015. IIRC, there would usually be one or more per day.
Headers-first sync introduced with Bitcoin Core 0.10.0 significantly reduced that. In 2016 the Fast Internet Bitcoin Relay Engine ([fibre](/questions/tagged/fibre "show questions tagged 'fibre'")) replaced a previous effort (the "Bitcoin Relay Network") to provide a supplementary relay network connecting especially mining entities that directly pushed new blocks to other participants.
The rate of stale blocks further dropped around the time that segwit got activated. Some people surmised back then that some miners had been running old versions of Bitcoin Core, and when segwit activation forced them to update to a segwit-compatible client, they leapfrogged a number of block relay improvements that had been added over the years. Another rumor was that some mining outlets (spending millions on mining hardware!) used micro-computers as their mining controllers which would take a while to validate new blocks, delaying their switch to the latest chaintip.

These days, it's common that the network goes weeks without any stale blocks. BitMEX Research runs a [forkmonitor](https://forkmonitor.info/nodes/btc) which offers an RSS feed to alert users when stale blocks (and other block related events) occur. Unfortunately, it seems to me that the RSS feeds item list was reset and I was unable to find a list of their history of fork alerts. In lieu of that, let me note that [BitMEX Research tweeted on 2020-01-26](https://twitter.com/BitMEXResearch/status/1221673450986565633) that they had seen a stale block at height 614,732 and that this was the first stale block they had registered since 2019-10-16. Searching [BitMEX Research's tweets for "stale"](https://twitter.com/search?q=%40bitmexresearch%20stale&f=live), since 2020-01-26, they also tweeted about stale blocks on 2020-07-10, 2020-06-09, 2020-03-03, 2020-02-27, and 2020-02-22. **Assuming BitMEX research tweeted about each, they have recorded seven stale blocks since 2019-10-16.**

Note that the "[orphan block chart](https://www.blockchain.com/charts/n-orphaned-blocks)" provided by blockchain.com appears to be broken.

> **Comments:**
> **username_2**: Does this mean that sometimes nodes who provided PoW,  do not get a  reward for mining a block because it's not part of the best chain?  
> **username_1**: Yes, when two blocks are found at the same height, one of them will go stale, as the best blockchain can only have one block at every height.—Since the block reward can only be spent after a 100 block maturation period, generally only the one in the best chain ever produces a spendable output.  

---

