Backup Transaction Chain
A series of pre-signed on-chain transactions that let the current holder of a statechain output exit unilaterally.
Basically
A backup transaction chain is a set of ready-signed transactions for a statechain coin. It lets each owner claim the coin on Bitcoin without asking anyone, with the newest owner able to act first.
Key Takeaways
- A backup transaction chain is a growing sequence of pre-signed transactions created during statechain transfers, with each new transaction having a shorter timelock than the previous one.
- Decrementing timelocks guarantee that the most recent owner can claim funds on-chain before any previous owner, providing a trustless unilateral exit without cooperation from the statechain entity.
- The chain has a bounded length because each transfer consumes a fixed number of blocks from the initial timelock, so the coin must eventually be settled on-chain and re-deposited before off-chain trading can continue.
What Is a Backup Transaction Chain?
A backup transaction chain is the ordered sequence of pre-signed transactions that builds up as a statechain coin changes hands. Each transfer adds a new backup transaction that spends the same on-chain UTXO, the original funding output locked in a 2-of-2 multisig, but has a shorter nLockTime value. These decreasing timelocks decide who can exit first if the statechain entity goes offline.
Ruben Somsen introduced the concept in 2018 as part of his proposed statechain protocol. His original design used SIGHASH_ANYPREVOUT, then called SIGHASH_NOINPUT, to let newer state updates override older ones, but that opcode has not been activated on Bitcoin. Practical implementations such as Mercury Layer instead use decrementing nLockTime values to provide a similar ordering guarantee with features available on Bitcoin today.
How It Works
Each transfer between owners adds one pre-signed backup transaction to the chain. Every backup independently spends the same original funding UTXO, so the chain is not a connected sequence of transactions on the blockchain. Decreasing timelocks give these transactions their ordered relationship and make them a "chain".
Timelock Priority and Exit Ordering
The decrementing timelocks create a strict priority order for on-chain exits. If the statechain entity disappears and all owners broadcast their backup transactions at once, only the most recent owner's transaction succeeds because its shorter nLockTime makes it valid for mining first.
Every backup transaction spends the same UTXO, so the others become invalid once any one of them confirms. The timelock ordering ensures that the current owner always wins this race.
The nLockTime Field
Bitcoin's native nLockTime field is an absolute timelock in every transaction, and a block-height value stops the transaction entering a block until that height is reached. Miners will not accept it into a block template before then, and nodes will not relay it. Consensus rules enforce this restriction, so no trust in the statechain entity is required.
nSequence must be below 0xFFFFFFFF for nLockTime enforcement to take effect. Mercury Layer v0.2.0 fixed a vulnerability in which default sequence values could bypass locktime checks by explicitly setting nSequence to zero in all backup transactions.
Transfer Limit and Chain Length
The decrementing timelock design puts a hard cap on how many times a statechain coin can change hands before on-chain settlement. The maximum number of transfers is the initial timelock window divided by the per-transfer decrement interval.
Off-chain transfers must stop when the latest backup transaction's nLockTime approaches the current block height. The coin must then be settled on-chain, either through the current owner's backup transaction or a clean closure with the statechain entity. The owner can make a fresh statechain deposit with a new, full-length timelock window to resume off-chain trading.
Protocol designers face an inherent trade-off here. They must balance the initial timelock window and the per-transfer decrement against the limit on off-chain transfers.
Why It Matters
The backup transaction chain makes statechains self-custodial rather than purely trusted. Without it, users would depend entirely on the statechain entity to authorise withdrawals. With it, every owner has a cryptographic guarantee that they can exit to the Bitcoin base layer independently.
Statechains involve a semi-trusted operator that co-signs transfers and is trusted to delete its old key shares after each ownership change. A dishonest or offline entity cannot trap users because the backup transaction chain still allows an exit. The most recent owner always has the fastest path to on-chain settlement.
Protocols such as Spark build on the statechain model and extend it with FROST threshold signatures and tree-structured exits, although Spark's architecture differs from the original statechain design. The underlying principle remains that users should always hold pre-signed exit data for unilateral withdrawal to the base layer without operator cooperation. The statechains scaling deep dive provides a detailed comparison of exit mechanisms across Bitcoin Layer 2 protocols.
Unilateral Exit Without Cooperation
The primary use case is guaranteeing that the current statechain owner can exit to the Bitcoin base layer even if the statechain entity shuts down, is censored, or refuses to cooperate. The owner simply broadcasts the backup transaction after its nLockTime matures, without permission from any party.
Protection Against Previous Owners
The statechain entity is trusted to delete its old key shares, but a previous owner could collude with a compromised entity to attempt a double spend. The backup transaction chain mitigates this risk because the current owner's shorter timelock lets them claim the funds first, even if the previous owner broadcasts an old backup. The previous owner's transaction then fails because the UTXO is already spent.
Mercury Layer Coin Trading
Mercury Layer, the most prominent statechain implementation, uses backup transaction chains for off-chain trading of fixed-denomination Bitcoin UTXOs. Each trade appends a new backup to the chain, so the coin can circulate among participants without touching the blockchain until the timelock window expires or a user chooses to settle.
Finite Transfer Capacity
The hard cap on transfers is the most significant limitation of the backup transaction chain model. Lightning channels can process an unlimited number of state updates, but a statechain coin can change hands only a fixed number of times before it needs on-chain settlement. Statechains therefore suit lower-frequency, higher-value transfers better than micropayments.
Timing and Monitoring
The current owner must know when their backup transaction's nLockTime matures and be ready to broadcast if the statechain entity becomes unresponsive. Applications and watchtower services can automate this monitoring, but recovery remains time-sensitive. Missing the broadcast window could let a previous owner with an earlier-maturing backup claim the funds, although that scenario requires collusion with the statechain entity.
Fee Rate Uncertainty
Backup transactions are signed with a predetermined fee rate at the time of transfer. A much higher Bitcoin fee market at broadcast time could delay confirmation or prevent the backup confirming before a competing backup matures. Some implementations use CPFP or anchor outputs so users can bump fees when they broadcast.
No Penalty for Cheating Attempts
Lightning's justice transaction mechanism punishes a cheating counterparty by confiscating all channel funds, but the backup transaction chain relies solely on timelock ordering. A previous owner who broadcasts an outdated backup loses nothing beyond the transaction fee because the attempt simply fails once the UTXO is already spent. Without an economic penalty, the security model depends on the statechain entity faithfully deleting old key shares after each transfer.
Sequence Number Vulnerabilities
nLockTime enforcement depends on the transaction's nSequence field being set below the maximum value of 0xFFFFFFFF. A backup transaction with the default maximum sequence number effectively disables nLockTime, so it can be broadcast at any time. Mercury Layer patched this vulnerability in version 0.2.0 by explicitly setting nSequence to zero in all backup transactions.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.