Soft vs. Hard Fork: What’s the Difference and Why Do They Happen?

It is nearly impossible to read about the blockchain without coming across the term “fork.” Forks occur if a consensus cannot occur among the various network participants. Generally, these forks are divided into two main categories: soft or hard. There are also temporary forks, but as the name implies, those do not last long. By contrast, soft and hard forks are permanent.

Reasons for Forks

There are several reasons that a fork can occur, including the previously mentioned inability to agree on the blockchain’s shared state. Additionally, forks may occur to upgrade the network as a way to add functionality. Or they may be a way to change one of the protocols within the blockchain. An example would be increasing the block size for the network. Sometimes, forks occur when there is a disagreement on the way to improve their open-source program. In this case, each group would make their own fork.

Understanding Soft Forks

Soft forks are a way to upgrade the blockchain that is backward-compatible. Think of these as software upgrades that work with the former versions as well. To complete a soft fork, there is no need for network nodes to upgrade as a way to maintain the consensus. Instead, the blocks on the blockchain with the soft fork will follow both the old and the new consensus rules. The important thing is that the nodes that only fit the old consensus rules and not the new ones will typically become stale thanks to the upgrading mining majority.

To help illustrate a soft fork, consider an example. One situation that would result in a soft fork is if the network block size changes. Real-world examples include the soft fork from the Pay to Script Hash that led to multi-sig addresses on Bitcoin’s network and the Bitcoin Improvement Proposal 66 affecting signature validation.

Understanding Hard Forks

Hard forks are permanent diversions from the former blockchain. In this case, the newly introduced consensus rules are not compatible with the previous network. Going back to the software analogy, this would be like an upgrade that is not compatible with the older software. Because of this incompatibility, all participants on the network must adopt the new consensus rules. If a block is confirmed by a node that has not upgraded its protocols, the block will not be valid. In cases where mining support still exists for the resulting minority chain, it is possible for two blockchains to co-exist.

Hard forks are usually either planned or contentious. Planned hard forks were decided in advance, typically with a high level of agreement ahead of time by those involved. One example would be in January 2017 when Monero had a hard fork to add Ring Confidential Transactions. Contentious hard forks involve a severe disagreement among those involved in the project. In most cases, these occur when part of the community wants to improve the blockchain by changing the crypto’s code significantly. One example would be the hard fork for Bitcoin Cash.