fix(ecash): change proofs no longer ride along inside sent tokens — double-credit bug #122

Merged
lfg2025 merged 1 commits from fix/cashu-double-credit into main 2026-07-24 12:34:57 +00:00
Owner

Membership-based partition packed change proofs into the token whenever change shared a denomination with the send (worst case 2x). Count-aware split + hard-fail on incomplete denominations. Affects wallet sends AND peer-files purchases (same mint path). Requires backend redeploy to take effect.

🤖 Generated with Claude Code

Membership-based partition packed change proofs into the token whenever change shared a denomination with the send (worst case 2x). Count-aware split + hard-fail on incomplete denominations. Affects wallet sends AND peer-files purchases (same mint path). Requires backend redeploy to take effect. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
lfg2025 added 1 commit 2026-07-24 12:34:52 +00:00
send_token_at split the mint swap's results with
partition(send_denoms.contains(amount)) — membership, not count. When a
change denomination equaled a send denomination (guaranteed when
spending from a proof worth exactly 2x the amount: send [n], change
[n]), the change proofs were serialized INTO the token, and the
receiver redeemed double. Both the wallet send flow and peer-files
purchases mint through this path.

The split now consumes exactly one proof per required send denomination
(everything else returns to the wallet as change) and hard-fails if the
mint returns an incomplete denomination set, so a token can never again
be silently over- or under-packed.

Note: tokens minted BEFORE this fix already contain the extra proofs
and will still redeem at their inflated value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lfg2025 merged commit 385c950f00 into main 2026-07-24 12:34:57 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lfg2025/archy#122
No description provided.