Skip to main content

Know what a delegated refresh delegates, and to whom

  • What the wallet app signs: One attestation per input VTXO that authorizes exactly the requested outputs, and nothing else (background refresh covers what the app needs to produce it).
  • What the Ark server signs: It builds the round and co-signs the transaction tree above the user’s new VTXO with its own round key.
  • What nobody signs for the user: In an interactive round, the wallet app co-signs that tree with an ephemeral key it discards afterwards. In a delegated round, no key the user controls signs those transactions.
  • What the user trusts: That the server discards its key after the round. Nothing the wallet app receives can prove that it did. Delegated refresh trust model describes this as a 1-of-n model across co-signers. Bark has one signer in that set, the Ark server.
Before it forfeits the old VTXOs, the wallet app verifies everything it can see. On its next sync after the round, it collects the new VTXOs and the round funding transaction and refuses to continue unless:
  • The number of new VTXOs, and each one’s amount and policy, match the participation it submitted.
  • The tree uses the server pubkey and exit delta the wallet app expects.
  • Every new VTXO is distinct. Unless every input VTXO has already expired, its expiry leaves room for an emergency exit from the current chain tip. For a scheduled refresh, it also sits above the scheduled height.
  • Every transaction in the new VTXO’s chain validates, apart from the hash-locked last step the server unlocks after the forfeit.
  • Each new VTXO’s hash-lock uses the hash the server returned for the participation.
  • The funding transaction has the confirmations the wallet app’s round_tx_required_confirmations setting requires.
Three consequences shape your product copy and your UI:
  • A failed check leaves an emergency exit as the way out: The wallet app does not sign forfeits, so the old VTXOs stay the user’s. The server has already issued the round, though. The app has already locked the inputs, so the user cannot send them. Start an emergency exit on them early enough to confirm before they expire.
  • Submitting does not lock the inputs: Until the server issues the round, the user can still spend the old VTXOs or start an emergency exit on them. A spend takes the participation out of the round at once. An emergency exit takes it out only if the VTXO’s own transaction confirms before the server assembles the round. A transaction still in the mempool does not count. Once the round is issued and the app has seen its funding transaction, the app locks the inputs like those of an interactive round. A send then no longer picks them, though an emergency exit can still start on them.
  • A participation that loses inputs continues with the rest or ends failed: When some of its inputs are no longer spendable, the wallet app submits the others as a new participation. The refresh movement carries on with it. When the server reports the participation as gone, the wallet app unlocks the inputs and marks the refresh movement failed. It does the same when the remaining inputs cannot pay the refresh fee and leave 330 sats. It also deletes the round state, so the participation leaves the pending rounds list. Submit a new participation.
Tell users, in your product copy, that they trust the server for as long as they hold a VTXO from a delegated refresh, not only while the round runs.
Third-party co-signers are in developmentCo-signers that sign every VTXO in every round are in development. Today only the Ark server signs the whole tree above a delegated refresh’s outputs. No key the user controls signs it.

Plan for the deadline the user still has to meet

A delegated participation buys one refresh. Once the round that includes it lands, the participation is spent. The next refresh needs a new one. Submitting a new participation that shares an input with a pending one replaces the pending one. The new one pays the fee for the current chain tip, or for its scheduled height. The replaced refresh movement ends failed. Make the wallet app sync again after the round, through a foreground open or a background wake. The first sync after the round transaction confirms completes the refresh. That sync has to come early enough that an emergency exit on the old VTXOs could still confirm before they expire. When a check fails, the participation stays pending with its inputs locked, and Bark logs the error (on Barkd, GET /api/v1/wallet/rounds also reports a sync-error status). A participation that stays delegated-pending (a RoundFlowKind case in the native SDK bindings) after its inputs lock can still complete. Start an emergency exit on its inputs only when the old VTXOs are close to expiry, early enough for the exit to confirm before they expire. Delegating moves the round out of the user’s schedule. It does not remove the deadline:
  • The old VTXOs keep their expiry: They stay the user’s until the wallet app signs the forfeits, with their original expiry height.
  • Expiry closes the exit path: Once the old VTXOs expire, the server can sweep them and the exit path is gone. There is no mode in which a device can stay offline past expiry and remain fully protected.
  • Your app owns the exit decision: The bark library does not start an exit on its own when a delegated round cannot complete.
  • A mnemonic restore brings the participation back once its round runs: Until the round runs, only the wallet database and the Ark server know the participation. A new refresh of the same VTXOs from the restored wallet replaces it during that time. When the round completes, the server posts a notice to the wallet’s mailbox. The recovery scan of a restored wallet also finds the unclaimed output through the server’s xpub lookup. A wallet restored from the mnemonic alone rebuilds the participation from either one and completes it on a later sync (restore a wallet covers what each path brings back).
Complete the refresh before the old VTXOs expireSchedule the pass that completes delegated refreshes well inside the old VTXOs’ lifetime. Treat a device that has not run in that window as a user at risk. Scheduled maintenance covers cadence. Background refresh covers devices that stop waking.

Rely on what completes in the background

Bark builds the device side of a delegated refresh to survive interruption:
  • The participation is persisted at once: The wallet app stores it in its database the moment the server accepts it. Every wallet sync (a foreground open, a background wake, the background daemon’s loop, or the mailbox notice that the round completed) picks it up again.
  • Completion is repeatable: The app asks the server for the participation’s status, then fetches the round funding transaction and the new VTXOs. It runs the checks above, has the server co-sign the new leaf transactions, sends the hash-locked forfeits (how hash-locks work for rounds), and registers the new VTXOs. Every step is idempotent on the server’s side.
  • An interruption costs nothing: A device that dies mid-completion, even after sending the forfeits, runs the same steps again on its next wake and finishes. Completion runs inside any sync (sync(), progressPendingRounds(), or the one maintenanceDelegated() starts with), so a background pass needs no extra call for it.
Bark Wallet’s own refresh calls are delegated in the web version (WASM) and interactive in the installed version. The web version also runs the bark library’s background daemon, which joins a round that starts while a tab is open, interactively, with the VTXOs it considers due. In the web version, the bark library inside the SDK verifies the new VTXOs against the participation and sends the forfeits. Refresh options covers which calls each version makes.