Hard Fork vs Soft Fork
von Satoshi Nakamoto
Last updated: 16 March, 2018
Forks, or the threat of them, seem to be an established feature of the cryptocurrency landscape. But what are they? Why are they such a big deal? And what is the difference between a hard fork and a soft fork?
A "fork," in programming terms, is an open-source code modification. Usually the forked code is similar to the original, but with important modifications, and the two "prongs" comfortably co-exist. Sometimes a fork is used to test a process, but with cryptocurrencies, it is more often used to implement a fundamental change, or to create a new asset with similar (but not equal) characteristics as the original.
Not all forks are intentional. With a widely distributed open-source codebase, a fork can happen accidentally when not all nodes are replicating the same information. Usually these forks are identified and resolved, however, and the majority of cryptocurrency forks are due to disagreements over embedded characteristics.
One thing to bear in mind with forks is that they have a "shared history." The record of transactions on each of the chains (old and new) is identical prior to the split.
Hard forks
There are two main types of programming fork: hard and soft.
A hard fork is a change to a protocol that renders older versions invalid. If older versions continue running, they will end up with a different protocol and with different data than the newer version. This can lead to significant confusion and possible error.
With bitcoin, a hard fork would be necessary to change defining parameters such as the block size, the difficulty of the cryptographic puzzle that needs to be solved, limits to additional information that can be added, etc. A change to any of these rules would cause blocks to be accepted by the new protocol but rejected by older versions and could lead to serious problems – possibly even a loss of funds.
For instance, if the block size limit were to be increased from 1MB to 4MB, a 2MB block would be accepted by nodes running the new version, but rejected by nodes running the older version.
Let's say that this 2MB block is validated by an updated node and added on to the blockchain. What if the next block is validated by a node running an older version of the protocol? It will try to add its block to the blockchain, but it will detect that the latest block is not valid. So, it will ignore that block and attach its new validation to the previous one. Suddenly you have two blockchains, one with both older and newer version blocks, and another with only older version blocks. Which chain grows faster will depend on which nodes get the next blocks validated, and there could end up being additional splits. It is feasible that the two (or more) chains could grow in parallel indefinitely.
This is a hard fork, and it's potentially messy. It's also risky, as it's possible that bitcoins spent in a new block could then be spent again on an old block (since merchants, wallets and users running the previous code would not detect the spending on the new code, which they deem invalid).
The only solution is for one branch to be abandoned in favor of the other, which involves some miners losing out (the transactions themselves would not be lost, they'd just be re-allocated). Or, all nodes would need to switch to the newer version at the same time, which is difficult to achieve in a decentralized, widely spread system.
Or, bitcoin splits, which has happened (hello, bitcoin cash).
Soft fork
A soft fork can still work with older versions.
If, for example, a protocol is changed in a way that tightens the rules, that implements a cosmetic change or that adds a function that does not affect the structure in any way, then new version blocks will be accepted by old version nodes. Not the other way around, though: the newer, "tighter" version would reject old version blocks.
In bitcoin, ideally old-version miners would realize that their blocks were rejected, and would upgrade. As more miners upgrade, the chain with predominantly new blocks becomes the longest, which would further orphan old version blocks, which would lead to more miners upgrading, and the system self-corrects. Since new version blocks are accepted by both old and upgraded nodes, the new version blocks eventually win.
For instance, say the community decided to reduce the block size to 0.5MB from the current limit of 1MB. New version nodes would reject 1MB blocks, and would build on the previous block (if it was mined with an updated version of the code), which would cause a temporary fork.
This is a soft fork, and it's already happened several times. Initially, Bitcoin didn't have a block size limit. Introducing the limit of 1MB was done through a soft fork, since the new rule was "stricter" than the old one. The pay-to-script-hash function, which enhances the code without changing the structure, was also successfully added through a soft fork. This type of amendment generally requires only the majority of miners to upgrade, which makes it more feasible and less disruptive.
Soft forks do not carry the double-spend risk that plagues hard forks, since merchants and users running old nodes will read both new and old version blocks.
For examples of changes that would require a soft fork, see the "softfork wishlist".
Authored by Noelle Acheson; Fork image via Shutterstock. Source coindesk
NEXT: WHAT IS THE DIFFERENCE BETWEEN LITECOIN AND BITCOIN?
INDEX: A BEGINNERS GUIDE TO BITCOIN AND BLOCKCHAIN TECHNOLOGY
What is Bitcoin?
It’s a decentralized digital currency
Why Use Bitcoin?
It’s fast, cheap to use, and secure
How Can I Buy Bitcoin?
From an exchange or an individual
How to Buy Bitcoin in the UK
Buying bitcoin in the UK
How to Store Your Bitcoin
Use a digital or paper wallet
What Can You Buy with Bitcoin?
Spend your bitcoins
How to Sell Bitcoin
A guide on how to sell your bitcoins
How to Accept Bitcoin Payments for Your Store
Learn about bitcoin POS systems
How do Bitcoin Transactions Work?
Bitcoin addresses and private keys
Is Bitcoin Legal?
The current regulation around bitcoin
Who is Satoshi Nakamoto?
The founder of bitcoin
How Bitcoin Mining Works
By confirming transactions
How to Set Up a Bitcoin Miner
Generate bitcoins yourself
What are Bitcoin Mining Pools?
What are pools how and how to join them?
How Does Cloud Mining Bitcoin Work?
Alternative bitcoin mining solutions
How to Calculate Mining Profitability
Can you make a ROI?
How to Make a Paper Bitcoin Wallet
Creating an unhackable bitcoin wallet
Can Bitcoin Scale?
A look at the debate and the tech
What is SegWit?
A new way of storing transaction data
What is the Lightning Network?
Off-chain transaction channels
What is Bitcoin Cash?
Same blockchain, different characteristics.
Hard Fork vs Soft Fork
Why and how do blockchains split?
What is the Difference Between Litecoin and Bitcoin?
It’s the silver to bitcoin’s gold
How to Buy Litecoin
How to buy the bitcoin alternative litecoin
How to Mine Litecoin and other Altcoins
How to generate your own altcoins
Understanding Bitcoin Price Charts
A primer on bitcoin price charts
Bitcoin E-Commerce Services for Merchants
How to accept bitcoin at your business
What is Blockchain Technology?
A system of distributed data and logic
How Does Blockchain Technology Work?
Cryptographic keys, distributed networks and network servicing protocols
What Can a Blockchain Do?
Identity, recordkeeping, smart contracts and more
What is a Distributed Ledger?
A dynamic, independently maintained database
What is the Difference Between Public and Permissioned Blockchains?
Can anyone read or write to the ledger?
What is the Difference Between a Blockchain and a Database?
It begins with architectural and administrative decisions
What Are the Applications and Use Cases of Blockchains?
Tokenization, auditing, governance, settlement and more
How Could Blockchain Technology Change Finance?
Cross-border payments, new asset classes, regulatory compliance and more
What are Blockchain’s Issues and Limitations?
Complexity, size, costs, speed, security, politics and more
Why Use a Blockchain?
To manage and secure digital relationships as part of a system of record
What is Ethereum?
A blockchain application platform and ‘world computer’
What is Ether?
The ‘fuel’ of the ethereum network
How to Use Ethereum
Wallets, trading and ‘dapps’
Who Created Ethereum?
Vitalik Buterin
How Ethereum Mining Works
‘Proof of Work’ and ‘Proof of Stake’
How to Mine Ethereum
GPUs, mining software and pools
How Ethereum Works
‘Turing-complete’ programming, ‘state’ and the ‘EVM’
What is a Decentralized Application?
A distributed ‘smart contract’ system
What is a DAO?
A ‘decentralized autonomous organization’
How Do Ethereum Smart Contracts Work?
Code, transaction fees and ‘gas’
How Will Ethereum Scale?
‘Sharding’ and ‘off-chain’ transactions
What is an ICO?
Initial Coin Offerings refer to the distribution of digital tokens.
Read the full article
Forks, or the threat of them, seem to be an established feature of the cryptocurrency landscape. But what are they? Why are they such a big deal? And what is the difference between a hard fork and a soft fork?
A "fork," in programming terms, is an open-source code modification. Usually the forked code is similar to the original, but with important modifications, and the two "prongs" comfortably co-exist. Sometimes a fork is used to test a process, but with cryptocurrencies, it is more often used to implement a fundamental change, or to create a new asset with similar (but not equal) characteristics as the original.
Not all forks are intentional. With a widely distributed open-source codebase, a fork can happen accidentally when not all nodes are replicating the same information. Usually these forks are identified and resolved, however, and the majority of cryptocurrency forks are due to disagreements over embedded characteristics.
One thing to bear in mind with forks is that they have a "shared history." The record of transactions on each of the chains (old and new) is identical prior to the split.
Hard forks
There are two main types of programming fork: hard and soft.
A hard fork is a change to a protocol that renders older versions invalid. If older versions continue running, they will end up with a different protocol and with different data than the newer version. This can lead to significant confusion and possible error.
With bitcoin, a hard fork would be necessary to change defining parameters such as the block size, the difficulty of the cryptographic puzzle that needs to be solved, limits to additional information that can be added, etc. A change to any of these rules would cause blocks to be accepted by the new protocol but rejected by older versions and could lead to serious problems – possibly even a loss of funds.
For instance, if the block size limit were to be increased from 1MB to 4MB, a 2MB block would be accepted by nodes running the new version, but rejected by nodes running the older version.
Let's say that this 2MB block is validated by an updated node and added on to the blockchain. What if the next block is validated by a node running an older version of the protocol? It will try to add its block to the blockchain, but it will detect that the latest block is not valid. So, it will ignore that block and attach its new validation to the previous one. Suddenly you have two blockchains, one with both older and newer version blocks, and another with only older version blocks. Which chain grows faster will depend on which nodes get the next blocks validated, and there could end up being additional splits. It is feasible that the two (or more) chains could grow in parallel indefinitely.
This is a hard fork, and it's potentially messy. It's also risky, as it's possible that bitcoins spent in a new block could then be spent again on an old block (since merchants, wallets and users running the previous code would not detect the spending on the new code, which they deem invalid).
The only solution is for one branch to be abandoned in favor of the other, which involves some miners losing out (the transactions themselves would not be lost, they'd just be re-allocated). Or, all nodes would need to switch to the newer version at the same time, which is difficult to achieve in a decentralized, widely spread system.
Or, bitcoin splits, which has happened (hello, bitcoin cash).
Soft fork
A soft fork can still work with older versions.
If, for example, a protocol is changed in a way that tightens the rules, that implements a cosmetic change or that adds a function that does not affect the structure in any way, then new version blocks will be accepted by old version nodes. Not the other way around, though: the newer, "tighter" version would reject old version blocks.
In bitcoin, ideally old-version miners would realize that their blocks were rejected, and would upgrade. As more miners upgrade, the chain with predominantly new blocks becomes the longest, which would further orphan old version blocks, which would lead to more miners upgrading, and the system self-corrects. Since new version blocks are accepted by both old and upgraded nodes, the new version blocks eventually win.
For instance, say the community decided to reduce the block size to 0.5MB from the current limit of 1MB. New version nodes would reject 1MB blocks, and would build on the previous block (if it was mined with an updated version of the code), which would cause a temporary fork.
This is a soft fork, and it's already happened several times. Initially, Bitcoin didn't have a block size limit. Introducing the limit of 1MB was done through a soft fork, since the new rule was "stricter" than the old one. The pay-to-script-hash function, which enhances the code without changing the structure, was also successfully added through a soft fork. This type of amendment generally requires only the majority of miners to upgrade, which makes it more feasible and less disruptive.
Soft forks do not carry the double-spend risk that plagues hard forks, since merchants and users running old nodes will read both new and old version blocks.
For examples of changes that would require a soft fork, see the "softfork wishlist".
Authored by Noelle Acheson; Fork image via Shutterstock. Source coindesk
NEXT: WHAT IS THE DIFFERENCE BETWEEN LITECOIN AND BITCOIN?
INDEX: A BEGINNERS GUIDE TO BITCOIN AND BLOCKCHAIN TECHNOLOGY
What is Bitcoin?
It’s a decentralized digital currency
Why Use Bitcoin?
It’s fast, cheap to use, and secure
How Can I Buy Bitcoin?
From an exchange or an individual
How to Buy Bitcoin in the UK
Buying bitcoin in the UK
How to Store Your Bitcoin
Use a digital or paper wallet
What Can You Buy with Bitcoin?
Spend your bitcoins
How to Sell Bitcoin
A guide on how to sell your bitcoins
How to Accept Bitcoin Payments for Your Store
Learn about bitcoin POS systems
How do Bitcoin Transactions Work?
Bitcoin addresses and private keys
Is Bitcoin Legal?
The current regulation around bitcoin
Who is Satoshi Nakamoto?
The founder of bitcoin
How Bitcoin Mining Works
By confirming transactions
How to Set Up a Bitcoin Miner
Generate bitcoins yourself
What are Bitcoin Mining Pools?
What are pools how and how to join them?
How Does Cloud Mining Bitcoin Work?
Alternative bitcoin mining solutions
How to Calculate Mining Profitability
Can you make a ROI?
How to Make a Paper Bitcoin Wallet
Creating an unhackable bitcoin wallet
Can Bitcoin Scale?
A look at the debate and the tech
What is SegWit?
A new way of storing transaction data
What is the Lightning Network?
Off-chain transaction channels
What is Bitcoin Cash?
Same blockchain, different characteristics.
Hard Fork vs Soft Fork
Why and how do blockchains split?
What is the Difference Between Litecoin and Bitcoin?
It’s the silver to bitcoin’s gold
How to Buy Litecoin
How to buy the bitcoin alternative litecoin
How to Mine Litecoin and other Altcoins
How to generate your own altcoins
Understanding Bitcoin Price Charts
A primer on bitcoin price charts
Bitcoin E-Commerce Services for Merchants
How to accept bitcoin at your business
What is Blockchain Technology?
A system of distributed data and logic
How Does Blockchain Technology Work?
Cryptographic keys, distributed networks and network servicing protocols
What Can a Blockchain Do?
Identity, recordkeeping, smart contracts and more
What is a Distributed Ledger?
A dynamic, independently maintained database
What is the Difference Between Public and Permissioned Blockchains?
Can anyone read or write to the ledger?
What is the Difference Between a Blockchain and a Database?
It begins with architectural and administrative decisions
What Are the Applications and Use Cases of Blockchains?
Tokenization, auditing, governance, settlement and more
How Could Blockchain Technology Change Finance?
Cross-border payments, new asset classes, regulatory compliance and more
What are Blockchain’s Issues and Limitations?
Complexity, size, costs, speed, security, politics and more
Why Use a Blockchain?
To manage and secure digital relationships as part of a system of record
What is Ethereum?
A blockchain application platform and ‘world computer’
What is Ether?
The ‘fuel’ of the ethereum network
How to Use Ethereum
Wallets, trading and ‘dapps’
Who Created Ethereum?
Vitalik Buterin
How Ethereum Mining Works
‘Proof of Work’ and ‘Proof of Stake’
How to Mine Ethereum
GPUs, mining software and pools
How Ethereum Works
‘Turing-complete’ programming, ‘state’ and the ‘EVM’
What is a Decentralized Application?
A distributed ‘smart contract’ system
What is a DAO?
A ‘decentralized autonomous organization’
How Do Ethereum Smart Contracts Work?
Code, transaction fees and ‘gas’
How Will Ethereum Scale?
‘Sharding’ and ‘off-chain’ transactions
What is an ICO?
Initial Coin Offerings refer to the distribution of digital tokens.
Read the full article
Satoshi Nakamoto
Keine Verbindung
Verbindung wird wiederhergestellt
Etwas ist schiefgelaufen
Wir sind gleich wieder da