获取Tangem

Soft Fork vs Hard Fork: Definition and Differences

fork_193.png

Cryptocurrencies like Bitcoin (BTC)and Ethereum (ETH), valued at $1,547, operate on a decentralized open-source platform known as a blockchain. A blockchain fork denotes a modification to the blockchain's underlying protocol, ranging from a substantial alteration to a minor adjustment. Either developers or members of the community can initiate this change.

This process requires node operators, machines connected to the blockchain responsible for validating transactions, to update to the most recent protocol version. Each node maintains a copy of the blockchain and ensures that new transactions align with its historical data.

Types of forks

Forks are divided into hard forks and soft forks depending on the scale of the modification of the blockchain protocol.

  • A hard fork is a significant alteration of a blockchain's algorithms and code, which results in either a completely new version of the blockchain or blockchain splitting into two separate networks. Hard forks are often used to launch new crypto-projects (cryptocurrencies).
     
  • A soft fork is a minor change of a blockchain protocol that results in two parallel versions of the protocol, meaning that all blockchain nodes operate on the same network, but some of them under the old rules and some under the new ones.  
     
fork_194.png

A hard fork signifies a significant upgrade that may render previous transactions and blocks either valid or invalid. It mandates all validators in the network to switch to a newer version and is not compatible with earlier versions. On the other hand, a soft fork is a compatible software upgrade, allowing validators using an older chain version to view the new version as valid.

In practice, a hard fork frequently leads to a permanent division in the chain, as the old version is no longer compatible with the new one. Holders of tokens on the previous chain receive tokens on the new chain due to their shared history. There can be various motivations behind the occurrence of hard forks.

Understanding hard forks

It's crucial to have a solid understanding of blockchain technology before grasping the concept of a hard fork. A blockchain functions as a linked sequence of data blocks, acting as a digital ledger. Each new block is only considered valid once the preceding one has received confirmation from network validators. This means you can trace all data on the blockchain back to the first transaction ever made on the network. This is why the initial block on the Bitcoin blockchain remains visible.

A hard fork marks a permanent split from the latest version of a blockchain. This leads to a divergence in the blockchain, as certain nodes no longer align in consensus, resulting in two distinct versions of the network operating independently.

In practical terms, this creates a fork in the blockchain where one path adheres to its existing set of rules while the second path follows a new set of rules. Notably, a hard fork lacks backward compatibility, rendering the old version incompatible with the new one.

Hard forks are often viewed as risky due to the potential for a chain split. If a division arises between the miners responsible for securing the network and the nodes that validate transactions, the network's overall security diminishes, making it more susceptible to attacks.

Hard forks and 51% Attacks

One standard method for maliciously targeting a blockchain is a 51% attack. This attack occurs when a group of miners amasses over 51% of the computing power that safeguards a network, enabling them to manipulate the blockchain's history. 

In some cases, networks resulting from hard forks have experienced multiple 51% attacks, where malicious actors exploit their superior computational power to reorganize blocks, facilitating double-spending.

Another vulnerability associated with hard forks is the potential for replay attacks. These occur when a malicious entity intercepts a transaction on a forked network and duplicates that data on the alternate chain. In hard forks lacking replay attack protection, both transactions are validated, allowing an individual to move another user's funds without their control.
 

Why do hard forks happen?

Why do hard forks happen despite their potential security risks to a blockchain? The answer lies in their essential role as upgrades to enhance the network's performance in response to the evolving landscape of blockchain technology. There are various motivations behind a hard fork, and not all of them carry negative implications:

  • Introducing new features
     
  • Addressing security vulnerabilities
     
  • Resolving disagreements within a cryptocurrency's community
     
  • Reversing transactions on the blockchain

It's worth noting that accidental hard forks can occur. Typically, these situations are promptly resolved, with dissenting parties realigning with the main blockchain once they recognize the issue. Additionally, hard forks focused on adding functionalities and upgrading the network provide a pathway for those who initially deviated from consensus to rejoin the main chain."

Accidental hard forks

The Bitcoin blockchain has experienced numerous inadvertent hard forks over its history. These occurrences are more frequent than one might assume and are often resolved so swiftly that they garner little attention.

Typically, accidental hard forks occur when two miners discover the same block at nearly the same time. Since consensus on the network is decentralized, both initially regard the block as valid and continue mining on separate chains until either they or another miner adds a subsequent block. 

This next block determines which chain extends further, resulting in the abandonment of the other to uphold consensus. Miners shift their focus to the longer chain, as the forsaken one is no longer profitable for Bitcoin mining; they would essentially be mining a divergent version of the network.

