feat(wallet): rebuild Cashu ecash end to end, with Lightning and recovery - #7
Merged
Conversation
… state - Added `sendingEcash` state to `MessageThread` to disable the send button during the sending process. - Updated `handleSendEcash` to check for ongoing sends and prevent multiple submissions. - Similar changes made in `PeerList` for sending sats, ensuring a smooth user experience. - Enhanced wallet service to handle mint request timeouts and improve error handling for concurrent sends. - Updated wallet store to ensure reservations are atomic and prevent double spending of proofs. - Added tests to verify that reservations are respected and prevent concurrent sends from using the same proof.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The wallet held real money but could lose it. Sending deleted proofs before
delivery, so a dismissed sheet or a DM that never routed destroyed the value
with no trace. Proofs sat in plaintext MMKV. DLEQ verification was dead code
that could only ever return true, so the receive path credited the balance
from any well-formed token. Nutzaps were unreadable by any other client, and
incoming ones were never subscribed to at all.
Money safety
reclaimable across app restarts, and reconcile settles it from proof state.
key is unavailable the wallet locks rather than falling back to plaintext.
token is refused and never reaches the store; missing keys report unchecked,
never valid.
proves the mint signed a proof but never that it is unspent.
longer be summed into one number.
New capabilities
unused routing reserve returned as change.
uncovered remainder shown rather than hidden.
Correctness
9321 with per-proof tags, P2PK locked to a 33-byte key rather than an
unspendable x-only Nostr key, and a watcher that redeems incoming zaps.
cards for the cashu: URI form.
WebSockets, with an explicit opt-in under Privacy & Security.
divergent copies in the Wallet, Mesh and Chat screens.
Store schema migrates v1 to v2 on first launch; the legacy plaintext file is
read once and wiped. Wire protocol, Noise, packet codec and Nostr transport
are untouched, so bitchat compatibility is unchanged.
Tests: 777 passing (payments 17 -> 70).