A soft fork is a backward-compatible update to the previous version of the software that introduces a change leading to a tightening of the protocol rules.
When addressing the topic of updates to Bitcoin’s consensus rules, it is necessary to understand the concepts of soft fork and hard fork to grasp the differences between the two types of updates. First and foremost, it is crucial to clarify what is meant by a fork.
What is a fork?
The Bitcoin blockchain is, among other things, a distributed database across thousands of computers called nodes. Each node verifies and stores all blockchain information in its storage space. Information between nodes is disseminated through the gossip protocol and does not reach the entire network simultaneously. Each peer receives the data, verifies it, and forwards it to neighboring peers, resulting in a temporal latency in information reception among all nodes, dictated by the physical limits of the Internet.
Let’s imagine we are at block number 3, as shown in the image. When a miner finds a solution to the Proof-of-Work and sends the next block to neighboring peers, they receive it before other nodes. Now, imagine that simultaneously with the first miner, another miner finds a valid solution and transmits their block to nearby nodes. In such an event, two distinct blocks spread across the network, both potentially valid. Nodes closest to the first miner’s node receive block 4a first, while those closest to the second miner’s node receive block 4b first.
After a short time, nodes close to the first miner also receive block 4b, while nodes close to the second miner receive block 4a. Thus, all network peers find themselves with two potentially valid versions of block 4. The first ones consider block 4a valid for the moment but do not discard block 4b; they keep it linked to block 3 in a blockchain that appears forked. This creates what is defined as a fork. Nodes that received block 4b first behave similarly, considering it valid and keeping block 4a in a forked chain.
At this point, miners who deem block 4a valid start searching for the Proof-of-Work solution for the next block, block 5a. Other miners try to find block 5b.
Let’s assume a miner who had considered block 4b valid finds a solution. The node spreads its candidate block 5b to the rest of the network: all nodes that had considered block 4b valid see that the next block is compatible with the chain and simply add it to their main blockchain. Nodes that had considered block 4a valid note that 5b is not compatible with the main chain but with block 4b they had kept in a forked chain. They face two chains, one with an additional block than the other.
Which chain is considered valid? As stated in the Bitcoin White Paper, “Nodes always consider the longest chain as correct and will continue to work to extend it.” In this case, the valid chain is the one that reaches block 5b, as it is longer and has accumulated more computational work. Nodes that had considered block 4a valid discard it, consider the correct chain the one containing blocks 4b and 5b, and start searching for a Proof-of-Work solution for block 6b.
What is a soft fork?
The operation just described often occurs in the Bitcoin network: it is a technical fork that, in the majority of cases, is resolved within one block. What happens when one wants to modify a consensus rule of the protocol?
When rules are tightened, meaning previously considered valid elements are subsequently considered invalid, the changes are compatible with versions of the old software. This happens because non-upgraded nodes continue to approve what they approved before, unaware that upgraded nodes are forwarding blocks with stricter parameters than theirs.
In essence, to be compatible with the future, transactions and blocks created with the new rules must also be valid according to the old rules, but not the other way around, as the past history is already established.
Soft fork types
There are two types of soft forks:
- Miner Activated Soft Fork (MASF): in this case, the majority of miners execute the upgrade to apply the new rules;
- User-Activated Soft Fork (UASF): here, nodes execute the upgrade without the support of miners.
It’s important to note that a soft fork is not a fork in the traditional sense; there is no chain separation in a soft fork.
However, implementing a soft fork is a delicate operation. Since it introduces additional consensus constraints by tightening the rules, a soft fork is an irreversible change—once implemented, there’s no going back.
Two well-known soft forks in the history of Bitcoin are SegWit and Taproot.