Besoin d'aide ?

Blockchain Basics - Orphan Blocks

In this article we are going to be talking about orphan blocks, also known as stale blocks. Orphan blocks happen from time to time on most Proof of Work blockchains. But why do they happen and what are they?

Before proceeding, I highly recommend reading this article about proof of work and how it works. This will give you a better fundamental understanding of mining and especially one way hash functions (hashing).

Summary of proof of work

Proof of work is based on one way hash functions. One way hash functions allow us to “hash” or “zip” an infinite amount of data into a fixed size output called hash. In the blockchain case, input data are transactions while output data is a hash output.

Once the miner finds the correct output data (hash), the block of transactions is confirmed and the block is submitted to the network. If you would like to read a bit more technical article about proof of work, feel free to read it here.

In layman terms, the miners are solving a mathematical function, the first to correctly solve the problem will broadcast the solution to the nodes around the world and get the block reward for solving the problem. It is important to note that broadcasting the solution throughout the entire network might take some time.

So, what happens if two miners find the correct solution at the same time or roughly the same time? The chain gets splitted into two chains. Once the longest chain is found, the other blocks become orphan blocks.

What is an Orphan block?

Orphan block is a term used by the general public, but in technical documents it is described as a stale block. An Orphan block is created when two miners (or more) find the solution at the same time.

Since each miner will broadcast the solution to the network and the network requires a couple of moments to synchronize, there will be two blockchains for a brief period of time. Each part of the blockchain will think that their solution was found first and is the solution that should be used primarily. In reality, both solutions are valid.

Once the new blockchain is active, the “race” between both chains begins. Whichever chain will have the longer chain will be the main chain.

Detailed Explanation

You can imagine it as if one miner in the USA would confirm the block at the same time as a miner in Europe. The nodes in the USA would most likely get synchronized by the USA miner first and the nodes in Europe would get synchronized by the Europe miner first. At that point in time, there would be two concurrent blockchains running at the same time. This is what the below image presents. USA nodes are using the block confirmed by the USA miner while the Europe nodes are using the blocks confirmed by the Europe nodes. The chains do not communicate with each other.

If we look at the above example, there are two concurrent blockchains running on the nodes, but the blockchain rules that the longest chain is the correct/main one. This means that the next blocks found by either “side” or chain will be crucial. If the next blocks are confirmed faster on the Europe side and there are less confirmed solutions on the USA side, the Europe chain is considered the longest, thus the block on the USA blockchain is considered an Orphan block.

Normally the chain that has the highest hashrate will be the main one as the blocks will be found quicker there.

No one can know if the block is orphaned until the longest chain is decided.

Do miners get paid for orphan blocks?

It depends on the blockchain. Some blockchains do pay for orphan blocks. Before Ethereum went to Proof of Stake, it rewarded the miners for orphan blocks, yet the reward was lower than the reward for normal blocks.

There are too many blockchains out there to list all of them here, but generally the blockchains with very fast block times tend to reward orphan blocks in some way or another. Not necessarily though.

The most common blockchains that do not reward orphan blocks and are also used in NiceHash’s EasyMining are:

  • Bitcoin (BTC)
  • Bitcoin Cash (BCH)
  • Dogecoin (DOGE)
  • Litecoin (LTC)
  • Zcash (ZEC)

What happens with the transactions in orphan blocks?

Transactions in the orphan blocks are not processed on the main chain. This means that if the block containing the transaction gets orphaned, the transaction will get discarded. The wallet balance of the sender will be the same as it was prior to transferring the funds and the destination wallet will not see any incoming funds. However, the transaction could actually be included in the both competing chains (both blocks). In which case, the transaction is processed nevertheless.

As always, feel free to join our Reddit page and Discord server!


ÉCRIT PAR
Marko Tarman
Marko est le spécialiste du matériel de minage et le créateur de contenu de NiceHash. Il a commencé à miner en 2012 avant la sortie des premiers ASIC. Il est passé de GPU mining BTC, LTC à VTC, et même DOGE. Sa slogan de minage: "J'ai 99 problèmes, un mauvais riser est tout"