Fork it up!

A Straight Line

Today’s topic really touches on the way blockchain participants come to consensus on when a set of transactions (a “block”) becomes “truth” and gets essentially cast in concrete as an immutable record on that blockchain.

Think of a blockchain as just that – a more or less straight set of links in a chain, where each link is a “block” of transactions in a given blockchain network (e.g. Bitcoin, Ethereum) and where a consensus of participants in that network (or “nodes” for our purposes here) have come to agreement that: “yeah, that block is valid according to the validation rules of that particular blockchain, so go ahead and forge that link on the chain.

When you Come to a fork in the Road, Take it

However, there are conditions where a blockchain can diverge into two chains going forward.  Broadly speaking there are three types of such forks.

Business As Usual

Sidebar:miner nodes” on a blockchain are incented to identify valid blocks of transactions submitted on their blockchain network and get consensus from a majority of all nodes that “their block” should be the next link on the chain.

Now, the first type of “fork” is perfectly normal – and occurs because two or more mining nodes have solved a puzzle (or performed some other “work”) to get their “block” on the blockchain at virtually the same time, creating 2 or more possible paths that the particular blockchain can take.

Over time (and we’re talking seconds here), one of those “paths” will increase in length as other miners choose one of the “fork paths” and build upon it with subsequent candidate “blocks”.  The shortest fork will eventually be orphaned and forgotten, and processing will proceed on the longest fork. This is why some folks (like merchants accepting Bitcoins) say that if you post a transaction on a blockchain, and the block containing your transaction  has 6 blocks or more built on top of it – you are GOOD – there’s an EXTREMELY low chance that you are on an “orphaned fork”.

Hard Choice

The other two types of forks are known as “hard” and “soft” forks.  In a hard fork, the blockchain software on computers in that blockchain network (“nodes”) is upgraded by at least some of the nodes, such that “old nodes” will judge blocks from the “new nodes” to be invalid.  If the “old nodes” are stubborn and will not upgrade, voila – a fork.  The most famous example of this was the hard fork in the Ethereum blockchain – leading to the new Ethereum fork and “Ethereum Classic” (like Coke and Coke Classic in the ’80s).

Soft Touch

In a “soft fork”, again you have a situation where some nodes have upgraded their blockchain software.  In THIS case, however, one or more of the rules for that particular blockchain have been constricted by the new software (we say that a “soft fork” is backwardly compatible with previous transactions in that blockchain).

Say that the “new nodes” now will validate transactions that are only up to 1 MB in length – whereas under the “old rules” transactions could be 2 MB in length.  The “old nodes” will validate any of the blocks from the “new nodes” – but if those “old nodes” try to MINE their own blocks – they could be rejected.  The issue in all of this: if the “new nodes” who mine blocks are a minority in that blockchain network, then eventually their “new fork” will be orphaned – BECAUSE those “new nodes” are a minority compared to the majority of “old node” miners.

The Good, Bad, and Ugly

So basically blockchain forks are a natural byproduct of the consensus method used, and are also a way to “upgrade” a particular blockchain’s rule.  Both good and bad things can happen – the most notorious “bad thing” was the Ethereum episode mentioned above. On the flip side, a well managed fork can allow a blockchain to evolve and improve without compromising the validity of past transactions.

Leave a Reply

Your email address will not be published. Required fields are marked *