feat: accept caller-managed trusted Cashu wallets #15

Merged
thesimplekid merged 1 commit from fix/2-caller-trusted-wallets into main 2026-10-09 14:21:25 +00:00
Owner

Applications can now pass their existing Arc<cdk::Wallet> handles through EngineOptions::with_trusted_wallets and Engine::open_with_options. Trusted receive, trusted-mint settlement, balance, payout and recovery all use the supplied wallets. Engine::open keeps the existing managed-wallet default.

Routing is explicit by each wallet's mint URL. Opening rejects duplicate mints and non-sat units; unconfigured trusted mints fail instead of creating another wallet. Supplied wallets retain their own database, seed and configuration. Satsettle persists its coordination/receive-evidence journals but creates no replacement seed or wallet database for those mints, and refuses to silently substitute a supplied wallet into an existing managed-wallet directory.

The API docs and README require the same durable wallet state and routes on restart, coordinated backups, and exclusive wallet mutation/recovery for the Engine lifetime. An Arc is not a cross-Engine or external-CDK lock. Untrusted source wallets remain separate and are addressed by #3.

Validation: formatting, Clippy, documentation and all 53 tests pass in the x86_64 Linux Nix checks. Existing lost-receive-response, uncertain-payout and lost trusted-mint issuance regressions now run with both managed and caller-supplied wallets across restarts. Tests also check absence of replacement wallet files, wrong units/duplicate routes/unconfigured destinations, and isolation of balances across two trusted mints. aarch64 was not checked.

Stacked on #14; this diff contains the issue #2 wallet ownership change.

Closes #2.

Applications can now pass their existing `Arc<cdk::Wallet>` handles through `EngineOptions::with_trusted_wallets` and `Engine::open_with_options`. Trusted receive, trusted-mint settlement, balance, payout and recovery all use the supplied wallets. `Engine::open` keeps the existing managed-wallet default. Routing is explicit by each wallet's mint URL. Opening rejects duplicate mints and non-sat units; unconfigured trusted mints fail instead of creating another wallet. Supplied wallets retain their own database, seed and configuration. Satsettle persists its coordination/receive-evidence journals but creates no replacement seed or wallet database for those mints, and refuses to silently substitute a supplied wallet into an existing managed-wallet directory. The API docs and README require the same durable wallet state and routes on restart, coordinated backups, and exclusive wallet mutation/recovery for the Engine lifetime. An Arc is not a cross-Engine or external-CDK lock. Untrusted source wallets remain separate and are addressed by #3. Validation: formatting, Clippy, documentation and all 53 tests pass in the x86_64 Linux Nix checks. Existing lost-receive-response, uncertain-payout and lost trusted-mint issuance regressions now run with both managed and caller-supplied wallets across restarts. Tests also check absence of replacement wallet files, wrong units/duplicate routes/unconfigured destinations, and isolation of balances across two trusted mints. aarch64 was not checked. Stacked on #14; this diff contains the issue #2 wallet ownership change. Closes #2.
feat: accept caller-managed trusted Cashu wallets
Some checks failed
Checks / checks (pull_request) Failing after 3s
Checks / cdk-compatible (pull_request) Failing after 10s
Checks / format (pull_request) Failing after 5s
Checks / format (push) Has been cancelled
Checks / checks (push) Has been cancelled
Checks / cdk-compatible (push) Has been cancelled
5c55453f2e
Add EngineOptions and open_with_options with explicit routing by each
supplied wallet's mint. Validate sat units and unique mint routes, reject
unconfigured trusted destinations, and retain managed wallets as default.

Use supplied Arc<Wallet> handles for receiving, trusted-mint settlement,
balances and payouts without creating replacement wallet databases or seeds.
Keep receive/payout coordination journals and document exclusive ownership.

Closes #2.
thesimplekid changed target branch from fix/8-signet-regtest to main 2026-10-09 14:21:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thesimplekid/satsettle!15
No description provided.