Soft fork vs. hard fork: Differences explained
Cryptocurrencies like Bitcoin (BTC) and Ethereum (ETH) are powered by a decentralized open-source software called a blockchain. A fork is a change to the blockchain’s underlying protocol. A blockchain fork is an important upgrade to the network and can either represent a radical change or a minor one and can be initiated by developers or community members.
It requires node operators — machines connected to the blockchain that help validate transactions on it — to upgrade to the latest version of the protocol. Every node has a copy of the blockchain and ensures new transactions do not contradict its history.
A hard fork is a radical upgrade that can make previous transactions and blocks either valid or invalid and requires all validators in a network to upgrade to a newer version. It’s not backward-compatible. A soft fork is an upgrade to the software that is backward-compatible and has validators in an older version of the chain see the new version as valid.
Effectively, a hard fork, more often than not, leads to a permanent chain separation, as the old version is no longer compatible with the new version. Those holding tokens on the old chain are granted tokens on the new one as well because they share the same history. Hard forks can happen for a number of reasons.
Understanding hard forks
To understand what a hard fork is, it’s essential to first understand blockchain technology. A blockchain is essentially a chain made out of blocks of data that work as a digital ledger in which each new block is only valid after the previous one has been confirmed by the network validators. Data on the blockchain can be traced all the way back to the first-ever transaction on the network. This is why we can still see the first block on the Bitcoin blockchain.
A hard fork is essentially a permanent divergence from a blockchain’s latest version, leading to a separation of the blockchain, as some nodes no longer meet consensus, and two different versions of the network are run separately.
This essentially means that a fork is created on the blockchain where one path keeps following its current set of rules, while the second path follows a new set of rules. A hard fork is not backward compatible, so the old version no longer sees the new one as valid.
Hard forks are often seen as dangerous because of the chain split that often occurs. If a split occurs between the miners who secure the network and the nodes that help validate transactions, the network itself becomes less secure and more vulnerable to attacks.
A common way to undertake malicious action against a blockchain would be to perform a 51% attack, which is when a cabal of miners manages to have over 51% of the computing power that secures a network and use it to alter the blockchain’s history. Some networks created as a result of hard forks have, in fact, suffered numerous 51% attacks where bad actors double-spent the same funds. These attacks have bad actors leveraging their superior computing power in the network to reorganize blocks, allowing them to double-spend.
Another vulnerability that’s possible with hard forks is replay attacks. Replay attacks occur when a malicious entity intercepts a transaction on a forked network and repeats that data on the other chain. Hard forks without replay attack protection see both transactions become valid, meaning someone can move another users’ funds without controlling them.
Why do hard forks happen?
If hard forks can drastically reduce the security of a blockchain, why do they happen at all? The answer is simple: Hard forks are upgrades that are necessary to improve the network as blockchain technology continues to evolve. Several reasons can be behind a hard fork, and not all of them negative:
- Add functionality
- Correct security risks
- Resolve a disagreement within a cryptocurrency’s community
- Reverse transactions on the blockchain
Hard forks can also happen by accident. Often, these incidents are swiftly resolved and those that were no longer in consensus with the main blockchain fall back and adhere to it after realizing what had happened. Similarly, hard forks adding functionalities and upgrading the network usually allow those who fall out of consensus rejoin the main chain.
Accidental hard forks
The Bitcoin blockchain has seen many accidental hard forks throughout its history. These are more common than one would think and are often resolved so quickly that they are barely noteworthy.
Most accidental hard forks occur whenever two miners find the same block at nearly the same time. As consensus on the network is distributed, both initially see the block as valid and keep mining on different chains before they or another miner adds a subsequent block.
That subsequent block dictates which chain becomes the longer one, meaning that the other is abandoned to maintain consensus. Miners move on to the longest chain since the abandoned one is no longer be profitable for mining Bitcoin on, as they would be mining a fork of the network.
When these forks happen, the miner who found the abandoned block loses coinbase and transaction fee rewards. However, no transactions would be invalidated as both blocks found were identical and contained the same transactions.
Other accidental hard forks were part of code issues that led to short-chain splits. In 2013, for example, a block with a larger number of total transaction inputs than previously seen was mined and broadcasted, while some nodes did not process it, leading to a split. The issue was resolved after some nodes downgraded their software to reach consensus and reject this larger block.
Difference between hard forks and soft forks
Hard forks are not the only way to upgrade the software behind a cryptocurrency. Soft forks are, by contrast, seen as a safer alternative that is backward compatible, which means that nodes that do not upgrade to newer versions will still see the chain as valid.
A soft fork can be used to add new features and functions that do not change the rules a blockchain must follow. Soft forks are often used to implement new features at a programming level.
To better understand the difference between hard forks and soft forks, it can be thought of as a basic operating system upgrade on a mobile device or a computer. After the upgrade, all the applications on the device will still work with the new version of the operating system. A hard fork, in this scenario, would be a complete change to a new operating system.
Notable hard fork examples
There are numerous historical examples of hard forks in the cryptocurrency world and not all of them happened with the Bitcoin blockchain. Here are some of the most popular hard forks in history and how they influenced the industry.
SegWit2x and Bitcoin Cash
SegWit2x was a proposed upgrade designed to help Bitcoin scale. It was set to implement Segregated Witness (SegWit) and increase the block size limit from one MB to two MB on the cryptocurrency’s network.
The implementation of SegWit2x was decided in the controversial New York Agreement reached on May 23, 2017. The agreement saw that a number of Bitcoin business owners and miners representing over 85% of the network’s hash rate decided the future of BTC behind closed doors.
SegWit would be implemented through a soft fork, while the block size limit would be implemented through a hard fork later on. The proposal was controversial because it did not include any developer behind the main codebase of Bitcoin, Bitcoin Core, and was seen as a centralizing force — a group of businesses deciding the fate of the network without miners and nodes reaching consensus. The agreement came after years of debate on scaling Bitcoin.
Small block proponents argued that larger blocks would make it harder to host a full node, potentially centralizing the cryptocurrency. Those who supported larger blocks argued that BTC’s rising transaction fees would harm its growth and price some users out of the network.
On Bitcoin’s network, user-activated soft forks are possible. In this scenario, wallet operators, exchanges and other businesses running full nodes can move to a new version of the blockchain that will have an activation point in the future, forcing miners on a network to “fall in line” and activate the new rules. If they don’t, the network could end up splitting.
Bitcoin users campaigned for a user-activated soft fork at the time, in response to the closed-door meeting dictating the future of Bitcoin and to stop a precedent from being set. They called for implementing the Bitcoin Improvement Proposal (BIP) 148, which sought to implement SegWit on the Bitcoin network and argued that SegWit2x was a contentious hard fork that made the network vulnerable to a replay attack. It was released in March 2017 and was set to be implemented on August 1, 2017.
Fearing that the SegWit2x plan would not be fulfilled and seeing the community support SegWit, some big-block supporters decided to fork the Bitcoin blockchain on August 1, 2017. The result was the creation of Bitcoin Cash (BCH). Its supporters did not see the split as the creation of a rival network, but rather as the continuation of Satoshi Nakamoto’s original vision.
The Bitcoin Cash blockchain was created with an eight MB block size that has since increased to 32 MB. To this day, Bitcoin Cash supporters maintain that its low transaction fees will help it scale and bank the unbanked, believing BTC will be left behind because of its larger transaction fees.
The Bitcoin Cash hard fork saw the possibility of a hard fork enter the limelight, and shortly after, numerous other Bitcoin forks were created. These include Bitcoin Gold (BTG), Bitcoin Diamond (BTCD) and others.
The DAO Hack
Another major historical hard fork was associated with the decentralized autonomous organization (DAO) that was launched in 2016 on the Ethereum network. Ethereum runs a set of smart contracts, which are essentially chunks of code that automatically execute whenever a set of criteria has been met. These contracts make money programmable and are behind decentralized finance applications (DApps).
At the time, the DAO raised $150 million worth of ETH in one of the earliest crowdfunding efforts in crypto, before the initial coin offering (ICO) craze of 2017. It was essentially an early iteration of the decentralized governance models DeFi protocols use, wherein token holders vote on the future of the protocol.
After its launch, the DAO was hacked for $60 million worth of ETH from 11,000 investors. At the time, Ethereum was trading below $10, so around 14% of all circulating Ether was invested in the DAO, and the hack was a major blow to confidence in the network.
A debate within the Ethereum community ensued, as everyone scrambled to figure out how to respond to the attack. Initially, Ethereum founder Vitalik Buterin proposed a soft fork that would blacklist the attacker’s address and prevent them from moving the funds.
The attacker, or someone posing as them – responded to the community claiming the funds had been obtained in a “legal” way and in accordance to the smart contract’s rules. They claimed they were ready to take legal action against anyone who tried to seize the funds. Tensions rose as the attacker said they would thwart soft fork attempts by bribing ETH miners with the funds.
Debate once again ensued until a hard fork was proposed. The hard fork was ultimately implemented and it rolled back the Ethereum network’s history to before the DAO attack occurred, reallocating the stolen funds to a smart contract where investors could withdraw their funds.
The move was extremely controversial, and in the eyes of some, affected the blockchain’s censorship resistance and immutability: Investors were, in their eyes, being bailed out. Those who saw things this way rejected the hard fork and supported an earlier version of the network, now known as Ethereum Classic (ETC).
Hashrate Wars: ABC vs. SV
Bitcoin Cash was created through a hard fork of the Bitcoin blockchain in August 2017, and would later split into two networks as groups within its community feuded. On one side, there was Bitcoin Cash ABC (BCHA), a development team trying to improve the technology behind it. On the other side, there was Bitcoin Cash SV (BSV), a team supported by self-proclaimed “Satoshi Nakamoto” Craig Wright, trying to raise the block size from 32 MB to 128 MB.
At block 556,767, the blockchain split in two, and the battle for the BCH ticker symbol began. Miners on both sides deployed every resource they could to have a hash-rate advantage over the other. Many were calling for a 51% attack on the other network to reorganize its blocks, so its proponents would be forced to move to their side.
Cryptocurrency exchanges and other businesses revealed that they would attribute the BCH ticker to the blockchain that came out on top. Some mining pools diverted all of their resources to the hash wars, with Bitcoin Cash ABC ultimately having majority of the hash rate and fending off any 51% attack attempts. It later claimed the BCH ticker on exchanges and other services, with the other network choosing BSV as its ticker.