What are Rounds?
Rounds are the fundamental coordination mechanism in Ark. Everyround_interval (configured in ArkInfo), the server creates a new round transaction that:
- Refreshes existing VTXOs to extend their lifetime
- Processes off-chain payments between users
- Settles Lightning payments into VTXOs
- Handles cooperative offboards to on-chain addresses
- Consolidates and optimizes VTXO distribution
Rounds are the “heartbeat” of Ark - they keep the system alive by continuously refreshing VTXOs before they expire and settling pending operations.
Round Lifecycle
The round system is defined inlib/src/rounds.rs. Each round progresses through several stages:
Round Identification
Round Sequence Number- Identifies rounds before they’re finalized
- Increments with each new round attempt
- Used during round construction
- Permanent identifier after round completion
- Based on the round transaction’s txid
- Used to reference historical rounds
Round Events
Clients receive events as rounds progress:1. Round Attempt
- Server announces a new round attempt
- Includes a random challenge for ownership proofs
- Clients prepare to participate
2. VTXO Proposal
- Server proposes the round transaction structure
- Includes VTXO tree specification
- Contains aggregated MuSig2 nonces for signing
- Clients validate and provide partial signatures
3. Round Finished
- Server provides final aggregated signatures
- Signed round transaction ready for broadcast
- Clients extract and store their new VTXOs
Round Transaction Structure
A round transaction must have at minimum:Output Layout
- Root of the radix-4 tree containing all user VTXOs
- Always at vout 0 by protocol convention
- Single UTXO shared by all participants
- Chain of connector outputs for future rounds
- Enables efficient forfeit/penalty transactions
- Funded according to
ConnectorChain::required_budget(len)
- Direct on-chain payments to user addresses
- Users exiting funds cooperatively
- More efficient than unilateral exits
- Allows CPFP fee-bumping if needed
- Standard P2A (Pay-to-Anchor) output
VTXO Tree Structure
VTXOs in a round are organized in a radix-4 tree (defined inlib/src/tree/mod.rs):
Tree Construction
Example: 10 VTXOs organized in radix-4 tree- Leaves are user VTXOs
- Internal nodes are intermediate outputs
- Each level can have up to 4 children
- Minimizes transaction chain depth
- Calculated size:
Tree::nb_nodes_for_leaves(nb_leaves)
Node Structure
- Level 0: Leaf nodes (user VTXOs)
- Level 1: Internal nodes with leaf children
- Level N: Closer to root
- Root: Highest level
Round Participation
Inputs to a Round
Users can provide inputs to participate:- Replay attacks across different rounds
- Unauthorized spending of VTXOs
- Round manipulation by non-owners
Outputs from a Round
Users request new VTXOs:- Derived deterministically from user’s master key
- Used to cosign the VTXO tree transactions
- Should be forgotten after signing (for privacy)
nb_round_nonces nonces (from ArkInfo):
Round Timing
Interval Configuration
- Mainnet: 5-15 minutes (balances UX vs efficiency)
- Signet/Testnet: 1-5 minutes (faster testing)
- Custom: Configurable by service provider
Round Schedule
Rounds occur on a regular schedule:If a round fails (not enough participants, signing issues, etc.), a new attempt starts immediately with incremented
attempt_seq.Round Fees
Fees are charged according toFeeSchedule in ArkInfo.fees:
Typical fee components:
- Base round fee: Fixed cost per VTXO
- Consolidation fee: Charged when combining VTXOs
- Tree position fee: May vary by tree depth
- Offboard fee: Covers on-chain transaction costs
Round Transaction Signing
Rounds use MuSig2 for efficient multi-signature aggregation:Signing Protocol
-
Nonce Exchange
- Each participant generates public nonces
- Server aggregates:
agg_nonce = musig::nonce_agg([user_nonces, server_nonces])
-
Partial Signatures
- Each tree transaction signed independently
- Users provide partial signatures for their inputs
- Server provides partial signatures for all outputs
-
Signature Aggregation
- Server combines partial signatures
- Produces final Schnorr signature for each transaction
- Broadcasts round transaction with aggregated signatures
Round Failures and Retries
Rounds can fail for various reasons: Common failure modes:- Insufficient participants
- Signing timeouts
- Invalid partial signatures
- Transaction validation failures
- Network issues
- Same
round_seq, incrementedattempt_seq - New challenge generated for security
- Participants must re-submit inputs and signatures
Connector Chains
Connector chains (defined inlib/src/connectors.rs) enable efficient forfeit transactions:
Purpose
- Forfeit transactions: Penalize malicious behavior
- Efficiency: Pre-funded connectors avoid complex fee markets
- Flexibility: Different lengths for different security models
Budget Calculation
Monitoring Rounds
Client Responsibilities
Essential round monitoring:
- Listen for round events on the server’s event stream
- Validate proposals before signing
- Submit partial signatures promptly
- Extract and store new VTXOs from finished rounds
- Verify round transaction confirms on-chain
- Track VTXO expiries and refresh before expiry
Round Metrics
Key metrics to monitor:- Round completion rate
- Average round interval
- Participation count
- Fee trends
- Retry frequency
Best Practices
DO:
- Participate in rounds regularly to refresh VTXOs
- Validate all VTXO proposals before signing
- Monitor round events continuously
- Keep ephemeral signing keys secure during rounds
- Verify round transactions confirm on-chain
- Reuse cosign pubkeys across rounds
- Skip ownership proof validation
- Sign without validating the VTXO tree structure
- Assume rounds always succeed
- Ignore failed round attempts
Round Transaction Example
A complete round transaction structure:Further Reading
VTXOs
Understanding VTXO structure
Exits
What happens when rounds fail