Since Cryptocurrency is software, it needs constant updates to improve functionality and fix issues. The decentralized nature of blockchains means that all participants on the network, known as nodes, must be able to come to an agreement as to the shared state of the blockchain. The set of rules that the nodes must agree on is known as “protocol”.
Updates that change the protocol are known as “forks”, but there are two kinds of forks: Hard Forks and Soft Forks.
A soft fork is a ‘mild’ method of updating a cryptocurrency, whereas the two codes – the original and the one – can co-exist with each other freely. It can be compared with a software upgrade that is backwards compatible with all the previous versions.
Soft forks do not require upgrade of nodes on the network to maintain consensus as all the blockchain blocks follow both the old set of consensus rules as well as the new ones. But the blocks produced by nodes following the old set of consensus rules will violate the new set of rules and will probably be disconnected.
This means that for a soft fork to work, a majority of miners must recognize the new set of consensus rules. Given that such majority is reached, the new fork will be adopted for use and recognition.
A hard fork is a permanent divergence from the previous version of a blockchain; a new set of consensus rules are introduced into the network that is not compatible with the older network. In other words, a hard fork can be thought of as a software upgrade that is not compatible with previous versions of the software. All network participants are required to upgrade to the latest version of the software in order to continue verifying and validating new blocks of transactions.
Under a hard fork, blocks that are confirmed by participants that are not yet upgraded to the latest version of the protocol software will be invalid. Nodes running the previous version of the software will have to follow the new set of consensus rules in order for their blocks to be valid on the forked network. In the event of a hard fork, if there is still mining support for the minority chain, then two blockchains can continue to exist simultaneously.
Hard fork is based on the original blockchain which it was forked from. This means that all transactions, and also balances are copied from the old network. As an example, if you had 1 Bitcoin, and a hard fork happened based on Bitcoin, then you would also have 1 coin of the forked network.
Hard forks can usually fall into two sub-categories, they can either be a planned hard fork or a contentious hard fork.
Planned Hard Fork: A planned hard fork is simply an upgrade to the protocol that had already been made clear in advance by the developers of the project. Usually, a high-degree of consensus from the project developers and the community would already have been reached before the hard fork occurs.
Contentious Hard Fork: This type of hard fork occurs when there is severe disagreement between various participants in the project, which can include: developers, network users, and miners. Contentious hard forks normally take place because one portion of the community believes that major changes in a cryptocurrency’s code will produce a superior blockchain. A well-known example of a contentious hard fork was the Bitcoin Cash hard fork. Where it was believed by a portion of the community that increasing Bitcoin’s block size from 1MB to 8MB would allow for the faster processing of transactions on the network.