Skip to content

Fix in-flight key cache bug, stale docs, and dead workflow code#6

Merged
nisfeb merged 1 commit into
masterfrom
fix/review-bugs
Mar 13, 2026
Merged

Fix in-flight key cache bug, stale docs, and dead workflow code#6
nisfeb merged 1 commit into
masterfrom
fix/review-bugs

Conversation

@nisfeb
Copy link
Copy Markdown
Contributor

@nisfeb nisfeb commented Mar 13, 2026

Summary

Code review follow-up from #5.

  • In-flight cached key bug: "have keys" branch was copy-paste of "no keys" — re-fetched keyset from network instead of building NUT-03 swap inline with cached keys
  • Empty mint key: in-flight recovery with empty mint URL stored tokens under '' wallet key, effectively losing them
  • Stale crypto comment: said "HMAC-SHA256" but code does SHA-256(mac_key || ciphertext)
  • README: updated signature example to encrypted format, added missing /vitriol/admin/withdraw endpoint
  • Workflow: removed dead mint: field extraction (mint URL is inside encrypted payload)

Test plan

  • In-flight token recovery with cached keys builds swap directly (no extra HTTP call)
  • README signature example matches actual hook output

🤖 Generated with Claude Code

Bugs:
- In-flight recovery with cached keys: was re-fetching keys from
  network instead of building swap directly with cached keyset.
  Now builds swap inline when keys are cached, skipping HTTP round-trip.
- In-flight recovery with empty mint URL: was storing tokens under
  empty string key in wallet. Now logs warning and discards (this case
  shouldn't occur since wallet keys always have mint URLs).

Documentation:
- Fix crypto comment: was "HMAC-SHA256", actually SHA-256(key || ct)
- README signature example: updated to show encrypted format
  (ecash-ciphertext, ecash-ephemeral-pubkey, ecash-mac)
- README: add missing /vitriol/admin/withdraw endpoint to table

Workflow:
- Remove dead mint: field extraction (mint URL is inside encrypted
  payload, not a separate signature block field)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nisfeb nisfeb merged commit b809d8a into master Mar 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant