Add ecash payment, Cashu wallet, and admin UI#3
Merged
Merged
Conversation
Groundwire Verification FailedThis PR will not be reviewed because commits are not signed by a recognized Groundwire ID. Why?This repository requires contributors to prove ownership of an onchain Groundwire identity. How to fix this
This repository is protected by Groundwire for GitHub. |
Adds optional ecash token payment support to vitriol. Maintainers can require sats-per-PR and committers load their wallet via Lightning. Tokens are NUT-03 swapped at the mint during verification to confirm value before the CI check passes. Agent (desk/app/vitriol.hoon): - State-6: adds mint URL, wallet (map of mint→proofs), keyset cache, sats-per-pr price, pending mints, and pending verifications - Curve25519 encryption keypair for future DH ecash exchange - Committer wallet: configure mint, request Lightning invoice (NUT-04), poll for payment via Behn timers, mint tokens, store proofs - Sign endpoint: accepts sats_required, selects proofs from wallet (>= required, <= 110% to avoid overpaying), deducts from wallet - Verify endpoint: parses incoming ecash tokens, initiates NUT-03 swap at the mint to verify value, returns verify_id for async polling - Verify-status polling endpoint for CI to await swap completion - Ban list with set/unban via admin forms and JSON API - Maintainer can set sats-per-pr price via admin UI - All endpoints require Eyre authentication (403 otherwise) - Tokens accepted even when payment not required (free money) Cashu library (desk/lib/cashu.hoon): - Full BDHKE implementation (NUT-00) with secp256k1 curve operations - NUT-03 swap (blind, unblind, request/response builders) - NUT-04 mint via Lightning (quote, poll, token generation) - NUT-05 melt to Lightning (quote, execute) - Hash-to-curve, point compression/decompression, keyset parsing Admin UI (desk/lib/vitriol-ui.hoon): - Sail admin panel split into Committer and Maintainer sections - Committer: wallet balance, mint URL config, load sats via Lightning - Maintainer: payment toggle, sats-per-PR price, ecash pubkey, ban list - Landing page at /vitriol with app description and endpoint reference - Dark theme with consistent styling Types (desk/sur/vitriol.hoon): - cashu-proof: amount, keyset id, secret, signature - pending-mint-quote: tracks Lightning invoice→token flow - pending-verify: tracks NUT-03 swap verification of incoming tokens Hook (hooks/groundwire-sign): - Fetches maintainer's sats-per-pr price from /vitriol/sats-per-pr - Passes sats_required to committer's /sign endpoint - Includes ecash-amount and ecash-tokens in signature block - Error handling for insufficient balance Other: - sys.kelvin: support both kelvin 408 and 409 - install.sh: updated docs for ecash/maintainer flow - README.md: comprehensive rewrite covering ecash architecture, contributor/maintainer setup, token verification, and security Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
verify-committo confirm their value before passing CI — no blind trust/vitriol/adminsplit into committer (wallet, mint config, load sats) and maintainer (payment toggle, price, ban list, ecash pubkey) sections, plus a landing page at/vitriolWhat changed
Agent (
desk/app/vitriol.hoon)/signacceptssats_required, selects proofs from wallet (≥ required, ≤ 110%), deducts from wallet/verify-commitparses incoming ecash tokens, initiates NUT-03 swap at the mint, returnsverify_idfor async polling/verify-status/{id}polling endpoint for CI to await swap completion/sats-per-prendpoint exposes maintainer's priceCashu library (
desk/lib/cashu.hoon)fomodular arithmeticAdmin UI (
desk/lib/vitriol-ui.hoon)Types (
desk/sur/vitriol.hoon)cashu-proof,pending-mint-quote,pending-verifyHook (
hooks/groundwire-sign)sats-per-prpricesats_requiredto/signecash-amountandecash-tokensin signature blockOther
sys.kelvin: supports both 408 and 409install.sh: updated docs for maintainer ecash flowREADME.md: comprehensive rewriteToken flow
Test plan
sats_required— tokens selected and deducted🤖 Generated with Claude Code