Role of a Batch Swap

Offchain VTXOs exist in a preconfirmation state and carry limited trust guarantees. Specifically:
  • A malicious operator could equivocate by signing conflicting transactions
  • Preconfirmed VTXOs chained deeply diminish financial feasibility for a unilateral exit
  • VTXOs nearing expiry may soon have their originating batch outputs swept by the operator
Due to the batch expiry mechanism, VTXOs need to be renewed on a regular basis. Renewal is undertaken via so-called batch swaps.
The user can delegate VTXO renewal to a third party while still retaining full control of their funds and the ability to exit unilaterally.
Batch swaps allow users to re-anchor their VTXOs onchain without exiting the protocol. If a VTXO is batch swapped, it transitions from a preconfirmed VTXO (old batch) into an onchain-anchored VTXO (new batch). The new VTXO then inherits Bitcoin finality and resets the VTXO expiry as it is part of a new batch. The process is trust-minimized and atomic: neither the user nor the operator can complete the transition unilaterally, and funds remain under user control throughout. Atomicity is achieved via the usage of connector outputs and forfeit transactions.

Forfeit Transactions

During a batch swap, a user signs a forfeit transaction that forfeits on the (old) VTXO to be batch swapped. The recipient of the resulting output is the operator. The connector input ensures atomicity. forfeit.png
Forfeit Transactions serve two main purposes:
  1. Assure the user can forfeit securely on old funds, as those can only be claimed by the operator if new VTXOs are being created via a broadcasted commitment transaction
  2. Protect the operator against potential user fraud, if the user attempted to double-spend forfeited funds
Forfeit transactions have a specific two-input, two-output structure that requires both a VTXO input and a connector input:
  • Two inputs: One VTXO input and one connector input
  • Two outputs: Forfeit output (to operator) and anchor output
  • Timelock support: Can optionally include CLTV lock
The anchor output in forfeit transactions is a zero-value output with a specific script used for fee bumping through Child-Pays-For-Parent (CPFP) transactions. When a forfeit transaction needs higher fees for confirmation, the system creates a child transaction that spends this anchor output and pays additional fees. forfeit-anchor.png
Since the connector output is an output of the commitment transaction which servers as an input to the forfeit transaction (which lets the operator claim the forfeited user funds), the operator can only claim user funds if it created and broadcasted the next commitment transaction with the new VTXO(s).

Batch Swaps: Step-by-Step process

1

Participation Signaling

The user initiates the process by notifying the operator they want to perform a batch swap. This message (facilitated via an intent) 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 then builds a new commitment transaction which includes:
  • the batch output, representing the new VTXOs in aggregate
  • the connector output, used for atomic coordination between batch funds
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 broadcasted the commitment transaction.
5

Signing Phase

  • The user signs the forfeit transaction after verifying the virtual tree
  • The Arkade Signer 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
A deep-dive of the onchain settlement process is available in the developer’s arkd section

Summary

Batch swaps allow VTXO holders to renew their funds and anchor them to Bitcoin, inheriting its security properties. A user might want to bactch swap if their VTXO is about to expire or if it is part of a deep offchain transaction chain, meaning: users extend the lifetime of their assets and regain full onchain security guarantees. The batch swap process is secure insofar that:
  • Transactions are atomic and verifiable
  • User custody is never relinquished
  • Exit guarantees are preserved at all times