Blockchain Technology
and
Cryptocurrency: Bitcoin Fork
Ashok Kumar Turuk
1
Bitcoin forks
Bitcoin is an open source project that A fork changes the definition of
can be forked just like any other open a valid blockchain.
source project, such as Linux.
In the Bitcoin context, the term fork forks in Bitcoin is categorized as
means a change in the consensus rules. follows:
The consensus rules define what a valid Hard fork
blockchain is. Soft fork
When some set of nodes uses the same
consensus rules, consensus emerges
among them about what the current
unspent transaction output (UTXO) set
—“who owns what”—is.
2
Bitcoin forks
Hard forks: A hard fork relaxes the
consensus rules.
Some blocks that are considered invalid
by nodes running the old version of the
software program will be considered valid
by nodes running the new version.
Doubling the maximum allowed block
weight.
Soft forks tighten the consensus rules,
whereas hard forks widen them—for
example, decreasing the maximum block
weight or increasing it, respectively
3
Bitcoin forks
Soft forks: A soft fork tightens the
consensus rules.
All blocks that nodes running the new
version of the program consider valid
will also be considered valid by those
running the old version.
But some blocks considered valid by
nodes running the old version will be
considered invalid by those running Soft forks tighten the consensus rules,
the new version. whereas hard forks widen them—for
Reducing the maximum allowed example, decreasing the maximum block
block weight. weight or increasing it, respectively
4
Hard forks
New blocks, created by New
nodes, might be rejected by
Old nodes
When your New node mines a
new block, it might get
rejected by the Old nodes,
depending on whether it’s ≤
4,000,000 WU.
Suppose a majority of the
hashrate likes your Bitcoin New Your node running Bitcoin New is a loser against the
program and starts using it Bitcoin Old nodes. Bitcoin Old will discard all of your
blocks that violate the ≤ 4,000,000 WU rule.
instead of Bitcoin Old. What
happens then?
5
Hard forks
When a New node mines a big
block, all New nodes will try to
extend that block, but all Old
nodes will keep on trying to
extend the latest— valid,
according to Old rules—block.
New nodes have apparently
created a lasting chain split
A majority of the hashrate runs Bitcoin New. It
seems to have caused a permanent chain split..
6
Hard forks
But if some miners decide to
go back to running Bitcoin Old,
or if additional miners enter
the race using Old nodes so
that Old gets a majority of the
hashrate again, the New chain
might face problems
The branch created by the New
nodes was wiped out by a
chain reorganization, The Bitcoin New chain is wiped out because the
commonly known as a reorg. Bitcoin Old chain becomes stronger
7
Wipeout protection
• A change that isn’t wipeout-protected To protect against Bitcoin New being
by nature is an alternative wiped out in a reorg, Bitcoin Cash
cryptocurrency called Bitcoin Cash. added wipeout protection by requiring
Bitcoin Cash was created through a the first block of the split to be bigger
hard fork of Bitcoin Core at block than 1,000,000 bytes
height 478559 on 1 August 2017. Bitcoin New nodes cannot move back
Bitcoin Cash increased the maximum to the Bitcoin Old branch because that
base block size and remove segwit branch has a block less than or equal
from the code. to 1 MB at height 478559.
Old chain is compatible with New
nodes and vulnerable to wipeout.
8
Wipeout protection
Bitcoin Cash protects against wipeout by requiring the
first block after the chain split to be >1 MB.
9
Soft forks
A non-segwit miner could include in
its block a transaction that spends a
segwit output as if it were an
anyone-can-spend output
An Old miner regards a segwit output as anyone-
can-spend and adds to the block a transaction
that spends it as such
10
Soft forks
The soft fork might cause a chain split if the
Bitcoin Old nodes produce a block that Bitcoin
New miners don’t accept.
11
Soft forks
As people adopt Bitcoin New, the branch will cause a reorg
for Old nodes
12
Transaction replay
The effect of chain split is same
irrespective of its causes
Users end up with two versions of
their UTXO:
One spendable on the Old chain, and
One spendable on the New chain.
Effectively the system have two
cryptocurrencies, Bitcoin Old and
Bitcoin New
After a chain split, you effectively have two
versions of your UTXOs.
13
Transaction replay
• Your transaction to the bookstore is valid on both the Bitcoin
Old and the Bitcoin New branches
14
Transaction replay
Transaction replay causes you to pay in both currencies
15
Replay protection
To protect users against replay
during a chain split due to a hard
fork, the transaction format on the
New chain can be changed in such a
way that the transaction is valid on
at most one branch.
Bitcoin Cash chain split, made it
sure Old transactions weren’t valid
on New nodes and New
transactions weren’t valid on Old
nodes
A transaction on the New branch
must use a new SIGHASH type, With replay protection, a transaction is valid on only
FORKID, in transaction signatures one of the branches
16