Skip to content

⚡ Lightning prize splitting via Nostr Wallet Connect (NWC)#25

Merged
comwanga merged 17 commits into
mainfrom
feat/lightning-payout
Jun 17, 2026
Merged

⚡ Lightning prize splitting via Nostr Wallet Connect (NWC)#25
comwanga merged 17 commits into
mainfrom
feat/lightning-payout

Conversation

@comwanga

@comwanga comwanga commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds real Bitcoin (Lightning) to SquadSync for the bitcoin++ hackathon: an organizer marks a winning team, enters a sats prize, pastes a Nostr Wallet Connect (NIP-47) string, and the app splits the pot evenly and pays each winner's Lightning address — live. The deterministic team engine is untouched; this is a bolt-on at the results stage.

  • Even split of a sats prize across a winning team (deterministic remainder; full pot always paid).
  • LNURL-pay client resolves each member's lud16 to a bolt11 invoice; NWC client pays it over NIP-47, reusing the existing nostr_service NIP-04 + relay plumbing.
  • Pre-flight 422 if any winner lacks a Lightning address — nothing is spent on a partial team. Optional per-member address overrides let the organizer fill gaps in the modal.
  • Persisted payout receipt + redacted summary on the public results page ("⚡ Prize paid — N sats → x/y paid"). No addresses, invoices, preimages, or the NWC credential are ever exposed.
  • Frontend: optional Lightning-address field at registration (best-effort prefilled from the user's Nostr kind:0 profile), organizer payout modal with live per-member status + retry-failed, and the public prize-paid badge.

Security: the NWC string is a spend credential — accepted per-request, used transiently, never persisted, logged, or returned. Both payout endpoints enforce organizer ownership.

Test Plan

  • Backend suite green (136 passed) incl. split math, LNURL build/parse, NWC URI/encrypt/decode, payout status roll-up, 422 pre-flight, address override, and public-summary redaction.
  • Frontend lint clean + 44/44 unit tests pass.
  • Alembic 0007 applies cleanly through head.

Spec & plan: docs/superpowers/specs/2026-06-17-lightning-prize-splitting-design.md, docs/superpowers/plans/2026-06-17-lightning-prize-splitting.md.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
squadsync Ready Ready Preview, Comment Jun 17, 2026 9:51pm

…ale specs

- README: Lightning prize payouts (NIP-47) + optional registration LN address
- guide: add 'Pay out the winning team' step (09), recapture all screenshots
- capture-guide.mjs: capture the payout modal; renumber AI step to 10
- remove 5 incremental superpowers spec/plan pairs + launch-readiness audit
- strip demo wording from the kept lightning spec/plan
- gitignore stray .venvsource/ virtualenvs
@comwanga comwanga merged commit 36dbc80 into main Jun 17, 2026
6 checks passed
@comwanga comwanga deleted the feat/lightning-payout branch June 17, 2026 22:01
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