Skip to main content

Batch Swaps

A Batch Swap transitions preconfirmed VTXOs, created offchain through Ark Transactions, into new, onchain-confirmed VTXOs. This process restores settlement guarantees, extends expiry, and maintains the usability of funds without requiring a unilateral exit.

Batch swaps are executed via a new Commitment Transaction containing both a Batch Output and a Connector Output. The process is trust-minimized and atomic: neither the user nor the Ark Operator can complete the transition unilaterally, and funds remain under user control throughout.

Why Batch Swaps Are Necessary

Offchain VTXOs exist in a preconfirmation state and carry limited trust guarantees. Specifically:

  • A malicious Operator could equivocate by signing conflicting transactions
  • VTXOs nearing expiry may soon have their originating Batch outputs swept by the Operator
  • Preconfirmed VTXOs chained deeply diminish financial feasibility for a unilateral exit

Batch swaps allow users to re-anchor their VTXOs without exiting the protocol.

Step-by-Step Process

1. Participation Signaling

The user initiates the process by notifying the Operator of their intent to perform a batch swap. This message includes:

  • The VTXOs the user wishes to swap
  • Desired parameters for new VTXOs (output script, amount)
  • Cosigner keys for the new batch's tree

2. Commitment Transaction Construction

The Operator builds a new Commitment Transaction. This transaction includes:

  • A Batch Output, representing the new VTXOs in aggregate
  • A Connector Output, used for atomic coordination via a Virtual Connector

3. Virtual Transaction Tree Setup

The Operator constructs the virtual transaction tree for the Batch Output, defining:

  • Unroll paths for unilateral exits
  • Timelocks and collaborative paths for each new VTXO
  • Anchor outputs (for fee attachment, if needed)

This ensures each VTXO has enforceable settlement guarantees.

4. Forfeit Transaction Construction

A Forfeit Transaction is created to link the old state with the new one. It:

  • Spends the user's old preconfirmed VTXOs
  • Consumes the Virtual Connector
  • Transfers value to the Operator as part of liquidity rotation

The Virtual Connector ensures that the Operator can only claim the forfeited VTXO if it broadcast the Commitment Transaction.

5. Signing Phase

  • The user signs the forfeit transaction after verifying the virtual tree
  • The Operator signs the Commitment Transaction and new virtual paths

This mutual dependence ensures atomicity. Neither party can finalize the swap without the other's cooperation.

6. Broadcast and Confirmation

The Operator broadcasts the Commitment Transaction to the Bitcoin network.

  • Once confirmed, the new VTXOs become valid and enforceable
  • The user's old VTXOs are invalidated via the forfeit transaction
  • The system state advances without requiring unilateral exit

Expiry Management

VTXOs must be renewed before their associated batch expires. Batch swaps are the preferred method for doing so, avoiding unilateral exit and preserving offchain continuity.

Summary

Batch swaps allow users to maintain control and continuity in the Ark protocol without relying on unilateral exits. By periodically rotating VTXOs into new confirmed batches, users regain full security guarantees and extend the lifetime of their assets within the system.

  • Transactions are atomic and verifiable
  • Exit guarantees are preserved at all times
  • User custody is never relinquished