Accept caller-managed trusted Cashu wallets #2

Closed
opened 2026-10-09 11:19:43 +00:00 by thesimplekid · 0 comments
Owner

Problem

The library currently constructs its trusted Cashu receiving wallets and chooses their seed storage and SQLite databases. Applications that already own a CDK wallet cannot pass that wallet into satsettle, resulting in additional wallet lifecycle and storage management.

Proposed improvement

Add an Engine configuration path that accepts a caller-owned Arc<Wallet> for a configured trusted mint. The caller chooses the wallet database, seed, and other wallet configuration. Retain the managed-wallet setup as a convenient default.

A CDK wallet is configured for a particular mint and unit. Validate that a supplied wallet matches the requested trusted destination and sat-denominated payment terms. If multiple trusted mints are configured, define explicit routing rather than treating one wallet as covering every mint.

Acceptance criteria

  • Trusted Cashu receive, trusted-mint settlement, balance, and payout paths can use the supplied wallet.
  • Injected wallets do not cause Engine to create replacement wallet databases or seeds.
  • Recovery and idempotency continue to work across restarts with the same caller-managed wallet.
  • Document concurrency and ownership requirements: accepting an Arc does not by itself make concurrent use outside satsettle safe.
  • Tests cover mismatched mint/unit configuration and interrupted receive/payout operations.

Payment coordination storage is addressed separately by the storage-interface issue. Arbitrary untrusted source mints require the separate wallet-provider improvement; a single trusted wallet does not cover them.

This is a post-first-release improvement; no change to the current first-release persistence model is required now.

## Problem The library currently constructs its trusted Cashu receiving wallets and chooses their seed storage and SQLite databases. Applications that already own a CDK wallet cannot pass that wallet into satsettle, resulting in additional wallet lifecycle and storage management. ## Proposed improvement Add an Engine configuration path that accepts a caller-owned `Arc<Wallet>` for a configured trusted mint. The caller chooses the wallet database, seed, and other wallet configuration. Retain the managed-wallet setup as a convenient default. A CDK wallet is configured for a particular mint and unit. Validate that a supplied wallet matches the requested trusted destination and sat-denominated payment terms. If multiple trusted mints are configured, define explicit routing rather than treating one wallet as covering every mint. ## Acceptance criteria - Trusted Cashu receive, trusted-mint settlement, balance, and payout paths can use the supplied wallet. - Injected wallets do not cause Engine to create replacement wallet databases or seeds. - Recovery and idempotency continue to work across restarts with the same caller-managed wallet. - Document concurrency and ownership requirements: accepting an Arc does not by itself make concurrent use outside satsettle safe. - Tests cover mismatched mint/unit configuration and interrupted receive/payout operations. Payment coordination storage is addressed separately by the storage-interface issue. Arbitrary untrusted source mints require the separate wallet-provider improvement; a single trusted wallet does not cover them. This is a post-first-release improvement; no change to the current first-release persistence model is required now.
Sign in to join this conversation.
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#2
No description provided.