Building on Bitcoin (BTC): statechains, spacechains and drivechains

0 44

Bitcoin sometimes gets the criticism that it's not programmable enough. However, there are many different products that are built on top of the protocol. From the Lightning Network,Discreet Log Contracts to sidechains with Rootstock and Liquid. But there's more: statechains, spacechains and drivechains. What are these, what are the differences and what can you do with them?

1. Statechain

Statechains is a second-tier protocol, just like the Lightning Network is. So it's built on top of the Bitcoin network, and you can move 'value' from this base layer with it without taxing the Bitcoin blockchain.

This allows you to save on costs and you don't necessarily have to deal with parameters such as block times, block sizes and the mempool. Developer Ruben Somen has come up with this idea and pitched it several times.

The idea behind Statechains is that you lock money between two parties into a 2-of-2 multisig: on the one hand the entity of the Statechain and on the other hand the user. If the user wants to transfer the money (or rather the full UTXO), he gives the private key, or rather the transitory key, to the intended recipient.

This allows this party to change hands, while nothing changes in the blockchain. Under the hood, of course, all kinds of complex things happen.

In theory, the money is controlled by the entity that sets up the Statechain and all users who have such a temporary transitory key. In itself, the owner of the Statechain can do nothing with the money, it can only be sent by the person with the latest temporary key.

At the same time, it is also a non-custodial solution, because the party behind the Statechain cannot do anything: after all, it is a 2-for-2 multisig.

Trading with whole UTXOs and keys

An important thing to remember is that there is always trade in 'whole UTXOs' that are locked in these Statechains. If someone puts a 0.5 BTC UTXO in a state chain, this whole 0.5 BTC has to change hands each time. You can exchange with smaller UTXOs, but this is obviously a negative of this piece of technology. Another drawback is that updates are still needed in the protocol: Schnorr signatures and Sighash_Anyprevout.

A second important part of Statechains is Eltoo, which will also be an improvement for Lightning. With Eltoo, it becomes impossible to share an old status of a payment channel (in Lightning) or Statechain key. This makes it impossible to run off with old backups with the money while the other party has no knowledge of it.

So instead of sending the coins from address to address, state chain users send the private key that can be used to issue the coins.

The problem would normally be: who guarantees that the person sending the key does not secretly withhold a copy? Therefore, at Statechains there is a third entity that co-signs payments. Therefore, this temporary transitory key is used.

As a result, the Statechain entity is actually the bailiff: it keeps an eye on whether the keys are being tampered with, while he or she cannot do anything with the money because of the multisig.

Sources:, YouTube, Ruben Somsen,

2. Spacechain

The second piece of off-chain technology on top of Bitcoin also comes from Ruben Somsen. These spacechains have something to do with statechains somewhere, but they work slightly differently.

It's a one-way peg of a bit of bitcoin, which you then go off-chain with. It also uses the idea of blind-merged mining.

Blind merged mining

This principle boils down to the fact that in the blockchain, there will be one transaction that has to do with the space chain. Bitcoin uses Proof-of-Work, which means miners have to do work to earn something. Spacechains work on the principle of fee-bidding: miners of the space chain compete with each other to get that one transaction through a fee into a block. The blind merged miner who gets the transaction (see the small red block in the image below) in the Bitcoin blockchain is also assigned the block on the spacechain.

An important note is that the bitcoin you use in a space chain cannot be retrieved from this ecosystem.

The one transaction that the space chain miners struggle to make with the deposit of fees is a little bit of space in a block. This transaction refers to a hash, from the block of the space chain. In the end, you get a series of space chain blocks, where the longest chain of wins (as it does with Bitcoin), all of which are hashed in the real Bitcoin blockchain.

As a spacechain-blind-miner, you pay fees to make a block. But you don't want to create a new altcoin for this, and it's also not possible to send a parallel fairy with satoshis via the Lightning Network to the miner who puts your transaction in the bitcoin block.

As a result, the next solution is to 'burn' bitcoin. And in this case, for every bitcoin you burn, you get the same number of spacecoins on the 'sidechain'. This is a controversial subject, because is this good or not good? It creates additional scarcity, but it feels weird. In the video Somsen explains how he stands in this (minute 24).

In this way, it is possible to build a permissionless blockchain, without new token or altcoin, on top of the Bitcoin network, where you pay the current miners for using the block space.

But what can you do with this blockchain? You can spend colored tokens there, such as a USDT Tether token. You can also think of decentralized DNS applications without new altcoin. DAO, DeFi and decentralised exchanges could also take place on spacechains.

Source: YouTube

3. Drivechain

The third idea for on top of bitcoin are drivechains. Drivechains allow you to create, delete, and receive BTC. So it uses bitcoin as a native currency and it's a sidechain. Once the bitcoin is in this sidechain, you can spend it in this 'side chain' indefinitely and change hands.

At Drivechains you can get the satoshis back in the base layer. However, this is not done through 'verifiable proof', but through a so-called principle of 'conjecture-and-refutation'. A small group of refunds is bundled and gradually they get an ACK (of acknowledgment) so that the price between the sidechain-bitcoin and native-bitcoin remains at the ratio 1:1.

Drivechains can also work through Bitcoin Improvement Proposals, namely BIP 300 and 301.

  • Hashrate escrows - "Container UTXOs" that compress 3-6 months of transaction data to a fixed amount of 32-bytes.

  • Blind Merged Mining - The same technique as the one explained above: to make a single high-cost transaction to get a spot in the mainchain.

This way, you can create a sidechain where you use the same consensus rules (and decentralization) as the Bitcoin mainchain, while creating a more flexible blockchain. The bitcoin is locked on the mainchain, and makes them on the sidechain/drivechain, and vice versa. As a result, you have bitcoin as a native currency and yet the consensus rules of the mainchain.

$ 0.00