The End of Life (EOL) scenario for a sidechain is very interesting. This means that the sidechain is about to die. There are a couple scenarios where a sidechain can die

It could be because there was a catastrophic failure on a sidechain The sidechain was such a success and proved the viability of an idea so that idea will be merged in to bitcoin itself no one cared about the feature set so no one is using the sidechain.

In any case, when this scenario occurs it is imperative that the sidechain to bitcoin transfer mechanism (side-to-main peg) is the strongest when the EOL scenario is happening.

The goal of a side-to-main peg is to provide a trustless way to redeem sidechain tokens for bitcoin. This requires the custodian of the bitcoin on the bitcoin blockchain to credit the correct person withdrawing from the sidechain. For more information read my blog post here.

A market for s:bitcoin (sidechain:bitcoin) to m:bitcoin (mainchain:bitcoin)

Paul Sztorc has this passage on his drivechain.info site.

The lengthy multi-month delay might sound prohibitively inconvenient, but it isn’t because of instant atomic cross-chain swaps. Investment-banker-types will buy your side-BTC with their main-BTC, at competitive rates. So, in practice, the delay can be avoided by paying a neglibible, market-based fee.

Paul believes, and I agree with him, that the withdrawal process should be a long arduous process. Just like how you should wait for 6+ confirmations on the bitcoin blockchain, you should have to wait for many confirmations on a s:block before you determine a withdrawal transaction (WT) from a sidechain is valid.

I believe in the case of a EOL scenario s:miners (sidechain:miners) will want to accumulate s:bitcoin at anything less than a 1:1 ratio. Since s:miners eventually determine the validity of a WT (in proof of mainstake any way), they are the only party that can “control their own destiny” when withdrawing from a sidechain.

This means that if the market for m:bitcoin to s:bitcoin is 0.9:1 a s:miner can profit 0.1 (the spread) m:bitcoin for every s:bitcoin he can purchase on the open market. That profit is not realized immediately though, as he is being given 0.1 s:bitcoin which he still needs to withdraw from the sidechain.

This allows non s:miners to exit the sidechain in a safe way. Assuming there is a large enough set of s:miners, the market rate for s:bitcoin to m:bitcoin should be very competitive. In proof of mainstake the only requirement to mine a sidechain is bitcoin holdings.

S:miners (sidechain miners) exiting the sidechain

As long as there is a competitive mining market, it should be easy for non s:miners to exit the sidechain at a competitive rate. The next question is how will s:miners themselves exit the sidechain?

The easy answer is the same process can happen as I stated above. Some s:miners pay other s:miners a small spread to withdraw their holdings from the sidechain.

However s:miners can act maliciously and try to widen the spread between m:bitcoin and s:bitcoin. ZmnSCPxj has an interesting email about this on the bitcoin-dev list. The relevant part is this:

Suppose that there are three mining pools: A with 34%, B with 33%, C with 32%, and the hoi polloi making up the remaining 1%. Those three pools cannot safely let the others withdraw funds.



Suppose A colludes with C to join their withdrawal proposals and their hashpower to withdraw. This means that B can be pressured to sell its sidecoins for a discount to the joint coalition of A and C, since B cannot withdraw its own coins. This lowers the profitability of B, causing grinders to leave them in favor of either A or C. Since A is slightly larger than C, it is slightly more preferable, so it grows in size slightly more than C does. Eventually B dies due to the coalition of A and C. A and C are the only remaining pools, with A slightly larger than C. In this case, A can break from the coalition and squeeze C of its sidecoins, since only A can withdraw (as it has more hashpower than C). Again, grinders will leave C for A. A rational C that is capable of considering this possible future path will thus never ally with A in a coalition to crush B, as it will then be next in line for being destroyed.

I think this is great analysis. A framework to solve this problem is to think of it the way bitcoin’s consensus rule system works when combined with proof of work. It is very hard to generate a valid bitcoin block with sufficient PoW, but it is very easy for a node to reject a invalid bitcoin block.

Can we construct a mechanism where it is very easy for B to block the withdrawal transactions (WT) of A,C? If there is a mechanism to do this, A,C are incentivized to buy B’s s:bitcoin at a competitive market rate, as they want to withdraw their own s:bitcoin eventually.

A way we can do this, in proof of mainstake at least, is to require that we need 288 consecutive s:blocks without an orphan for a WT to be valid. That means if B could mine just one s:block in a 288 block interval, it can always block the WT of A,C. This would give a strong incentive for A,C to pay a fair market rate for B’s s:bitcoin if they want to withdraw their own s:bitcoin anytime soon.

Again, this is just a rough proposal, but I think this is the right framework to think in to solve this problem. The obvious downside to this is that any troll that can find 1 / 288 blocks can block a WT perpetually.

In closing, if we can get the game theory right for miners to always offer competitive market rates for m:bitcoin to s:bitcoin we would theoretically only ever need one withdrawal via the side-to-main peg from the sidechain — that withdrawal would be for the entire backing of the sidechain and would occur just before the sidechain dies. The recipient of that WT would be one person — the last person HODLing s:bitcoin.