Skip to content

Add LNURL-over-Nostr support (naddr + nprofile)#4

Open
Kukks wants to merge 1 commit intomasterfrom
nostrpay
Open

Add LNURL-over-Nostr support (naddr + nprofile)#4
Kukks wants to merge 1 commit intomasterfrom
nostrpay

Conversation

@Kukks
Copy link
Copy Markdown
Owner

@Kukks Kukks commented Mar 2, 2023

Summary

Implements the LUD-XX: LNURL-over-Nostr specification, enabling LNURL flows over Nostr relays without requiring DNS or HTTPS infrastructure.

  • ILNURLCommunicator transport abstraction in LNURL.Core — keeps Core free of Nostr/NNostr dependency
  • NostrLNURLCommunicator with two addressing modes:
    • naddr (recommended): direct fetch of Kind 31120 parameterized replaceable events for static LNURL types (payRequest, channelRequest, withdrawRequest)
    • nprofile: NIP-17 Gift Wrap DM exchange for interactive types (login)
  • LNURLNostrHelper: server-side helper for merchants — publishes Kind 31120 events, generates naddr/nprofile endpoints, handles incoming NIP-17 requests
  • LNURLCompositeCommunicator: routes nostr: URIs to Nostr transport, everything else to HTTP
  • Callback fallback: when service omits callback in Nostr response, defaults to original LNURL URI
  • LUD-17 support: lnurlp:naddr1... and lnurlp:nprofile1... scheme URIs parse correctly
  • NNostr.Client 0.0.54 with NIP-17 (Gift Wrap), NIP-44 (ChaCha20), NIP-59 support

Test plan

  • 71 tests passing (13 new Nostr/communicator tests + 58 existing)
  • naddr URI parsing, bech32 encoding, LUD-17 round-trip
  • nprofile URI parsing and encoding
  • LNURLNostrHelper naddr endpoint generation and Kind 31120 event creation
  • Callback fallback for payRequest and withdrawRequest
  • FetchInformation with ILNURLCommunicator (both HTTP and Nostr paths)

Implements the LUD-XX (LNURL-over-Nostr) specification:
- ILNURLCommunicator transport abstraction in LNURL.Core
- HttpLNURLCommunicator (HTTP default) and NostrLNURLCommunicator (Nostr)
- naddr: direct fetch of Kind 31120 replaceable events (static params)
- nprofile: NIP-17 Gift Wrap DM exchange (interactive/login flows)
- LNURLNostrHelper for server-side Nostr endpoint management
- LNURLCompositeCommunicator to route by URI scheme
- Callback fallback to original LNURL when omitted in response
- NNostr.Client 0.0.54 with NIP-17/NIP-44/NIP-59 support
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

Warning

Rate limit exceeded

@Kukks has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 11 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a9aa55c-dad0-4f0c-a0d1-35e3edcd3db6

📥 Commits

Reviewing files that changed from the base of the PR and between 58fcdda and 0dba6a6.

📒 Files selected for processing (13)
  • LNURL.Core/HttpLNURLCommunicator.cs
  • LNURL.Core/ILNURLCommunicator.cs
  • LNURL.Core/LNAuthRequest.cs
  • LNURL.Core/LNURL.cs
  • LNURL.Core/LNURLChannelRequest.cs
  • LNURL.Core/LNURLPayRequest.cs
  • LNURL.Core/LNURLWithdrawRequest.cs
  • LNURL.Tests/UnitTest1.cs
  • LNURL/LNURL.csproj
  • LNURL/LNURLCompositeCommunicator.cs
  • LNURL/LNURLNostrHelper.cs
  • LNURL/NostrLNURLCommunicator.cs
  • LNURL/TypeForwarders.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nostrpay

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kukks Kukks changed the title Support LNURL over Nostr Add LNURL-over-Nostr support (naddr + nprofile) Apr 12, 2026
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