I had this idea ever since the qubic selfish mining attack and finally brought myself to formulate it.
The basic premise of it is, in case of a chain fork, instead of dropping/reorging the chain in favor of the longest one, splice both chains up in a way that preserves tx history, avoids double spends and maintains tail emission schedule without causing too much disturbance to the network. This protocol would safeguard chain integrity against selfish mining/reorg attacks like the one by qubic, but also in case of an accidental network partition, for example in case of tor nodes loosing connection to the clearnet nodes or certain geographical location getting disconnected from the rest of the internet.
Here it is:
If a node observes an alternate chain longer than 10 blocks within a 100 block window, it assumes a network partition has occurred and enters a merge state. If the alternate chain falls beyond the 100 block window, it is orphaned as usual.
While in merge state:
- No new transactions are accepted. Only transactions already present on the competing chain are included.
- Every block mined on the competing chain must be recreated with all of it's transactions on the other chain, excluding conflicting transactions.
The merge ends when a chain has recreated all missing blocks from the other chain minus conflicting transactions and mines a new block. That chain becomes the main chain. Specifically:
- Conflicting transactions (double-spends, coinbase) from the winning chain are finalized.
- Conflicting transactions from the losing chain are discarded.
- All non-conflicting transactions from the losing chain are now part of the main chain.
Two distinct guarantees cover all double-spend angles:
- Conflicts created before detection: resolved by the winner-takes-all rule above.
- Conflicts attempted after detection: impossible, because the freeze blocks all new transactions until the merge completes. An attacker cannot double-spend on either chain after the partition is revealed.
The chain that accumulated more work during the partition has more blocks already and therefore fewer missing blocks to absorb which gives it an advantage in the race. However, miners who have already mined blocks on their current chain would forfeit their rewards by switching to the other chain. This creates a commitment effect: the chain with more long-term hashrate is more likely to win even if it is temporarily shorter, because a one-time hashrate burst (selfish mining, a rented burst, a lucky streak) would have to overcome the sunk cost of miners who have already committed work to the other side, but even if it doesn't, most of the transactions from the loosing chain remain finalized.
The merge window is limited by the number of missing blocks. For a 30 block partition, the merge takes another 30 blocks of partial liveness. The system remains safe throughout, only new transactions are delayed.