How to merge bitcoin block chains
Update: After writing this article I have been corrected on Bitcoin forums. It turns out that Bitcoin works as desired and doesn’t lose transactions when the chains are merged. The negative side effect of the way bitcoin function is that any bitcoins generated and later circulated through the network will be lost if the chain they’re in is discarded. This is bad.
In this post we discuss how to merge the block chains to avoid lost transactions.
When networks are disconnected, a fork is created
For Bitcoin to enjoy wider adoption it needs to solve more problems than it creates. One problem is what happens when network connectivity goes down and large chunks of network become disconnected for a long time while still being active. This scenario is easy to imagine because connections go down all the time: an underground cable is severed, network configuration error or a cyber attack come to mind.
Current bitcoin approach is naive and simplistic: longest chain wins. This means that if the network is broken into 2 disjoint sets of nodes, when they reconnect one of the subnetworks is going to lose the blockchain and all transactions recorded. Monetary transactions are reversed while the results of merchant activity cannot be. Disappearing transactions are not a feature of a financial network.
Merging forked chains is easy
Good news. This can easily be solved without much modification to bitcoin infrastructure. No change is needed for the client applications and the structure of transactions, blocks and the block chain don’t need to change from their current state.
Solution is simple: when the network ends up with more than one block chain, take transactions in unique blocks of shorter chains and create a new block with those transactions like nothing happened.
Double Spend is Impossible
Note that this maintains bitcoin’s warranty by not allowing to double spend just like it happens with one chain. This is because when transactions are moved to a new block they are checked for validity in the usual way. This new block is nothing special and behaves by the rules of the network.
Once all unique blocks are processed, the chain is back in one piece and nobody should notice a difference.
An adversary able to use the wallet in both networks can double spend until the networks are joined together again. At that time the double spend transactions in smaller chains will always be discarded. This suggests that there is a possibility of transactions being annulled with merchants suffering the loss. Current state of bitcoin doesn’t solve this problem either. This needs to be approached from other angles.
Click here to view the image explaining this concept.
If this article has made a light bulb go on inside your head and you enjoy the feeling, please donate a small amount to keep the energy flowing: 1PuRm9XmbN2JmzTCEeAPVd8x8w9kMaZKSg