During these fork incidents, the miner who uncovered the forsaken block forfeits the transaction rewards. However, no transactions are nullified, as both blocks contain identical transactions.

Other accidental hard forks stemmed from coding issues that led to short-lived chain divisions. In 2013, for instance, a block with an unusually high number of total transaction inputs was mined and broadcasted, while certain nodes failed to process it, resulting in a split. The problem was resolved after some nodes downgraded their software to establish consensus and reject this oversized block.

Participants in a hard fork

Generally, a hard fork results from prolonged discussions leading to a consensus in the blockchain project community. Initially, a proposal is put forward, finalized, tested, and finally implemented.
When an update is crucial and affects not only technical changes but, for example, changes in the tokenomics of a cryptocurrency project, the discussion can go beyond the blockchain development community.

For example, the Ethereum blockchain has an entire system to improve the network (Ethereum Improvement Proposal).

To activate a hard fork, you need to write a new programming code, but most participants must also agree. Besides blockchain developers, network validators are also participating. After all, it is up to them to make the blockchain work, and if they disagree with the developers' proposed update, they simply will not migrate their compute nodes to it.  

It is essential to understand that the blockchain protocol cannot be changed without community consent, as it is the decentralized network and the software layer.

Blockchain projects resulting from hard forks

If most blockchain project participants agree with the update, the network follows the new protocol. But without unanimous consent, some nodes move to the latest version of the blockchain, while others work according to the old rules. The result is that the blockchain splits into two chains.

The most significant hard forks are Bitcoin Cash, Ethereum Classic, and Merge.

What is a soft fork?

A soft fork is a backward-compatible upgrade, meaning the upgraded nodes can still communicate with the non-upgraded ones.

Backward compatibility ensures that new nodes can recognize old transactions. Complying with the new protocol requires only some validators to be updated, but not all nodes, as in a hard fork.  

To put it simply: a soft fork is an improvement of the blockchain's performance, with the old and new protocols functioning harmoniously in the same network.

Soft forks do not result in the separation of the blockchain into autonomous networks, the release of new coins, or any other fundamental changes.  
Soft forks intend to solve the following issues:

  • Increasing network performance
     
  • lowering commission fees
     
  • Increasing blockchain privacy
     
  • Improving security.

Soft forks improve various properties of cryptocurrencies, eliminate bugs in the code, and stimulate competition. The famous soft forks are SegWit (Bitcoin soft fork designed to increase block size to enhance throughput rate), Pay to Script Hash (P2SH; soft fork designed to change Bitcoin addresses format), Replace-by-fee (Litecoin soft fork designed to edit transactions to change commission level).

Difference between hard forks and soft forks

Hard forks represent just one method of upgrading the underlying software of a cryptocurrency. In contrast, soft forks are viewed as a more secure alternative that maintains backward compatibility. This means that nodes that don't transition to newer versions will still consider the chain as valid.

A soft fork enables adding fresh features and functionalities without altering a blockchain's fundamental rules. Typically, soft forks are employed to implement new features at a programming level.

To illustrate the disparity between hard forks and soft forks, it's akin to a basic operating system update on a mobile device or computer. Following the upgrade, all applications on the device will still function seamlessly with the updated operating system. In contrast, a hard fork means a complete transition to an entirely new operating system.
 

Notable hard fork examples

Throughout the history of cryptocurrencies, there have been many instances of hard forks, and these haven't been limited solely to the Bitcoin blockchain. Below, we'll explore some prominent cases of hard forks and examine their impact on the industry.


SegWit2x and Bitcoin Cash

SegWit2x was a proposed upgrade aimed at enhancing Bitcoin's scalability. It intended to incorporate Segregated Witness (SegWit) and double the block size limit from one MB to two MB on the cryptocurrency's network.

The decision to implement SegWit2x was made during the contentious New York Agreement on May 23, 2017. This agreement involved Bitcoin owners and miners consisting of 85% of the network's hash rate, determining BTC's future in private discussions.

SegWit was slated for implementation via a soft fork, while a subsequent hard fork will adjust the block size limit. The proposal sparked controversy because it excluded any developer from Bitcoin's primary codebase, Bitcoin Core. It was considered a centralizing influence, where a consortium of businesses determined the network's fate without obtaining consensus from miners and nodes. This agreement followed years of debate on how to scale Bitcoin.

Advocates for smaller blocks contended that larger blocks could make hosting a full node more challenging, potentially centralizing the cryptocurrency. Supporters of larger blocks argued that rising transaction fees in BTC could hinder its growth and exclude some users from the network.

