Add authenticated encryption, in-flight recovery, and Lightning withdrawal#5
Merged
Conversation
… withdrawal Security fixes: - Encrypt-then-MAC: separate enc/mac keys from DH secret, HMAC-SHA256 ciphertext authentication, reject tampered data before decrypting - Random ephemeral keys via eny.bowl instead of deterministic derivation - Mint URL inside encrypted payload, not as external unprotected field - In-flight token recovery: tokens held in escrow for 30 min after signing, NUT-03 swapped for fresh proofs if unused (prevents loss from failed pushes) Maintainer features: - Per-mint wallet display showing balance and proof count per mint - Lightning withdrawal (NUT-05 melt): enter BOLT11 invoice, agent quotes and executes melt, proofs restored on failure - State-8 with pending-melts tracking quote and execute steps - pending-melt type in sur/vitriol.hoon Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2 tasks
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.
Summary
Changes
Security (agent)
ecash-encrypttakesenyparam, derives separateenc_keyandmac_keyfrom DH shared secretecash-macfieldecash-decryptverifies MAC first, returns~on failure{mint, tokens}JSON — mint URL protected by encryptionWithdrawal (agent + UI)
pending-melts=(map @t pending-melt)POST /vitriol/admin/withdraw: accepts mint + BOLT11 invoiceTypes
pending-melt: mint, step, invoice, proofs-used, quote-id, fee-reserveTest plan
🤖 Generated with Claude Code