Guide to Bitcoin mining
If you have been paying attention to bitcoin at all lately, you may have noticed a lot of talk going on about 'forks'.
Not like the kind you would find on a table, on a blockchain, a fork is a technical event that occurs because diverse participants need to agree on common rules.
At its most basic, a fork is what happens when a blockchain diverges into two potential paths forward — either with regard to a network’s transaction history or a new rule in deciding what makes a transaction valid.
As a result, those who use the blockchain have to show support for one choice over the other.
Yet, there are many different types of forks, and the science of studying them is still new. So far, we know some forks resolve on their own, but others, fueled by deep rifts in a community, can cause a network to permanently split, creating two blockchain histories — and two separate currencies.
Along with that, there has also been confusion about the various types of forks, how they get activated and the risks they pose.
To clarify, we've assembled quick rundown on how different forks work.
The basics
Before we get into the classifications, it's worth noting that bitcoin forks already occur quite regularly.
A byproduct of distributed consensus, forks happen anytime two miners find a block at nearly the same time. The ambiguity is resolved when subsequent blocks are added to one, making it the longest chain, while the other block gets "orphaned" (or abandoned) by the network.
But forks also can be willingly introduced to the network. This occurs when developers seek to change the rules the software uses to decide whether a transaction is valid or not.
When a block contains invalid transactions, that block is ignored by the network, and the miner who found that block loses out on a block reward. As such, miners generally want to mine only valid blocks and build on the longest chain.
Following are some of the more common forks and their traits.
Hard fork
What is it? A hard fork is a software upgrade that introduces a new rule to the network that isn't compatible with the older software. You can think of a hard fork as an expansion of the rules. (A new rule that allows block size to be 2MB instead of 1MB would require a hard fork).
What happens? Nodes that continue running the old version of the software will see the new transactions as invalid. So, to switch over to the new chain and to continue to mine valid blocks, all of the nodes in the network need to upgrade to the new rules.
What can go wrong? The problem comes when some sort of political impasse arises, and a portion of the community decides to stick by the old rules no matter what. The hash rate, or network computing power, behind the old chain is irrelevant. What matters is that its data (and ruleset) is still perceived to have value, meaning miners still want to mine a chain and developers still want to support it.
The ethereum DAO hard fork was a perfect case study of how a community can split over rules. Now, we have two blockchains using a variant of the software – ethereum and ethereum classic, both of which boast a different ethos and a different currency.
Soft fork
What is it? A soft fork, by contrast, is any change that's backward compatible. Say, instead of 1MB blocks, a new rule might only allow 500K blocks.
What happens? Non-upgraded nodes will still see the new transactions as valid (500k is less than 1MB in this example). However, if non-upgraded nodes continue to mine blocks, the blocks they mine will be rejected by the upgraded nodes. This is why soft forks need a majority of hash power in the network.
What can go wrong? When a soft fork is supported by only a minority of hash power in the network, it could become the shortest chain and get orphaned by the network. Or, it can act like a hard fork, and one chain can splinter off.