Keep expired bitcoin in the balance
Show the amount, split out from the healthy balance and labeled as needing action. A balance that silently drops to zero asserts a loss that has not happened. Users believe it.- The keys still work: The wallet app still holds the keys to an expired VTXO and can refresh it (VTXO lifetime covers the sweep).
- The exit guarantee has lapsed: The pre-signed emergency exit no longer protects the VTXO. Recovery depends on the Ark server’s cooperation (what remains possible after expiry).
- Bark still counts it: Bark reports the expired VTXO in
needs_refresh_sat(needsRefreshSatsin the SDK), not inspendable_sat(spendableSats), and skips it as an input for Ark sends. The same field also holds VTXOs whose exit depth has reached the server’s limit. The next maintenance pass treats each of them as a mandatory refresh.
Name the lifecycle states
Derive each VTXO’s state by comparing itsexpiry_height (in every VTXO record of the JSON and REST APIs) against the chain tip.
Keep an expired amount visible and keep retrying its refresh. An exit that finds its chain swept ends in the
vtxo-swept state.
Say what the user can do, not what they lost
Point every message at the action that recovers the sats.
Never use “irrecoverable”, “lost”, or “expired” as a final verdict, since your wallet app cannot tell when a sweep happens. Before a sweep those words are false. A user who reads them stops trying, which turns a recoverable balance into a real loss.
Surface the dust floor before the user hits it
A refresh needs no on-chain bitcoin. It does need a minimum size. Bark takes the refresh fee out of the refreshed amount. The new VTXO must still be at least 330 sats after the fee. Bark refuses to build a smaller refresh. The Ark server rejects any round output below that floor. Bark also refuses to start an emergency exit for a VTXO under 330 sats. A wallet whose entire Ark balance sits below the floor can therefore neither refresh nor exit it. Get the user past it in two steps:- Add bitcoin first: The user receives more over Ark or Lightning, or boards on-chain bitcoin. A board has its own server minimum (
min_board_amount_satin the Ark server info) and an on-chain fee to confirm. - Refresh the old VTXO together with the new sats: A refresh combines all its inputs into one output, so a refresh that includes both clears the floor. Make that combined call from your app (refresh an explicit list). The maintenance pass selects each VTXO on its own merits, so it usually leaves a healthy top-up out.
spendable_sat plus needs_refresh_sat) falls below the floor plus the refresh fee. Show it in the balance view itself, not as the error message of a refresh that already failed.
Three habits keep users from ever seeing this state: a daily maintenance pass, delegated refreshes on mobile, and a notification ahead of the next required refresh height.
How Bark Wallet does it
How Bark Wallet does it
- Expiry labels: The VTXOs page shows each VTXO’s expiry height with a relative label beneath it (“in ~3 days”). It lists live VTXOs first, soonest expiry first, then exited and spent ones, which stay hidden until the user turns them on in the Filter menu. The label becomes “Expired” once the tip reaches the height.
- Auto-refresh: The auto-refresh selects every spendable VTXO at or below the threshold that is not already in a round, expired ones included. The app therefore retries the refresh of an expired VTXO on its own (maintenance covers the check).
- Round badges: While a VTXO is committed to a refresh, its status badge reads “Queued” until the round starts and “Refreshing” while it runs.
- Expired state: The VTXOs page labels an expired VTXO “Expired”. The balance card shows its amount in a “Needs refresh” row.