{"id":3698,"date":"2022-12-15T14:13:44","date_gmt":"2022-12-15T14:13:44","guid":{"rendered":"https:\/\/metaschool.so\/articles\/?p=3698"},"modified":"2023-01-03T12:27:22","modified_gmt":"2023-01-03T12:27:22","slug":"what-is-a-fork-in-blockchain","status":"publish","type":"post","link":"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/","title":{"rendered":"What is a fork in blockchain?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_56_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Whats_forking\" title=\"What&#8217;s forking?\">What&#8217;s forking?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Why_forking_occurs_in_a_blockchain\" title=\"Why forking occurs in a blockchain\">Why forking occurs in a blockchain<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#1_To_implement_new_features_or_upgrades\" title=\"1. To implement new features or upgrades\">1. To implement new features or upgrades<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#2_To_reverse_transactions\" title=\"2. To reverse transactions\">2. To reverse transactions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#3_To_resolve_disputes\" title=\"3. To resolve disputes\">3. To resolve disputes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#4_To_address_technical_issues\" title=\"4. To address technical issues\">4. To address technical issues<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Advantages_of_forking\" title=\"Advantages of forking\">Advantages of forking<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#1_Allows_for_the_implementation_of_new_features_and_upgrades\" title=\"1. Allows for the implementation of new features and upgrades\">1. Allows for the implementation of new features and upgrades<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#2_May_reverse_transactions_or_undo_mistakes\" title=\"2. May reverse transactions or undo mistakes\">2. May reverse transactions or undo mistakes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#3_Can_address_technical_issues_and_bugs\" title=\"3. Can address technical issues and bugs\">3. Can address technical issues and bugs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#4_Can_resolve_disputes_within_the_community\" title=\"4. Can resolve disputes within the community\">4. Can resolve disputes within the community<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Types_of_forks_in_blockchain\" title=\"Types of forks in blockchain\">Types of forks in blockchain<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Accidental_forks\" title=\"Accidental forks \">Accidental forks <\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#Intentional_forks\" title=\"Intentional forks\">Intentional forks<\/a><ul class='ez-toc-list-level-4'><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#1_Hard_forks\" title=\"1. Hard forks\">1. Hard forks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/metaschool.so\/articles\/what-is-a-fork-in-blockchain\/#2_Soft_forks\" title=\"2. Soft forks\">2. Soft forks<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>If wondering what is a fork in a blockchain has got you in a bit of a confusion, we&#8217;ve gotchu. Forks out \ud83c\udf74<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-s-forking\"><span class=\"ez-toc-section\" id=\"Whats_forking\"><\/span>What&#8217;s forking?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Forking is where the state of the blockchain diverges into two different paths. This can happen when there is a change to the network&#8217;s consensus rules, or when there is a disagreement among the nodes in the network about the valid state of the blockchain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-forking-occurs-in-a-blockchain\"><span class=\"ez-toc-section\" id=\"Why_forking_occurs_in_a_blockchain\"><\/span>Why forking occurs in a blockchain<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are several reasons why a fork might occur in a blockchain. Some common reasons include:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-to-implement-new-features-or-upgrades\"><span class=\"ez-toc-section\" id=\"1_To_implement_new_features_or_upgrades\"><\/span>1. To implement new features or upgrades<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>One of the main reasons for forking a blockchain is to introduce new features or upgrades that are not compatible with the existing version of the blockchain. For example, a new version of a blockchain might introduce support for <a href=\"https:\/\/metaschool.so\/courses\/writing-your-first-hello-world-contract-in-solidity?ref=Articles&amp;utm_source=Blog_Organic\" target=\"_blank\" rel=\"noreferrer noopener\">smart contracts<\/a>, or it might increase the maximum block size to allow for more transactions per block.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-to-reverse-transactions\"><span class=\"ez-toc-section\" id=\"2_To_reverse_transactions\"><\/span>2. To reverse transactions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In some cases, a fork might be used to reverse transactions that have already been recorded on the blockchain. This can happen if a transaction is found to be fraudulent or if it is discovered that the transaction was made in error.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-to-resolve-disputes\"><span class=\"ez-toc-section\" id=\"3_To_resolve_disputes\"><\/span>3. To resolve disputes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In some cases, a fork can be used as a way to resolve disputes within a blockchain community. For example, if there is a disagreement over how the blockchain should be governed, or over the direction in which the blockchain should be developed, a fork might be used to create two separate versions of the blockchain, each with its own set of rules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-to-address-technical-issues\"><span class=\"ez-toc-section\" id=\"4_To_address_technical_issues\"><\/span>4. To address technical issues<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A fork can also be used to address technical issues with a blockchain, such as bugs or vulnerabilities in the software. For example, a fork might be used to fix a bug that is causing the blockchain to produce invalid blocks.<\/p>\n\n\n\n<p>Overall, the reasons for forking a blockchain can vary depending on the specific needs and goals of the blockchain community. However, in general, forking is a way for a blockchain to evolve and adapt to changing circumstances.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advantages-of-forking\"><span class=\"ez-toc-section\" id=\"Advantages_of_forking\"><\/span>Advantages of forking<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Forking a blockchain can provide several advantages that can help to improve the functionality and security of the blockchain, and can help to ensure that it continues to evolve and remain relevant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-allows-for-the-implementation-of-new-features-and-upgrades\"><span class=\"ez-toc-section\" id=\"1_Allows_for_the_implementation_of_new_features_and_upgrades\"><\/span>1. Allows for the implementation of new features and upgrades<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Forking a blockchain allows for the implementation of new features and upgrades that are not possible with the existing version of the blockchain. This can help to keep the blockchain up-to-date and relevant, and can make it more useful and valuable to its users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-may-reverse-transactions-or-undo-mistakes\"><span class=\"ez-toc-section\" id=\"2_May_reverse_transactions_or_undo_mistakes\"><\/span>2. May reverse transactions or undo mistakes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In some cases, a fork can be used to reverse transactions or undo mistakes that have been recorded on the blockchain. This can be useful in situations where a transaction is found to be fraudulent or was made in error, and can help to maintain the integrity and security of the blockchain.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-can-address-technical-issues-and-bugs\"><span class=\"ez-toc-section\" id=\"3_Can_address_technical_issues_and_bugs\"><\/span>3. Can address technical issues and bugs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A fork can also be used to address technical issues and bugs that are affecting the blockchain. For example, a fork might be used to fix a bug that is causing the blockchain to produce invalid blocks, or to address a vulnerability that could be exploited by attackers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-can-resolve-disputes-within-the-community\"><span class=\"ez-toc-section\" id=\"4_Can_resolve_disputes_within_the_community\"><\/span>4. Can resolve disputes within the community<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A fork can be used as a way to resolve disputes within the blockchain community. For example, if there is a disagreement over how the blockchain should be governed, or over the direction in which the blockchain should be developed, a fork can create two separate versions of the blockchain, each with its own set of rules.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"types-of-forks-in-blockchain\"><span class=\"ez-toc-section\" id=\"Types_of_forks_in_blockchain\"><\/span>Types of forks in blockchain<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"accidental-forks\"><span class=\"ez-toc-section\" id=\"Accidental_forks\"><\/span>Accidental forks <span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>An accidental fork can occur when there is a technical issue with the blockchain network, such as a bug in the software or a problem with the network itself. In this case, the blockchain can split into two different versions, with each version following its own set of rules. This can lead to confusion and uncertainty, as it is not clear which version of the blockchain is the correct one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"intentional-forks\"><span class=\"ez-toc-section\" id=\"Intentional_forks\"><\/span>Intentional forks<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>An intentional fork, on the other hand, is a planned event that occurs when the members of a <a href=\"https:\/\/metaschool.so\/blockchains\" target=\"_blank\" rel=\"noreferrer noopener\">blockchain network<\/a> agree to create a new version of the blockchain with different rules. This can happen for a variety of reasons, such as to implement new features or to reverse transactions. Intentional forks are typically planned in advance and are carried out in a way that minimizes disruption to the network.<\/p>\n\n\n\n<p>Furthermore, there are two known types of intentional forks in a blockchain. Hard forks, which create two separate and incompatible networks, and soft forks, which are temporary divergences that can eventually be resolved. Hard forks and soft forks can happen for different reasons, such as changes to the network&#8217;s consensus rules or disagreements among nodes about the valid state of the blockchain<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-hard-forks\"><span class=\"ez-toc-section\" id=\"1_Hard_forks\"><\/span>1. Hard forks<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>A hard fork is a permanent divergence in the blockchain, which creates two separate networks that can no longer be compatible. This happens when the network&#8217;s consensus rules are changed in a way that is not backwards-compatible, meaning that nodes that do not upgrade to the new rules will no longer be able to validate new blocks or transactions.<\/p>\n\n\n\n<p>For example, let&#8217;s say that a blockchain network has a rule that allows transactions to be included in a block if they have a minimum fee of 1 unit of the network&#8217;s native cryptocurrency. If the network decides to change this rule to require a minimum fee of 2 units, a hard fork will occur. Nodes that continue to follow the old rule will see the new transactions as invalid, and will reject them. This will create two different versions of the blockchain, one that follows the old rule and one that follows the new rule.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-soft-forks\"><span class=\"ez-toc-section\" id=\"2_Soft_forks\"><\/span>2. Soft forks<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>A soft fork, on the other hand, is a temporary divergence in the blockchain that can eventually be resolved. This happens when the network&#8217;s <a href=\"https:\/\/www.bitstamp.net\/learn\/security\/what-are-blockchain-consensus-rules\/\" target=\"_blank\" rel=\"noopener\">consensus rules<\/a> are changed in a way that is backwards-compatible, meaning that nodes that do not upgrade to the new rules can still validate new blocks and transactions.<\/p>\n\n\n\n<p>For example, let&#8217;s say that a blockchain network has a rule that allows transactions to be included in a block if they have a signature from the sender&#8217;s private key. If the network decides to add a new rule that requires transactions to have an additional signature from the sender&#8217;s device, a soft fork will occur. Nodes that continue to follow the old rule will see the new transactions as valid, because they have a signature from the sender&#8217;s private key. However, nodes that upgrade to the new rule will only accept transactions that have both signatures.<\/p>\n\n\n\n<p>Over time, if most of the nodes in the network upgrade to the new rule, the network will eventually reach consensus on the valid state of the blockchain, and the soft fork will be resolved. This means that the network will continue with the new rule, and the old rule will no longer be valid.<\/p>\n\n\n\n<p><strong>Finally<\/strong>,<\/p>\n\n\n\n<p>In both cases, forks can have significant implications for the blockchain and its users. It is important for those involved with a blockchain to carefully consider the potential consequences of any forks, whether accidental or intentional.<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":3704,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[292],"tags":[51,36],"class_list":["post-3698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-answers","tag-blockchain","tag-blockchain-applications"],"_links":{"self":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/3698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/comments?post=3698"}],"version-history":[{"count":3,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/3698\/revisions"}],"predecessor-version":[{"id":4263,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/3698\/revisions\/4263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media\/3704"}],"wp:attachment":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media?parent=3698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/categories?post=3698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/tags?post=3698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}