Blockchain Semantics Insights
Business Case | Deep Tech | Announcements | Blockchain Glossary |
What is forking and types of forking in Blockchain?Jan. 10, 2018, 11:22 a.m. GMT
Forking implies any divergence in Blockchain- temporary or permanent. Very simply, forking is said to happen when a Blockchain splits into two branches. It can happen as a result of a change in consensus algorithm or other software changes. Depending on the nature of change, the fork can be categorized into Hard Fork and Soft Fork. Keep calm and read below!
A hard fork is a permanent divergence from the previous version of the Blockchain, and nodes running previous versions will no longer be accepted by the newest version. A hard fork is a radical change to the protocol that makes previously valid blocks or transactions invalid. Any transaction on the forked (newer) chain will not be valid on the older chain. All nodes and miners will have to upgrade to the latest version of the protocol software if they wish to be on the new forked chain. This essentially creates a fork in the Blockchain, one path which follows the new, upgraded Blockchain, and one path which continues along the old path.
Hard Fork is usually done only when there is enough support from the mining community. Only when the majority of miners give positive signal towards the upgrade or fork, the developers of the chain starts work on the upgraded code. Typically, the support should come from 90 to 95 percent of the miners.
A soft fork is said to happen when a change to the software protocol keeps it backward compatible. What this means is that the new forked chain will follow the new rules and will also honor the old rules. The original chain will continue to follow the old rules. This kind of fork requires only a majority of the miners upgrading to enforce the new rules, as opposed to a hard fork which requires (almost) all nodes to upgrade and agree on the new version.
New transaction types can often be added as soft forks, requiring only that the participants for e.g. sender and receiver and miners understand the new transaction type. This is done by having the new transaction appear to older clients as a "pay-to-anybody" transaction (of a special form) and getting the miners to agree to reject blocks including this transaction unless the transaction validates under the new rules. This is how to pay to script hash (P2SH) was added to Bitcoin.
A soft fork can also occur at times due to a temporary divergence in the Blockchain when miners using non-upgraded nodes violate a new consensus rule their nodes don’t know about.
To learn more about how are the Hard fork and Soft fork implemented, why Blockchains are forked and which Blockchains have implemented forking, please visit Blockchain and Bitcoin Certification by Blockchain Semantics.