Skip to content

Statechain

What Is a Statechain?

A Statechain is a Layer 2 protocol (processing transactions "off-chain") pioneered by Ruben Somsen, organizer of the Seoul Bitcoin Meetup and co-host of the Unhashed blog. It completely revolutionizes the concept of Bitcoin transactions. Instead of sending funds between addresses, Statechain users directly send the private keys that can spend the funds.

How Statechains Work

If we simply sent private keys instead of making transactions, this would obviously be insecure. We have no way of knowing whether the sender has kept a backup copy of the key. To address this problem, Statechain's solution is to add a second key, locking the funds in a multisignature contract so that a single key cannot move the funds on-chain.

The second key is generated by a neutral party, Victor. Victor is the Statechain coordinator and carries a very important task: Victor must and only must sign when the last recipient of the temporary key requests him to sign.

When Alice wants to transfer assets to Bob, Alice sends the temporary key to Bob and informs Victor that she has handed over the key. Therefore, Bob is now the owner of the temporary private key. Now Bob can contact Victor and request a signature to move the funds.

Alice still retains the temporary key. However, if she wants Victor to help sign a transaction to move the funds, Victor will refuse. For Victor, these funds no longer belong to Alice. And since Alice only has one private key, she cannot move the funds on her own.

This naturally raises another issue: if Victor refuses to sign a transaction upon receiving a request, then the assets cannot be withdrawn. Statechain also provides a solution for this:

When Alice initialized the Statechain, she took a precautionary measure: before sending funds to the multisig address, she created a "backup transaction" that sends the funds from the multisig address to a new address. Alice does not broadcast this backup transaction to the network. Instead, she sends it to Victor, asks him to sign it and return it to her.

After Alice receives the signed (but unbroadcast) backup transaction, she then sends the funds to the multisig address. This way, even if Victor disappears, she can broadcast the backup transaction and get her money back after a waiting period.

Now, suppose Alice is going to send the temporary key to Bob. She first contacts Victor and asks him to sign a new backup transaction for Bob and give it to Bob. So when Bob receives the temporary key, he already has an unbroadcast but signed backup transaction, so he can also recover his money if Victor goes missing.

Alice and Bob (and all subsequent recipients of the temporary key) use a cryptographic method designed for the Lightning Network called "Eltoo." Eltoo allows Bob to "override" Alice's backup transaction with his own. So if Alice attempts fraud by broadcasting her old backup transaction, Bob can either contact Victor during Alice's waiting period and jointly recover his money, or use his own backup transaction to directly override Alice's transaction.

statechain


Reference: https://bitcoinmagazine.com/technical/statechains-sending-keys-not-coins-to-scale-bitcoin-off-chain