Emergency exit#10
Merged
Merged
Conversation
- Cache signed exit trees while the ASP is online so they can be broadcast lindependently. - Refresh fires in the background on `connect_wallet` and on demand from a new "Emergency exit package" card in Settings, with the cache persisted to - `unilateral_exit_cache.json` in the app data dir - Make the wallet UI load even when `connect_wallet` fails (new "offline" connection state) so the recovery card stays reachable when the ASP is down
- Bump ark-rust-sdk v0.9.0 → v0.9.2 - Sweep status and the sweep itself now run offline. The recovery cache snapshots the server pubkey, CSV exit delay, dust limit, and sweep candidates at refresh time; sweeping replicates the SDK's send_on_chain from ark-core primitives (gap-limit key discovery via esplora, boarding + unrolled VTXO coin selection, local signing) because the SDK's own path requires a connected client. - Exit packages broadcast through a configurable submitpackage endpoint - Exit branches are labelled with their source VTXO and amount; the coins screen lists exiting coins with CSV countdowns, deduped against the spendable list so a mid-exit coin can't be renewed or settled
Release builds can now bake in a default Bitcoin Core submitpackage broadcast endpoint so mainnet unilateral exits work out of the box, while users keep a runtime override. The endpoint resolves as: a Settings override wins, else the compiled-in default, else esplora.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emergency exit
Adds an offline unilateral-exit recovery flow: if the Ark server (ASP) becomes unreachable, a user can still recover their funds by broadcasting their pre-signed exit tree to Bitcoin directly and sweeping the resulting on-chain outputs — no ASP cooperation required. Also bumps the ark SDK v0.9.0 → v0.9.2 and refactors the settings screen.
What's included
Offline recovery core
unilateral_exit_preflight/_status/_broadcast_next: walk each branch, fee-bump the zero-fee parent via its P2A anchor, and broadcast.sweep_unrolled_to_onchainspends them to a regular address. The SDK'ssend_on_chainrequires a live client, so this re-implements the path fromark-coreprimitives (gap-limit key discovery via esplora, boarding + unrolled VTXO coin selection, local signing) to work fully offline.Broadcast endpoint
submitpackageendpointUI
Notes for the reviewer / deploy
AVARK_SUBMITPACKAGE_URLVariable and anAVARK_SUBMITPACKAGE_TOKEN