Topics Blockchain
Bybit Learn
Bybit Learn
Mar 19, 2021

Explained: What Is a Soft Fork and How Does It Work?

If you’ve got an interest in cryptocurrency, you may have heard of something called ‘forks’. Simply put, a fork is a change in the protocol of a blockchain that has been agreed upon by its participants. 

This can happen for various reasons, and they can be classified into soft forks and hard forks

In this article, we’ll be discussing the concept of a soft fork on a blockchain — how it works, how it is activated, a few examples, and how a soft fork is different from a hard fork.

When it comes to Bitcoin, and indeed other cryptocurrencies, a soft fork occurs when the cryptocurrency chain undergoes a ‘temporary divergence’. A soft fork is a change in the software protocol which causes only previously valid blocks or transactions to become invalid.

With a soft fork, the changes that are made are backward-compatible — meaning old nodes can still add new blocks to the blockchain, as long as they adhere to the new rules. The rules of the blockchain are called the blockchain protocol. 

Let’s discuss and clarify the concept of soft forks in relation to the blockchain protocol.

What Is a Blockchain Protocol?

A blockchain can be defined as a public, distributed ledger, that records transactions on a globally connected network of computers known as nodes. All nodes are equal and connected to one another via the internet. On the network, all participating nodes must verify a transaction before it is added to the blockchain. 

A blockchain generally operates under pre-defined rules known as blockchain protocols, which all participating peers (nodes) in the network agree upon. These rules consist of the following:

  1. Instructions for authenticating and governing transactions on the network
  2. An algorithm defining the mechanism by which all participating nodes on the network will interact with one other
  3. An application programming interface (in certain cases)

So in terms of this protocol, a soft fork is a modification towards the software protocol such that only previously valid transaction blocks are rendered invalid. Since old nodes will recognize the new blocks on the blockchain as valid, a soft fork is regarded as backward-compatible.

Soft forks have often been used as the most common option to upgrade a Bitcoin blockchain since they present a reduced risk of disrupting the network. Moreover, unlike a hard fork, soft forks require only the majority of miners to upgrade in order to impose the new rules.

Sometimes, a soft fork may also occur due to a momentary difference in the blockchain, where miners using non-upgraded nodes infringe a new consensus rule their nodes are not familiar with. If the non-upgraded nodes carry on mining blocks, the latter will be rejected by the upgraded nodes.  

The other type of fork that can occur is known as a hard fork, which is a protocol modification that requires all network nodes to upgrade their software to the latest version in order to keep on participating in the network. Unlike a soft fork, a hard fork prevents the nodes in the upgraded version of the blockchain from accepting the old rules on the blockchain; only new rules are followed. 

Soft Forks vs. Hard Forks

Hard forks and soft forks are similar in that they both change the cryptocurrency platform’s existing code. And while both hard and soft forks are essential to the continued functioning and effective governance of blockchain networks, there are fundamental differences between them.

For starters, a soft fork results in only a single blockchain remaining valid as more and more users shift to using the update. It is essentially a gradual update to the blockchain. However, with a hard fork, the old and new blockchains exist simultaneously, meaning the software must be updated to work under the fresh rules. It is essentially a sudden split to the blockchain. So even though both forks result in a split of sorts, a soft fork maintains one blockchain, while a hard fork results in a blockchain being split into two. 

Hence in this regard, the main difference between a soft fork and a hard fork is how indispensable it is to update node software for continual participation in the network.

Most developers will go for a hard fork when it comes to making a major security update on a blockchain. Even though it involves the exertion of more computing power, a hard fork is seen as being much less risky in this respect. 

Hard forks may be a result of a division in a blockchain’s community, as was the case with the Bitcoin Cash hard fork in 2018. It came about as a result of disagreements in the Bitcoin blockchain community over block size and scalability. In contrast, soft forks can usually be resolved by a mutual agreement and include a more cohesive sentiment in the community of a blockchain. 

