feat: allow persistent source-wallet providers #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/3-source-wallet-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Applications can now control source-wallet construction and persistence through
EngineOptions::with_source_wallet_provider. The async provider receives a stable attempt ID, mint and unit, and supplies anArc<cdk::Wallet>reused through durable lookup on retries, restarts, proof release and change recovery. The default remains persistent per-attempt SQLite wallets and seeds.Satsettle validates the returned mint/unit and rejects detectable database-handle reuse across attempts or with supplied trusted wallets, including cloned Wallet values sharing a database handle. The provider contract requires separate persistent namespaces, stable seed/state, exclusive mutation/recovery, and retention of unresolved state. Separate handles to an arbitrary backend cannot prove isolation; providers must prevent those aliases themselves. No fallback source database or seed is created for a supplied provider.
Source URL checks still run before provider lookup. CDK retains its standard transport, no preliminary swap is introduced, and deployments/providers retain responsibility for egress and redirect restrictions. Durable rejection still prevents remelting, original proofs remain outside trusted balances/payouts, and only recovered change is exported.
Validation: formatting, Clippy, documentation and all 55 tests pass in the x86_64 Linux Nix checks. Direct-melt lost-response/change recovery, pending melts across restart, cancelled melts, and manual claim/reject/original-proof release now run with both managed wallets and a persistent caller provider. Additional tests reject wrong mint/unit, shared database handles, and unsupported arbitrary-source URLs before provider invocation. aarch64 was not checked.
Stacked on #15; this diff contains the issue #3 provider change.
Closes #3.