4 Answers
4

At any second, a block may be "solved." This means that everyone else
in the world working on that block must stop, and restart their work.
Continuing to work after that point is known as working on a "stale
block" because it is old data, and old transactions.

My understanding is the term stale is much more commonly applied to shares when mining in a pool, so you're more likely to hear about stale shares than stale blocks. In this case, the pool probably wouldn't even bother checking whether the share actually solved a block or not.

Detached or Orphaned blocks are valid blocks which are not part of the
main chain. They can occur naturally when two miners produce blocks at
similar times or they can be caused by an attacker (with enough
hashing power) attempting to reverse transactions.

My own understanding is that orphaned blocks are initially accepted by the majority of the network, but are later rejected when proof of a longer blockchain is received that doesn't include that particular block.

This means that a user could see a transaction as having one confirmation and then, if a longer blockchain was received that didn't include the transaction, it could change back to 0 confirmations.

The first is perhaps best called extinct blocks. These are blocks that were produced by building on an block that is no longer the active tip of the chain. Some nodes may have considered it to be the best block at some point, but they switched to another chain which does not contain the relevant block anymore. They are valid, verified, and their ancestry up to the genesis block is fully known - they're just not currently 'active'. They are sometimes called stale blocks (typically in the context of mining software realizing it built on old data) or orphan blocks. The latter name originates from the fact that payouts from extinct blocks are denoted as "orphaned" in the reference client (referring to the fact that their coinbase transactions are now orphaned).

However, there also exist real orphan blocks, with orphan in its original meaning of "having no parent". These are blocks received by a node that does not have its entire ancestry (yet) and thus cannot be validated. Nodes keep such blocks in memory, while asking their peers to fill in the gap of their history. The client does not show these, so when people talk about orphan blocks, they are most likely referring to extinct blocks. Note that since Bitcoin Core v0.10, there are no such orphan blocks anymore, due to a significant change in the download mechanism.

Nice explanation Pieter, could you please elaborate on details of current download mechanism that Bitcoin Core uses? I wonder how it solves orphan block problem.
– eugenekrMar 19 at 16:46

1

@eugenkr The headers are downloaded and validated first, before the client even requests block data. As a result, it will never receive blocks whose parents it doesn't know about.
– Pieter WuilleMar 19 at 17:11

Both answers are quite good and explain well about the concept of orphaned block (or more precise name according to Pieter Wuilie: extinct blocks). I just want to give a specific view for the future readers who could also want to take a look at the real orphan blocks in Bitcoin chain, just like me:)

In blockchain.info website, there are some detailed record for those orphaned blocks, if you click the block height, even the block header info of those orphaned blocks are there for you, for example an orphaned block 503949 mined by SlushPool.

It also has a statistics view of orphaned blocks, I download its csv history and can calculate Bitcoin orphaned block rate is about 0.31% (from 2014/3/18 to 2017/6/14). The statistic excel file is here.