How Do Soft Forks Work?

As described in detail in the previous section, a soft fork occurs due to a backward-compatible modification towards the software protocol. As a result, the new forked chain follows the new rules and also honors the old rules. In essence, the original chain continues to follow the old rules.

New transactions are generally supplementary soft forks, which require only the participants (receiver and sender) along with the miners to apprehend the new transaction type. This involves having the new transaction type appear to previous clients (pay-to-anybody transaction) and convincing the miners to reject old blocks, including these transactions, except when the transaction corroborates with the new rules.

For a soft fork to be implemented, most miners need to be running a client recognizing the fork. In short, the more miners adhering to the new rules, the more secure the post-fork network will become. For instance, if ¾ of miners recognize the fork, the remaining ¼ blocks aren’t guaranteed to follow the new rules. They will, however, remain valid to old nodes that remain unaware of the new rules but will be ignored by the new nodes.

As far as upgrades are concerned, soft forks do not need nodes to upgrade for maintaining consensus. This is because all blocks with the fresh soft forked-in rules are also following the previous rules. Hence previous clients accept them. 

However, a hard fork is required to reverse the soft forks. This is because a soft fork only certifies the valid block sets to be a suitable subset of what was valid before the fork. If users upgrade to a post-soft fork client, and later a majority decides to switch back to the pre-soft fork client, the post-soft fork client users would disrupt the blockchain’s harmony the moment a block that did not adhere to their clients’ new rules is introduced.

Why Do Soft Forks Happen?

You’ve probably grasped by now that soft fork is a cosmetic change. It alters or adds functions without actually interfering with the blockchain structure and may occur due to various reasons, such as a change in consensus algorithm or some software changes/upgrades.

When a majority of the miners on a network upgrade use their hashing power to enforce the new rules, this is called a miner-activated soft fork (MASF).

There is also a user-activated soft fork (UASF). This is where full nodes coordinate to enforce the new rules, without the support of miners. 

A soft fork might also occur due to some temporary divergence in the blockchain where miners using non-upgraded nodes infringe a new agreement rule their nodes are not familiar with.

Examples of Soft Forks

Soft forks have been used as the most common option to upgrade Bitcoin blockchains since they are believed to present a lower possibility of splitting the network. Previous examples of successful soft forks include software upgrades such as BIP 66 (dealing with signature validation) and P2SH (alteration in Bitcoin’s address formatting).

  1. BIPs (34, 65, and 66) were installed on the Bitcoin blockchain through miner signaling utilizing the number of block versions. Basically, new consensus rules were proposed for usage in blocks with a higher version number than the prevailing block version already in use on the network. 
  2. P2SH or PAY-TO-SCRIPT-HASH was a patch added to the Bitcoin blockchain in 2012, modifying how it validated transactions. It is most commonly recognized as addresses in Bitcoin, starting with a ‘3’ instead of a ‘1’.
  3. SegWit, or SEGREGATED WITNESS, was a soft fork used to increase Bitcoin transaction speed. Since a new block of transactions is mined every 10 minutes on average, the basic idea was to enhance the number of transactions that could be included in every block. SegWit would free some space in every block that could then be used to include more transactions. This was done by removing the public key from the block, along with the signature associated with each transaction, and sending them via a different messaging channel. Since the public key and the signature occupy almost 60% of the entire transaction size, sending them separately could double the number of transactions in each block. This is why the approach was termed Segregated Witness since the “witness” (signature) was segregated (sent separately) from the transaction.

The Bottom Line

Forks provide a blockchain network the opportunity to upgrade itself while also adding increased features to existing cryptocurrencies, such as scaling functionalities that are equally important for adoption. Soft forks have often been used in Bitcoin blockchains to implement novel and upgraded rules and backward compatible algorithms.

But the challenges lie more in the execution of the fork rather than its principle. Hence, effective governance processes are the key to their implementation.