Context
Babylon provides the Bitcoin staking protocol that allows Bitcoin holders to stake their BTCs natively on the Bitcoin chain to protect any PoS chains. The staking is trustless in the sense that the BTC resides in a self-custodian vault on the native Bitcoin network, without being bridged elsewhere.
OP-stack chains can integrate with the Babylon BTC staking protocol to get Bitcoin security. This leads to the following benefits.
- Better economic security: There is native BTC staked to protect the rollup and improve its economic security. This is made more important for new OP-stack chains with fewer adoptions. In addition, the staked BTC achieves slashable safety, a strong security property that equivocations by L2 sequencers are held accountable and the BTC stake is slashable, even when equivocating L2 sequencers constitute a majority.
- Fast finality: The improved economic security will benefit the OP stack chains for fast finality. If the user is willing to trust the votes backed by the BTC stake, then the user can confirm transactions and make decisions without waiting for the lengthy challenging period in optimistic rollups.
- Reorg resilience of L2 transactions: Once a transaction is included in an L2 block signed by the majority of BTC-backed finality providers, the sequencer cannot publish a different L2 block at the same height on L1.
The Forkless Rollups with Bitcoin staking blog post provides more details.
System architecture
The following figure depicts the system architecture. The “→” arrow denotes data flow; for example, X→ Y means “Y queries data from X and the data flows from X to Y”.
The design involves the following main components:
- Finality provider: a daemon program that receives BTC stake and keeps submitting finality signatures over L2 blocks to the finality contract on Babylon.
- Finality contract: a CosmWasm smart contract that maintains all finality signatures submitted from OP-stack finality providers.
- Finality gadget: a daemon program that keeps tallying all finality signatures for L2 blocks and serves RPC to allow querying the BTC-voting quorum of those blocks.
- OP node with finality gadget: a modified OP node that enforces BTC-voting quorum before finalizing L2 blocks.
Implementation
We have finished the reference implementation. The codebases include: