Expose a payment storage interface with an embedded default #1
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
Engine::open(directory)currently owns a concrete redb store for intents, receipts, authorizations, capture decisions, pending Cashu operations, and payout journals. This is convenient for the first release, but applications with an existing database cannot choose where payment coordination state lives.Proposed improvement
Introduce a public storage interface and an Engine construction path that accepts a caller-provided implementation. Keep the current embedded redb implementation and directory-based setup as the default.
Design the interface around atomic domain operations rather than generic reads and writes. In particular, implementations must preserve:
Document how an application can coordinate a resource reservation with this interface. Sharing a database does not make a Lightning RPC transactional; durable decisions and recovery are still required. Do not imply that adding a backend automatically enables multiple Engine processes.
Acceptance criteria
This is a post-first-release improvement. The current embedded design is acceptable for the initial release.