A fork in the blockchain happens for one of two reasons:
1. Due to a change in the design of the technology.
2. If changes are initiated by the software developers.
The design of the blockchain technology at times causes temporary forks. These are referred to as a ‘softfork’, whereas a permanent fork is referred to as a ‘hardfork’.
Forks are created by full nodes and occur when:
– The consensus protocol is updated (softfork and hardfork)
– Two miner nodes create a new block at roughly the same time (softfork)
When changes are made to the consensus protocol a softfork might occur while all the full nodes are updating, but will correct once all the full nodes are following the same consensus rules again. If for whatever reason some full nodes cannot be updated to follow the new consensus rules a hardfork might happen, and the full nodes will then divide and continue build on one fork that ‘follows the old rules’ and another that ‘follows the new rules’. However, this can resolve itself if majority of the miners are creating blocks that follow the ‘new rules’. This chain will eventually will become the longer chain and thereby prompt full nodes that ‘follow the old rules’ to accept it as the valid chain.
At times it happens that two miner nodes create a new block at nearly the same time, and the blocks are then added to the chain simultaneous. What happens is that full node one add the block from miner node one, and full node two add the block from miner node two. This cause a temporary fork which is resolved when the next block is created and added to either chain. Whichever chain the block was added to will now be the longest chain and accepted as the valid chain by all full nodes.
As per the blockchain design, full nodes always choose the chain that is the most difficult to recreate i.e. longest, as the valid chain. In the two scenarios described a potential hardfork turn into a softfork as it is no longer a permanent fork.
A fork that has been initiated by software developers is called a ‘split’, and for cryptocurrency this means a secondary coin is issued and is tied to the new blockchain – the original coin will stay on the original blockchain. The most common reason for a split is to address shortcomings in the current blockchain, but can also be due to a newly developed cryptocurrency wanting to leverage the same blockchain source code, and its miner node resources. Bitcoin Cash, Bitcoin Gold and Litecoin are results of such split.