Allow caller-provided wallets for untrusted-mint settlement attempts #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
Direct settlement currently creates an isolated CDK source wallet per Cashu token/attempt, with a persistent seed and SQLite database under the Engine data directory. These wallets track original proofs, melt recovery, and change without mixing source proofs into trusted balances or payouts.
Once applications can supply their trusted wallet, the library still needs a way to handle previously unknown source mints without taking control of their wallet storage.
Proposed improvement
Introduce a caller-provided wallet provider/factory that opens or creates an isolated source wallet using a stable attempt identity, source mint, and unit. Retries and restarts must resolve to the same wallet state. Provide the existing persistent per-attempt implementation as the default.
Preserve the current direct-melt behavior: no preliminary swap, no automatic reuse of original source proofs for payouts, and no remelting after a durable rejection. Define how source network restrictions remain enforced when a caller supplies the wallet or connector; injection must not silently bypass the existing public-address, redirect, and transport restrictions.
Persistence and in-memory storage
Do not replace the default with an in-memory database. A crash during a held or uncertain melt can lose wallet recovery and change-output state. An in-memory implementation is only safe if an external durable journal can fully reconstruct all required state; evaluating that is optional and must not weaken recovery guarantees.
Acceptance criteria
This complements caller-managed trusted wallets and is a post-first-release improvement.
thesimplekid referenced this issue2026-10-09 11:20:34 +00:00