Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should malformed lightning callback urls be supported for zapping? #54

Closed
oren-z0 opened this issue Jul 15, 2023 · 1 comment
Closed

Comments

@oren-z0
Copy link

oren-z0 commented Jul 15, 2023

For Example, http://sendsats.lol/.well-known/lnurlp/jb55 gives:

{
  "status":"OK",
  "tag":"payRequest",
  "minSendable":1,
  "maxSendable":10000000000,
  "callback":"https://sendsats.lol/@jb55",
  "metadata":"[[\"text/plain\",\"jb55's lightning address\"],[\"text/identifier\",\"[email protected]\"]]",
  "allowsNostr":true,
  "nostrPubkey":"9630f464cca6a5147aa8a35f0bcdd3ce485324e732fd39e09233b1d848238f31"
}

Notice that the callback url contains an unescaped "@".

Right now, NDKEvent.zap() function fails to create a payment request.

@oren-z0
Copy link
Author

oren-z0 commented Jul 17, 2023

The URL was ok, it's the zapping comment that included a "nostr:..." (mentioning some user, different from the payment zap receiver) - so the generateTags() function added the mentioned user's pubkey as a p tag in addition to the receiver's p tag, and some lightning servers don't like zap events with more than one p tag. They are correct to do so - according to the protocol there should be only one p tag: https://github.com/nostr-protocol/nips/blob/master/57.md#appendix-d-lnurl-server-zap-request-validation .
See: #53

@oren-z0 oren-z0 closed this as completed Jul 17, 2023
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

No branches or pull requests

1 participant