In my previous article on Proof of Work, we looked at Proof of Work as it relates to solving the Byzantine Generals Problem. After publishing that article, I received feedback about what happens if 2 or more miners solve the block at the same or near the same time? When you think about it, there are so many nodes mining at any given time. It is extremely likely that multiple nodes will find the answer at or near the same time, and this could cause chaos with different nodes working on different chains. In this article, we will look at one very important concept in Blockchain technology, the Longest Blockchain rule.
With every miner mining the same problem simultaneously, it becomes more likely that two or more miners find the nonce for the current block at the same time. When this occurs, the blockchain will fork, and some miners may choose to keep mining on one of the forks to extend the blockchain. When this happens, the block with the larger collection of Proof of Work is accepted and added to the blockchain. This is the general principle behind having to wait for 3-6 confirmations for a purchase to be completed. The system needs to make sure that the block that contained your transaction is in fact on the Longest and accurate blockchain. The diagram below should help visualize how this works.
As you can see in the diagram there is a fork in the chain, and it begins to go in 2 directions. The one direction becomes the longest, due to the fact that the next block is attached to that chain. What happens to the other block, it also had transactions? Those blocks are referred to as Orphan blocks. Blocks that are not accepted or added into the blockchain normally due to a network time lag during the acceptance of the block. Orphan blocks are valid and verified blocks but are rejected by the network. Orphaned blocks are also commonly referred to as Detached Blocks. They are not part of the network and live in isolation. Orphaned blocks are also created if a hacker or malicious actor, with sufficient hashing power, attempted to reverse transactions that were already approved by the network. Any valid transactions contained within an orphaned block are added to the next valid block that is accepted onto the blockchain.
I hope you have found this article to be a helpful explanation on an important and often overlooked concept in crypto. Please comment if you feel I have left anything out.
Article comments