Hard Fork & Soft Fork Explained

119

When you want to update an app on your smartphone, you need not think twice before updating. If you have an auto-update, then it will be updated without you noticing it. Software updates are a necessary part for it to function well. If the software is not updated regularly, then there are chances that you may run a risk of being denied access to its services.

In the crypto industry, the developers, miners, and full node users work to develop a solution that implements a blockchain consensus protocol. In such a situation when a community of developers introduces an update to the software, the blockchain is said to “fork”. The fork is categorized into Soft Fork and Hard Fork. 

While we speak about the computer software update, the two updates, backward compatibility, and incompatibility exist in the system. If the software is updated and the files are created such that the new version of the program can be opened and is working even in the old version, then it is said to be backward compatible else it is said to be backward incompatible.

Similarly when a blockchain protocol is backward compatible which means if there are changes in the code and it does not affect the functional continuity with its previous version then it is said to be a soft fork. Conversely, when a blockchain protocol is not backward compatible and does not support the previous version of the system then it is said to be a hard fork. 

Now, let’s understand in-depth about forks and the types of forks.

What is a fork?

A fork occurs when the software is copied, modified, or updated. The original software exists, but it takes a different direction from the previous one. Suppose there is a cryptocurrency information website that has some sort of disagreement. One part of the team will build another website that will replicate the previous one, but it is built on a different domain.

As days pass on, different types of information are added to the new website. In such cases, the two projects will have a common ground and they will share a history. Similar to a single road which is split into two separate roads, but they have a permanent divergence in their paths. Such things usually happen in open-source projects. 

Now, let’s dive in deep to understand the types of forks.

Hard Forks

The Hard Forks are backward-incompatible updates that occur when new rules are added in the nodes that conflict the rules of old nodes. These new nodes will interact only with the new version nodes. Hence, two networks are created in the blockchain: old rules and new rules.

These two networks run parallelly to propagate blocks and transactions. But, the networks will not work on the same blockchain. All the nodes will run on the same blockchain until a fork occurs but after its occurrence, these networks will have different blocks and transactions.

As there is a shared history, you will have coins in both the networks if you were holding them before the fork. To make it simpler let’s say you had 5 BTC when a fork occurred at Block 1. You may have spent 5 BTC on the old blockchain in Block 2, but you haven’t spent them in the new blockchain’s Block 2. Let’s assume that the cryptography hasn’t changed which means that you still have those five coins on the forked network. 

Example of Hard Fork

On August 1, 2017, there was a split between Bitcoin and Bitcoin Cash. To increase the number of transactions processed per block, the split was created. The SegWit solution which was developed had a maximum block size of 1 MB. Due to its small size, some of them were unhappy with the SegWit solution, so they decided to increase the block size from 1 MB to 8 MB. 

Any block with a small size or a size of 1MB will be valid by both Bitcoin Cash and Bitcoin protocol. If the block size is larger than 1 MB, then it will be valid only by the Bitcoin Cash protocol. As a result, there occurs a backward incompatibility and there is no unanimous consensus about its adoption. So, the blockchain is split into two branches. 

bitcoin hard fork

The branch which implemented the change was named Bitcoin-Cash, while the branch which did not implement the change maintained its original name, Bitcoin. Whenever a blockchain splits, its underlying currency also splits. If the split would not happen, then both protocols would be processed by both blockchains, which would result in a double-spending problem.

To solve this issue a new currency is created which will share the same history as the old one until the split. After the split is done, the currency can be independently managed and transacted.

List of Bitcoin Hardforks

Types of Hard Forks

Hard Forks are further categorized into two sub-categories namely:

  • Planned Hard Fork
  • Contentious Hard Fork

Planned Hard Fork

A planned hard fork is an upgrade to the protocol that was made clear in advance by the project developers. The project developers and the community will provide a high degree consensus before the hard fork occurs. An example of the Planned Hard Fork includes Monero’s hard fork which added a new privacy feature called Ring Confidential Transactions (RingCT).

Contentious Hard Fork

When there is a severe disagreement between various stakeholders of a project, the contentious hard fork occurs. This hard fork occurs because one part of the project team believes that major changes in cryptocurrency code will create a superior blockchain. An example of a contentious hard fork includes Bitcoin Cash Hard Fork, in which one part of the community believes that if the block size is increased from 1 MB to 8MB there will be faster transaction processing on the network. 

Soft Forks

Soft Forks are backward-compatible upgrades where the upgraded nodes can still interact with the older version nodes. In soft forks, the new rules will not clash with the old rules. So, soft forking is quite simple and can be done easily when compared to hard forks.

In a soft fork, the block size can be decreased using the soft-forking. There is a limit in how big the block size can be but there is no limit on how small it can be. If you want to accept blocks below a certain size, then you will have to reject the bigger size blocks.

Doing so will not disconnect you from the network. You can interact with those nodes which do not implement these rules. You will filter only some information that they will pass you.

Example of Soft Fork

The adoption of SegWit is a famous example of Soft Fork. Every 10 minutes, a new block is mined in order to increase the number of transactions that can be included in each block. To do so, the stakeholders of the project developed a solution called Segregated Witness (SegWit). 

The aim was to free up some space in each block to add a bigger number of transactions. It is made possible by removing the public key and the signature associated with each transaction and send them through a separate messaging channel. The public key and the signature occupy 60% of the complete transaction. Hence, by sending them separately, it was possible to double the transactions in each block. 

Hard Forks Vs Soft Forks

CriteriaHard Fork Soft Fork
Functions at the protocol levelFunctions at the network level
ImplementationThe Hash power is irrelevant51% of the mining hash power is required/agreed
Requires an upgrade of nodes, users or exchangesDoes not require an upgrade to nodes, users or exchanges
Network SplitNodes, exchanges, users, and miners will be split from the network if they fail to forkWill not cause any network split. The nodes, exchanges, users, and miners can be sure about their transacting power.

DAO Fund Retrieval
Whether the attacker provides consent or not, the funds will be retrieved fully.Funds can be locked in a contract. If the funds are in the attacker’s child DAO, then it cannot be retrieved.

Future of Forks

Forking is not here to end anytime soon. With the evolvement of the cryptocurrency industry, more and more forking will be seen in the future. Forking will continue in the future to help mass adoption. The main advantage of forking is that it allows everything like new protocols, transaction times, keep mining costs down, and many other benefits. 

Final Thoughts

Both hard forks and soft forks are important for the long-term success of the blockchain network. Even in the decentralized systems, they allow us to make modifications and upgrades to the software. The blockchains and cryptocurrencies can also incorporate new features with the use of forks.