Nice summary

Reply to this note

Please Login to reply.

Discussion

Testing zaps for this note… we made six attempts to⚡zap this note, at pedromvpg@btcpay989117.lndyn.com, over a period of 19 minutes. In each case, we found that your lightning address server did not respond correctly. (The failure point was when we did a GET request to your specified callback URL: https://btcpay989117.lndyn.com/BTC/UILNURL/pay/lnaddress/pedromvpg.) Your server did not produce an invoice, thus the zap failed. We recommend that you use a cloud-based Lightning node which is optimized for Nostr zaps, to get your zaps working.

I **think** I have diagnosed the issue. Here is a callback URL that does not work: https://btcpay989117.lndyn.com/BTC/UILNURL/pay/lnaddress/pedromvpg?amount=1000&nostr=%7B%22id%22%3A%22da4036f7220a39ac48bb6497b1090048f49ee078d8677bec4aef6490f2b95a25%22%2C%22sig%22%3A%22d11193e5e90ce9975447678c43dbc470f5113688b2d008f8b5c539a7afbb9c895c41a30c097c44ccfc6ce26ddae0fed527837c62be8c20b0905cabe17ac9486d%22%2C%22pubkey%22%3A%2297f848adcc4c6276685fe48426de5614887c8a51ada0468cec71fba938272911%22%2C%22created_at%22%3A1743989620%2C%22kind%22%3A9734%2C%22tags%22%3A%5B%5B%22relays%22%2C%22wss%3A%2F%2Fbostr.lightningspore.com%22%2C%22wss%3A%2F%2Frelay-nwc-dev.rizful.com%2Fv1%22%2C%22wss%3A%2F%2Fbrb.io%2F%22%2C%22wss%3A%2F%2Feden.nostr.land%2F%22%2C%22wss%3A%2F%2Fnos.lol%2F%22%2C%22wss%3A%2F%2Fnostr-pub.semisol.dev%2F%22%2C%22wss%3A%2F%2Fnostr.orangepill.dev%2F%22%2C%22wss%3A%2F%2Fnostr.zebedee.cloud%2F%22%2C%22wss%3A%2F%2Foffchain.pub%2F%22%2C%22wss%3A%2F%2Fpuravida.nostr.land%2F%22%2C%22wss%3A%2F%2Fpyramid.fiatjaf.com%2F%22%2C%22wss%3A%2F%2Frelay.current.fyi%2F%22%2C%22wss%3A%2F%2Frelay.damus.io%2F%22%2C%22wss%3A%2F%2Frelay.snort.social%2F%22%2C%22wss%3A%2F%2Fnostr.wine%2F%22%2C%22wss%3A%2F%2F140.f7z.io%2F%22%2C%22wss%3A%2F%2Frelay.f7z.io%2F%22%2C%22wss%3A%2F%2Frelay.primal.net%2F%22%5D%2C%5B%22amount%22%2C%221000%22%5D%2C%5B%22lnurl%22%2C%22https%3A%2F%2Fbtcpay989117.lndyn.com%2F.well-known%2Flnurlp%2Fpedromvpg%22%5D%2C%5B%22p%22%2C%228cd2d0f8310f7009e94f50231870756cb39ba68f37506044910e2f71482b1788%22%5D%2C%5B%22e%22%2C%22b8a8ca5154b2725b6810df191f9d399ede245c0e79fd5bae94a19456711ddc66%22%5D%5D%2C%22content%22%3A%22%E2%9C%A8%22%7D&lnurl=LNURL1DP68GURN8GHJ7CN5VDCXZ7FE8QUNZVFH9EKXUEREDCHXXMMD9UH8WETVDSKKKMN0WAHZ7MRWW4EXCUP0WPJKGUN0D4M8QECJMRCWV ........ and here is a callback URL that DOES work... https://btcpay989117.lndyn.com/BTC/UILNURL/pay/lnaddress/pedromvpg?amount=1000&nostr=%7B%22id%22%3A%226ffa1ef877d86d62c1c7813c42e699e916fe53ccfc277740524a14a8bd25c719%22%2C%22sig%22%3A%2208c4924fc86875a7384a62bbe3eee72165b82789a63a8dacb9bce722a8c23fce638b8339075a4b184f347ec5992dc1f77ca74b649c31613c39f636a7c02bae93%22%2C%22pubkey%22%3A%2297f848adcc4c6276685fe48426de5614887c8a51ada0468cec71fba938272911%22%2C%22created_at%22%3A1743989580%2C%22kind%22%3A9734%2C%22tags%22%3A%5B%5B%22relays%22%2C%22wss%3A%2F%2Fbostr.lightningspore.com%22%2C%22wss%3A%2F%2Frelay-nwc-dev.rizful.com%2Fv1%22%2C%22wss%3A%2F%2Fbrb.io%2F%22%2C%22wss%3A%2F%2Feden.nostr.land%2F%22%2C%22wss%3A%2F%2Fnos.lol%2F%22%5D%2C%5B%22amount%22%2C%221000%22%5D%2C%5B%22lnurl%22%2C%22https%3A%2F%2Fbtcpay989117.lndyn.com%2F.well-known%2Flnurlp%2Fpedromvpg%22%5D%2C%5B%22p%22%2C%228cd2d0f8310f7009e94f50231870756cb39ba68f37506044910e2f71482b1788%22%5D%2C%5B%22e%22%2C%22b8a8ca5154b2725b6810df191f9d399ede245c0e79fd5bae94a19456711ddc66%22%5D%5D%2C%22content%22%3A%22%E2%9C%A8%22%7D&lnurl=LNURL1DP68GURN8GHJ7CN5VDCXZ7FE8QUNZVFH9EKXUEREDCHXXMMD9UH8WETVDSKKKMN0WAHZ7MRWW4EXCUP0WPJKGUN0D4M8QECJMRCWV ..... you can see that the callback URL that DOES work is SHORTER...

I'm confused about the URL, why doesn't it start with pay . sprovoost . nl?

Will look into it more tomorrow(ish) after the conference...

There are two URLs in the Nip-57 dance.... the first URL... https://btcpay989117.lndyn.com/.well-known/lnurlp/pedromvpg .. and then you use the "callback" url provided in this response.... and you shove an entire NOSTR event onto that URL! It's pretty ugly but it works!

And yes, the failing URL shows the error: "Lightning node could not generate invoice with description hash:" ... basically, your lightning node is refusing to generate the invoice because it doesn't like the description you provided.... I think it's because it is too long...

I think your "callback url" implementation is rejecting encoded nostr events which are too long ... these events can get too long (in characters) if there are a lot of relays.... the relevant part of the spec is here: https://github.com/nostr-protocol/nips/blob/3e8c33ee79e3d2eb46ca498eddadcc6ef1ef7329/57.md?plain=1#L31

I assume it's a bug in the nostr:npub155m2k8ml8sqn8w4dhh689vdv0t2twa8dgvkpnzfggxf4wfughjsq2cdcvg plugin? Either that or in my nginx redirect rules.

Look at the "protocol flow" here and you'll see actually to pay a zap, you need to make TWO get requests... https://github.com/nostr-protocol/nips/blob/master/57.md

This is why it "works in the browser" -- because using, for example, Yakihonne, it only adds like 3 to 5 relay URLs... but in my URL, I am adding like 20 relay URLs.....

I actually ran into this error myself previously! I think this part of the spec is not well-worded: https://github.com/nostr-protocol/nips/blob/3e8c33ee79e3d2eb46ca498eddadcc6ef1ef7329/57.md?plain=1#L124 "the generation of the description hash invoice" .... I think that your implementation is actually putting the entire Nostr event (as a string) into the the description of the invoice... and for example LND won't allow a description over a certain number of characters! (It's a DOS vulnerability if its too long)...... So your implementation just needs to put the HASH of the nostr event into the description, not the full NOSTR event!

The place for you to start is this step in NIP-57 ..https://github.com/nostr-protocol/nips/blob/3e8c33ee79e3d2eb46ca498eddadcc6ef1ef7329/57.md?plain=1#L19 .. anyway you can test it with the LONG & FAILING url I provided previously....