Skip to content

Comments

feat: add Nostr zap support (NIP-57) for splitpayments#1

Open
hexdaemon wants to merge 2 commits intomainfrom
feat/nostr-zap-support
Open

feat: add Nostr zap support (NIP-57) for splitpayments#1
hexdaemon wants to merge 2 commits intomainfrom
feat/nostr-zap-support

Conversation

@hexdaemon
Copy link
Collaborator

Summary

  • When splitting payments to LNURL/Lightning Address targets that support Nostr zaps (NIP-57), the extension now sends a signed zap request (kind 9734) so recipients are notified via Nostr
  • Adds per-wallet Nostr private key settings (hex or nsec), encrypted at rest, using the built-in lnbits-extension-settings-btn-dialog component (matching the lnurlp extension pattern)
  • Gracefully falls back to normal LNURL payment if no key is configured or the target doesn't support zaps

Changes

  • helpers.py (new): parse_nostr_private_key() accepting hex or nsec format
  • models.py: SplitPaymentSettings model with wallet-scoped nostr_private_key
  • migrations.py: m005 creates settings table, m006 adds wallet column as primary key
  • crud.py: Per-wallet settings CRUD with encrypt_internal_message/decrypt_internal_message
  • views_api.py: GET/PUT/DELETE /api/v1/settings endpoints using require_admin_key
  • tasks.py: Two-phase LNURL flow — handle() to get LnurlPayResponse, then custom callback with nostr query param for zap-capable targets; falls back to execute_pay_request() otherwise
  • UI: Settings gear button inline with wallet dropdown, per-wallet key configuration

Test plan

  • Configure a Nostr private key via the settings dialog for a wallet
  • Send a payment to a wallet with LNURL/Lightning Address targets that support zaps
  • Verify splitpayments: sent zap request for <target> appears in logs
  • Verify zap receipt appears on the recipient's Nostr client
  • Verify targets that don't support zaps still receive normal LNURL payments
  • Verify switching wallets in the UI loads/saves separate settings per wallet
  • Delete the key and verify fallback to non-zap payments

🤖 Generated with Claude Code

When splitting payments to LNURL/Lightning Address targets that support
Nostr zaps, the extension now sends a NIP-57 zap request so recipients
are notified via Nostr. Adds per-wallet settings for configuring a Nostr
private key (hex or nsec), encrypted at rest.

Includes security audit fixes for input validation and error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hexdaemon hexdaemon force-pushed the feat/nostr-zap-support branch from c84fb41 to 82abdf4 Compare February 13, 2026 16:07
Add nostr_signing schema for NIP-57 zap request (kind 9734) so
nsecbunker can auto-discover signing needs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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