Architecture
Key Components
- Bitcoin RPC: Broadcasts transactions and monitors confirmations
- Signer: Actor instance for signing transactions
- Database: Tracks rounds, kickoff connectors, and deposits
- Collateral UTXO: Locked funds that secure operator behavior
- Reimburse Address: Where operators receive reimbursements
- Header Chain Prover: Generates SPV proofs for BitVM assertions
Initialization
Automatic Setup
When an operator starts for the first time:Create Collateral UTXO
If no existing data, check config for
OPERATOR_COLLATERAL_FUNDING_OUTPOINT:- If set: Validate it exists on-chain with correct amount and script
- If not set: Create new UTXO by sending to operator’s taproot address
Mainnet Safety
On mainnet, if collateral or reimbursement address is missing:Core Responsibilities
1. Parameter Generation
Operators provide cryptographic parameters for each deposit:Kickoff Winternitz Public Keys
Generated for blockhash commitments in kickoff transactions:Unspent Kickoff Signatures
Pre-signed signatures for unspent kickoff UTXOs:num_round_txs * signatures_per_round
Each signature is tagged with:
- Round index
- Kickoff UTXO index
- Transaction type (UnspentKickoff)
2. Deposit Signing
Operators sign deposit transactions to enable fund movement:-
Validate N-of-N Correctness
-
Generate Sighash Stream
-
Sign Each Transaction
- Number of kickoff UTXOs
- Number of rounds
- Challenge transaction requirements
3. Withdrawal Processing
Operators provide liquidity for user withdrawals:Profitability Check
Withdrawal Workflow
4. Payout Reimbursement
After processing a withdrawal, operators get reimbursed:-
Find Available Kickoff Connector
-
Check Round Progression
-
Generate Signed Transactions
-
Queue Transactions
- Kickoff transaction
- Challenge acknowledgment transactions
- Timeout transactions
- Reimburse transaction
-
Mark Connector as Used
5. Round Management
Operators progress through rounds to refresh kickoff UTXOs:End Round Process
Background Tasks (Automation)
State Manager
Monitors blockchain for operator-relevant events:- Payout transaction confirmations
- Kickoff transaction finalizations
- Round progression triggers
- Deposit vault movements
Payout Checker
Continuously scans for new withdrawal opportunities:- Query Citrea for pending withdrawals
- Check if withdrawal matches any available deposit vault
- Validate profitability
- Trigger
handle_finalized_payout()automatically
Entity Metric Publisher
Publishes operator health metrics:- Bitcoin wallet balance
- Available kickoff connectors
- Pending reimbursements
- Transaction sender queue depth
Database Schema
operators
Primary operator record:
xonly_pk: Operator’s X-only public key (primary key)reimburse_addr: Address for reimbursementscollateral_funding_outpoint: Collateral UTXO
operator_kickoff_winternitz_pks
Stores derived Winternitz public keys:
operator_xonly_pk: Foreign keywinternitz_pks: Serialized vector of public keys
kickoff_connectors
Tracks available/used kickoff UTXOs:
round_idx: Which round the connector belongs tokickoff_idx: Index within the roundis_used: Boolean flagkickoff_txid: Transaction ID if used
current_round
Singleton table for round progression:
round_idx: Current round index
Security Properties
Collateral Security
✅ Operator collateral is slashable if:- Operator signs contradictory statements
- Operator fails to respond to challenges
- Operator attempts to steal funds
Withdrawal Safety
✅ Prevents:- Unprofitable withdrawals
- Invalid Citrea withdrawal claims
- Signature forgery (verify user signature)
- Double-spending withdrawals
Round Safety
✅ Ensures:- Kickoff connectors are only used once
- Rounds progress sequentially
- Timelocks prevent premature spending
- Unused kickoffs are properly burned
Economic Incentives
Revenue Sources
- Withdrawal Fees:
operator_withdrawal_fee_satsper withdrawal - Bridge Spread: Difference between deposit and withdrawal amounts
Costs
- Collateral Opportunity Cost: Locked BTC earning no yield
- Transaction Fees: Bitcoin network fees for reimbursements
- Infrastructure: Running Bitcoin and Citrea nodes
Profitability Formula
Related Documentation
Actor Overview
Learn about the actor model architecture
Verifier
Understand how verifiers validate operators
Aggregator
See how aggregators coordinate operators