Mon. Aug 8th, 2022

Spacechains is a proposed Bitcoin sidechain that offers a one-way peg mechanism utilizing blind merge mine design.

The idea of sidechains as a scaling and feature extension mechanism for Bitcoin is a very old concept. A kind of basic “ancestor” idea of sidechains,

It is also worth noting that two variants of this design can be implemented with CHECKTEMPLATEVERIFY (CTV) or without any changes at all. These two design variants simply have suboptimal tradeoffs.

The CTV variant would use that functionality to commit to the chain of transactions using CTV instead of APO with the hack including the signature inside the UTXO locking script. CTV commits to all the outputs of a transaction spending the CTV UTXO, but it doesn’t commit to any input besides itself.

This means you can add inputs, but not outputs, to a CTV transaction. So you can bring your own fee just like in the APO design, but you cannot add a commitment to the sidechain block header.

So, what we need to do here is create a transaction completely outside of the chain of CTV transactions for the sidechain commitment to create a UTXO that is just enough to pay the fee for the CTV transaction (because you cannot create a new change output in that transaction, 100% of the input you add goes to fees), and inside the transaction preparing the fee UTXO is where we commit to a sidechain block header. So, first step: a transaction creating a fee paying output and a commitment to a sidechain block header. Second step: we take the fee output and add it as an input to the CTV transaction, which when confirmed, “mines” our specific sidechain block. This variant looks like this:


The next variant simply uses pre-signed transactions. It could be deployed today, but because of the limitations of what script can do, it requires all the fees for the transactions to be paid up front by whoever creates the spacechain.

The chain of transactions starts with a single UTXO, and in a chain creates two outputs. The first output is the marker UTXO, which signals that the chain of transactions is related to a specific spacechain, the second one is a small value UTXO that is spendable openly by anyone allowing for attaching another input/output to it. This second transaction is where anyone can openly commit to be the first to spend that second output from the spacechain transaction chain, and use it to commit to their sidechain block header.

In the CTV variant, the sidechain block had to be committed to in a secondary transaction because CTV does not allow adding new outputs in a transaction spending an input locked by CTV. This variant requires using a secondary transaction because if you add any new inputs or outputs to the pre-signed chain, you would alter the TXID of the transaction and invalidate all the pre-signed transactions that come after it. This variant looks like this: 


The one downside of this last variant is that if whoever pre-signed all of the transactions to use for sidechain block commitments does not delete the private keys used to do so, they can effectively halt the chain by double spending the current marker UTXO at any time.

And there you have it. This is the most recent proposal for a sidechain design on Bitcoin, and it can be implemented in three different ways, with the obvious caveat that the implementation path that can be done now has the issue of requiring someone to delete a private key.

This article is simply the first in a series relating to the major sidechain design proposals that have been published for Bitcoin since the original 2014 design. Keep an eye out for the rest.

This is a guest post by Shinobi. Opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or Bitcoin Magazine.