On Bitcoin's network, user-activated soft forks were conceivable. In this scenario, entities like wallet operators, exchanges, and other businesses running full nodes could transition to a new version of the blockchain with an activation point in the future. This would compel network miners to comply and enact the new rules. Failure to do so could result in a network split.

At that time, Bitcoin users rallied for a user-activated soft fork in response to the behind-closed-doors decision-making regarding Bitcoin's future, aiming to prevent such a precedent from being set. They advocated for adopting the Bitcoin Improvement Proposal (BIP) 148, which sought to introduce SegWit on the Bitcoin network. It argued that SegWit2x represented a contentious hard fork that made the network susceptible to replay attacks. BIP 148 was introduced in March 2017 and was slated for implementation on August 1, 2017.

In fear that the SegWit2x plan might not come to fruition and observing the community's backing of SegWit, some proponents of larger blocks chose to 'fork' the Bitcoin blockchain on August 1, 2017— leading to the emergence of Bitcoin Cash (BCH).

Its proponents did not view the split as creating a competing network but rather as a continuation of Satoshi Nakamoto's original vision.

The Bitcoin Cash blockchain was established with an eight MB block size, which has since grown to 32 MB. To this day, supporters of Bitcoin Cash maintain that its low transaction fees will enable it to scale and serve the unbanked, asserting that BTC will lag due to its higher fees.

The Bitcoin Cash hard fork brought the possibility of a hard fork into prominence, subsequently leading to the creation of numerous other Bitcoin forks, including Bitcoin Gold (BTG), Bitcoin Diamond (BTCD), and others.
 

The 2016 DAO hack and the emergence of ETC

In 2016, a significant historical event in the blockchain world was the emergence of the decentralized autonomous organization (DAO) on the Ethereum network. Ethereum operates using smart contracts, essentially pieces of code that automatically execute when specific conditions are met. These contracts enable programmable transactions and underpin decentralized finance applications (DApps).

At that time, the DAO managed to raise $150 million worth of ETH, marking one of the earliest instances of crowdfunding in the crypto space, predating the ICO frenzy of 2017. It served as an early version of the decentralized governance models that DeFi protocols currently employ, where token holders participate in decisions about the protocol's future.

Unfortunately, shortly after its launch, the DAO fell victim to a hack, losing $60 million worth of ETH from 11,000 investors. Since Ethereum was trading at less than $10 then, this hack represented roughly 14% of all circulating Ether. This incident severely shook confidence in the network.

The Ethereum community was thrust into a debate as they grappled with how to respond to the attack. Initially, Ethereum's founder, Vitalik Buterin, proposed a soft fork to blacklist the attacker's address, preventing them from moving the funds.

The attacker, or someone claiming to be them, countered the community's response by arguing that the funds had been obtained "legally" and per the smart contract's rules. They even threatened legal action against anyone attempting to seize the funds. Tensions escalated further as the attacker indicated intentions to influence ETH miners through bribery, thwarting soft fork attempts.

The debate persisted until a hard fork was suggested. Ultimately, the hard fork was executed, effectively rolling back the Ethereum network's history to a point before the DAO attack and redirecting the stolen funds to a smart contract, allowing investors to reclaim their assets.

This decision was met with considerable controversy. Some viewed it as compromising the blockchain's censorship resistance and immutability, as they saw it as a bailout for investors. Those who held this perspective rejected the hard fork and rallied behind an earlier network version, now recognized as Ethereum Classic (ETC).

Hashrate Wars: Bitcoin Cash ABC vs. SV


Bitcoin Cash emerged due to a contentious split from the original Bitcoin blockchain, a hard fork. However, this division led to two separate networks due to disagreements within the Bitcoin Cash community.

On one side, Bitcoin Cash ABC (BCHA) was a development team focused on enhancing the technology underlying the cryptocurrency. On the opposing side was Bitcoin Cash SV (BSV), backed by self-proclaimed "Satoshi Nakamoto" Craig Wright, which aimed to increase the block size from 32 MB to 128 MB.

The pivotal moment came at block 556,767 when the blockchain was divided into two distinct entities, triggering fierce competition for the BCH ticker symbol. Miners on both sides mobilized all available resources to gain a hashing power advantage. Some even advocated for a 51% attack on the rival network, intending to reorganize its blocks and compel its supporters to switch sides.

Cryptocurrency exchanges and businesses intended to assign the BCH ticker to the victorious blockchain. Certain mining pools redirected their entire resources to the so-called "hash wars," ultimately resulting in Bitcoin Cash ABC securing most of the hashing power and thwarting any attempts at a 51% attack. This victory allowed Bitcoin Cash ABC to claim the BCH ticker on exchanges and various services while the opposing network adopted BSV as its ticker.