Skip to main content
Your wallet app has to refresh every VTXO before it expires. Your users are not always online when a refresh falls due.

Compare the refresh options

Diagram of when the wallet app must be online for an interactive, a delegated, and a scheduled delegated refreshDiagram of when the wallet app must be online for an interactive, a delegated, and a scheduled delegated refresh

An interactive refresh needs the wallet app online through the round, a delegated one only while it submits, and every option needs it back online before the old VTXOs expire

All three settle in the same rounds and follow the same fee schedule (show refresh fees walks through the brackets). Delegating changes who signs during the round, not what the refresh costs. If the wallet app never returns, the outcome differs:
  • Interactive: The participation stalls, a later maintenance pass cancels it, and the refresh starts over in a new round. Nothing is refreshed. The pass does not cancel a participation whose round already finished. The next sync after the round transaction confirms completes it.
  • Delegated and scheduled: The server carries the round once. A round that skips the participation, for example a full one, leaves it for the next round. The new VTXO stays hash-locked until the app returns and forfeits the old VTXOs. Make the app return before those expire, while an emergency exit on them can still confirm.

Refresh interactively when the app stays online

Pick interactive refresh for any wallet app that can keep its process alive across a round. That includes a server-side integration, a node, a desktop app, or a browser tab the user is looking at. It is the default on every surface.
Call maintenance() to run the full pass and join the next round with every VTXO that is due, or refreshVtxos(vtxoIds) to refresh a chosen set. When there is something to refresh, both calls wait for the next round to start, then take part in it until the round ends. The wallet app completes the refresh on a later sync, once the round transaction confirms.
Keep the process alive from submission until the round ends (scheduled maintenance covers what each surface needs).

Delegate the round when the app cannot stay online

Pick delegated refresh when the operating system can suspend your app mid-round, which is the normal case on iOS and Android, and an option on desktop. The Ark server signs the round on the app’s behalf (delegated refreshes walks through the phases).
Call maintenanceDelegated() for the full pass, or refreshVtxosDelegated(vtxoIds) for a chosen set (same names in Swift, Kotlin, React Native, and Dart). The latter returns the participation’s round state, or nothing when there is nothing to refresh.
Plan for the gap between submission and completion:
  • The old VTXOs stay spendable until the server issues the round: A send that picks one in that window makes the server drop the participation. On a later sync the app submits a new delegated participation with the inputs that remain. The refresh movement carries on with it. If no input remains, the app marks the refresh movement failed and drops the participation. It does the same when the remaining inputs cannot cover the refresh fee and leave a non-dust output. In those two cases, submit a new participation. In every other case, the app completes the refresh on the first sync after the round transaction confirms. Until then, pendingRoundStates() lists the participation as delegated-pending.
  • The user trusts the server for as long as they hold the new VTXO: Delegated co-signer covers what the server can do meanwhile and what the app checks before it forfeits.
  • A mobile app needs background wakes: Background refresh covers waking the app, running the delegated pass, completing each refresh on a later wake, and storing the mnemonic.

Schedule a delegated refresh ahead of time

Pick a scheduled delegated refresh when the app has the user’s attention now and may not have it when the refresh is due, typically during a foreground session on mobile. The app submits the participation with a future block height. The server holds it out of rounds until the chain tip reaches that height.
Call refreshVtxosScheduled(vtxoIds, scheduledHeight). pendingRoundStates() shows the participation as delegated-pending (a RoundFlowKind case in the native SDK bindings) with the height in scheduledHeight.
Schedule it at least 144 blocks (about a day) before expiry_height, the same margin as the default refresh threshold, rather than on the last possible block:
  • Fee: The server prices the refresh at the scheduled height and locks that price in at submission. Scheduling close to expiry pays the lower bracket the VTXO would reach by then.
  • Height limit: The server refuses a height at or past any input VTXO’s expiry_height. A round has to happen between the scheduled height and expiry.
  • Installed version, interactive: The barkd daemon does the upkeep. The app’s auto-refresh and “Refresh all” action submit interactive refreshes through POST /api/v1/wallet/refresh/vtxos and /refresh/all.
  • Web version (WASM), delegated: The same actions submit delegated refreshes through the SDK’s refreshVtxosDelegated. The worker’s sync loop completes them the next time a tab is open. While a tab is open, the bark library’s background daemon can also join a round interactively for the VTXOs its maintenance selection finds due. Maintenance covers how the app runs its refresh check.