<p>A stale block (also often confusingly referred to as 'orphan block') occurs when two competing blocks were found and then another block builds on top of one of them. </p>

<p>See the following minimal example: the blocks <code>B1</code> and <code>B2</code> were discovered at the same time and then the discovery of block <code>C</code> clarifies that <code>B2</code> is part of the chain with the most difficulty ("longest chain"). At this point <code>B1</code> becomes obsolete, as it is not part of the best chain.</p>

<pre><code>      B1
A -&gt;
      B2 -&gt; C
</code></pre>

<p>So, a miner would have received block <code>A</code>, then started to work on finding a successor to that. When <code>B1</code> and <code>B2</code> appeared, he would have received one of them first and started building on top of it, ignoring the other as not part of its best chain. When <code>C</code> appeared, the miners that were trying to build on top of <code>B1</code> reorganize to <code>B2 -&gt; C</code> and start building on <code>C</code>.</p>

<p>At no point would you process a stale block because once it is clear that the block is stale, it must already be part of an alternative chaintip that is not the longest chain. —  There is no reason for you to be interested in it anymore. Especially, there is no reason to start mining on top of a stale block, as you'd be wasting your mining power trying to extend a stale branch of the blockchain (unless you're trying some sort of majority or selfish mining attack).</p>

<p>Actual orphan blocks, i.e. blocks where you're missing the parent block, should not occur by accident on the network as the miner that discovered the last block would be interested in spreading the parent block in order to collect the reward. However, when the parent becomes known, it's not an orphan block anymore. ;)</p>

<p>On the other hand, if a block is not connected to the blockchain at all, it's simply going to be treated as an invalid block by all other network participants. </p>

CC BY-SA 3.0
2017-06-01T20:53:33.517Z
Apparently I misunderstood the orphan blocks. I thought that they were like oprhan transactions, if there is a block that cannot be connected to the blockchain because of a missing block in between. İs such a case possible? Or nodes never have such situations and blocks can always be connected to the chain without any problem?
Önder Gürcan
CC BY-SA 3.0
2017-06-01T22:14:08.347Z
I've updated my answer.
Murch
CC BY-SA 3.0
2017-06-02T12:10:48.993Z
[Protocol rules](https://en.bitcoin.it/wiki/Protocol_rules) of BitCoin says that (in message "block" bullet 11): _Check if prev block (matching prev hash) is in main branch or side branches. If not, add this to orphan blocks, then query peer we got this from for 1st missing orphan block in prev chain; done with block._
Önder Gürcan
CC BY-SA 3.0
2017-06-02T14:22:50.560Z
@ÖnderGürcan: What is your question? That is consistent with what I wrote above. Today orphan blocks basically don't occur anymore, since we have header first synchronization and the network is pretty well connected. It's just highly uncommon that you would receive a successor block before it's parent.
Murch
CC BY-SA 4.0
2017-06-01T16:48:09.807Z
2019-02-06T19:41:43.907Z
2019-02-06T19:41:43.907Z
Murch
<p>As far as I know, a miner begins creating a new block as soon as it receives a valid block from another miner. It then begins to construct and hash the next block on top of the block it just received.</p>

<p>However, in case of existence of orphan blocks, I suppose it starts mining after processing orphan blocks, right? Can anyone tell when exactly a miner would start working on a new block?</p>

<mining-theory><stale-block>
When does a miner exactly start to create a block?
Önder Gürcan
# When does a miner exactly start to create a block?

(Asked by: username_0 on 2017-06-01)

As far as I know, a miner begins creating a new block as soon as it receives a valid block from another miner. It then begins to construct and hash the next block on top of the block it just received.

However, in case of existence of orphan blocks, I suppose it starts mining after processing orphan blocks, right? Can anyone tell when exactly a miner would start working on a new block?

**Tags:** mining-theory, stale-block


---

## 1 answers

### Answer by username_1 on 2017-06-01. Score: 5

A stale block (also often confusingly referred to as 'orphan block') occurs when two competing blocks were found and then another block builds on top of one of them.

See the following minimal example: the blocks `B1` and `B2` were discovered at the same time and then the discovery of block `C` clarifies that `B2` is part of the chain with the most difficulty ("longest chain"). At this point `B1` becomes obsolete, as it is not part of the best chain.

```
      B1
A ->
      B2 -> C

```

So, a miner would have received block `A`, then started to work on finding a successor to that. When `B1` and `B2` appeared, he would have received one of them first and started building on top of it, ignoring the other as not part of its best chain. When `C` appeared, the miners that were trying to build on top of `B1` reorganize to `B2 -> C` and start building on `C`.

At no point would you process a stale block because once it is clear that the block is stale, it must already be part of an alternative chaintip that is not the longest chain. — There is no reason for you to be interested in it anymore. Especially, there is no reason to start mining on top of a stale block, as you'd be wasting your mining power trying to extend a stale branch of the blockchain (unless you're trying some sort of majority or selfish mining attack).

Actual orphan blocks, i.e. blocks where you're missing the parent block, should not occur by accident on the network as the miner that discovered the last block would be interested in spreading the parent block in order to collect the reward. However, when the parent becomes known, it's not an orphan block anymore. ;)

On the other hand, if a block is not connected to the blockchain at all, it's simply going to be treated as an invalid block by all other network participants.

> **Comments:**
> **username_0**: Apparently I misunderstood the orphan blocks. I thought that they were like oprhan transactions, if there is a block that cannot be connected to the blockchain because of a missing block in between. İs such a case possible? Or nodes never have such situations and blocks can always be connected to the chain without any problem?  
> **username_1**: I've updated my answer.  
> **username_0**: [Protocol rules](https://en.bitcoin.it/wiki/Protocol_rules) of BitCoin says that (in message "block" bullet 11): _Check if prev block (matching prev hash) is in main branch or side branches. If not, add this to orphan blocks, then query peer we got this from for 1st missing orphan block in prev chain; done with block._  
> **username_1**: @username_0: What is your question? That is consistent with what I wrote above. Today orphan blocks basically don't occur anymore, since we have header first synchronization and the network is pretty well connected. It's just highly uncommon that you would receive a successor block before it's parent.  

---

