What are soft fork and hard fork?
What are soft fork and hard fork
Cryptocurrencies like Bitcoin and Ethereum are powered by decentralized open source software called the blockchain. A fork is a change to the blockchain's underlying protocol. A blockchain fork is a significant upgrade to the network and can represent a radical change or a minor change and can be initiated by developers or community members.
It requires machines—node operators connected to the blockchain that help verify transactions on it—to upgrade to the latest version of the protocol. Each node has a copy of the blockchain, ensuring that new transactions do not conflict with its history.
A hard fork is a radical upgrade that can make or break previous transactions and requires all validators on the network to be upgraded to a newer version. It's not backwards compatible. A soft fork is an upgrade to software that is backward compatible and has validators on an older version of the chain, treating the new version as valid.
Effectively, a hard fork often leads to a permanent chain split, as the old version is no longer compatible with the new version. Those who held tokens in the old chain are also given tokens in the new one because they share the same history. Hard forks can happen for several reasons.
What are hard forks? Let's try to understand.
To understand what a hard fork is, it is important to first understand blockchain technology. Blockchain is essentially a chain made of blocks of data that operates as a digital ledger where each new block is valid only after the previous one is confirmed by network validators. Data on the blockchain can be traced back to the first transaction on the network. That's why it's still the first block in the Bitcoin blockchain.
A hard fork is actually a permanent deviation from the latest version of a blockchain, leading to the splitting of the blockchain as some nodes no longer meet the consensus, and two different versions of the network are run separately.
This essentially means that a fork is created in the blockchain where one path continues to follow the existing ruleset, while the second path follows a new set of rules. The hard fork is not backwards compatible, so the old version will not see the new one as valid.
Hard forks are often viewed as dangerous due to the chain splitting that occurs frequently. If a split occurs between the miners who secure the network and the nodes that help verify transactions, the network itself becomes less secure and more vulnerable to attacks.
A common way to take malicious action against a blockchain would be to perform a 51% attack, which is when a cabinet of miners manages to get over 51% of the computing power that secures a network and uses it to alter the history of the blockchain. . Some networks created as a result of hard forks have actually been subject to a 51% multiple attack where bad actors spent the same funds twice. These attacks feature bad actors using their superior computing power on the network to reorder blocks, allowing them to double-spend.
Another vulnerability possible with hard forks is replay attacks. Replay attacks occur when a malicious entity intercepts a transaction on a forked network and replays that data on the other chain. Hard forks without replay protection see both transactions as valid, meaning someone can move funds without checking other users.
What causes hard forks?
If hard forks can greatly reduce the security of a blockchain, why do they happen? The answer is simple: Hard forks are upgrades that are necessary to improve the network as blockchain technology continues to evolve. There can be various reasons behind a hard fork, and not all of them are negative:
Adding functions
Accurate security risks
Resolving conflict in a cryptocurrency's community
Reverse transactions on blockchain
Hard forks can also happen accidentally. Usually, these events resolve quickly and those that are no longer in agreement with the main blockchain retreat and stick to it after realizing what is happening. Similarly, hard forks that add functionality and upgrade the network often allow those who have fallen out of consensus to rejoin the main chain.
Accidental hard forks,
The Bitcoin blockchain has seen many accidental hard forks throughout its history. These are more common than you think and often resolve so quickly that they barely attract attention.
Most accidental hard forks occur when two miners find the same block almost at the same time. As consensus is distributed across the network, both initially see the block as valid and continue mining on different chains before they or another miner adds a subsequent block.
The next block determines which chain becomes longer, meaning the other is abandoned to maintain consensus. Miners move to the longest chain because the abandoned one is no longer profitable to mine Bitcoin, so they will mine a fork of the network.
When these forks occur, the miner who finds the abandoned block loses the token base and transaction fee rewards. However, neither transaction can be invalidated since both blocks found are identical and contain the same transactions.
Other accidental hard forks were part of code issues that led to short-chain splits. For example, in 2013, a block with more total transaction entries than previously seen was mined and published while some nodes did not commit, a leading split. The issue was resolved after some nodes downgraded their software to reach consensus and reject this larger block.
What are the differences between hard forks and soft forks?
Hard forks are not the only way to upgrade software behind a cryptocurrency. Soft forks, by contrast, are seen as a more secure alternative that is backwards compatible, meaning that nodes that have not upgraded to newer versions will still see the chain as valid.
A soft fork can be used to add new features and functionality that does not change the rules a blockchain must follow. Soft forks are often used to implement new features at the programming level.
To better understand the difference between hard forks and soft forks, they can be thought of as a basic operating system upgrade on a mobile device or computer. After the upgrade, all 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 examples of hard forks include:
There are numerous examples of hard forks in the cryptocurrency world, and not all of them happened on the Bitcoin blockchain. Here are some of the most popular hard forks in history and how they impacted the industry.
SegWit2x and Bitcoin Cash
SegWit2x was a proposed upgrade designed to help Bitcoin scale. It is set to implement Segregated Witness (SegWit) and increase the block size limit on the cryptocurrency's network from one MB to two MB.
The implementation of SegWit2x was decided in the controversial New York Agreement reached on May 23, 2017. The deal saw a number of Bitcoin business owners and miners representing more than 85% of the network's hashrate decide the future of BTC behind closed doors.
While SegWit is implemented with a soft fork, the block size limit will be implemented later with a hard fork. The proposal was controversial because Bitcoin did not include any developers behind the main Bitcoin Core codebase, and was seen as a centralizing force — a group of businesses that determined the fate of the network without miners and nodes reaching consensus. The deal comes after years of discussions about scaling Bitcoin.
Small-block proponents argued that larger blocks would make it difficult to host a full node and potentially centralize the cryptocurrency. Supporters of larger blocks argued that BTC's increased transaction fees would hurt its growth and price some users out of the network.
User-activated soft forks are possible on Bitcoin's network. In this scenario, wallet operators, exchanges, and other businesses running full nodes could move to a new version of the blockchain in the future that would have an activation point, forcing miners on a network to fall “in line” and enabling new rules. If they don't, the network may split.
Bitcoin users campaigned for a user-activated soft fork at the time, in response to the closed-door meeting that dictated the future of Bitcoin and to stop a precedent from being established. They called implementation Bitcoin Improvement Proposal (BIP) 148, which attempted to implement SegWit into the Bitcoin network and argued that SegWit2x was a contentious hard fork that made the network vulnerable to replay attacks. It was released in March 2017 and will be implemented on August 1, 2017.
Fearing that the SegWit2x plan would not be fulfilled and community support seeing SegWit down, some major blockchain supporters decided to fork the Bitcoin blockchain on August 1, 2017. The result was the creation of Bitcoin Cash. Its supporters saw the split not as the creation of a rival network, but as a continuation of Satoshi Nakamoto's original vision.
The Bitcoin Cash blockchain was created with an eight MB block size, which has since increased to 32 MB. Bitcoin Cash proponents continue to date believing that low transaction fees will help non-banks scale and BTC will be left behind due to larger transaction fees.
The Bitcoin Cash hard fork saw the possibility of the hard fork coming into the limelight and numerous other Bitcoin forks were created soon after. These include Bitcoin Gold (BTG), Bitcoin Diamond (BTCD) and others.