AngusP / phoenixd-lnurl

Bitcoin Lightning LNURL for phoenixd
Apache License 2.0
33 stars 3 forks source link

Some Zaps do not go through #4

Closed sethforprivacy closed 6 months ago

sethforprivacy commented 6 months ago

Tested zapping from Primal, but it fails to go through.

Logs:

ln        | 2024-04-05:16:04:49  INFO       LUD-06 payRequestCallback for username='seth' sat=42 (mSat=42000)
ln        | 2024-04-05:16:04:49  INFO       Created invoice lnbc420n1pnp... externalId: '287ef4e2f1aa02aaa206958b739777df68d57d8f8c9b1258fac33a861ddd322c'
ln        | 2024-04-05:16:04:49  DEBUG      Invoice: amount_sat=42 payment_hash='ff552b1fc3b5ff6b4fbd1a610428781118b0819c7c81005f1f9cca531bced4f4' serialized='lnbc420n1pnpqtwfpp5la2jk87rkhlkknaarfssg2rczyvtpqvu0jqsqhclnn99xx7w6n6qcqpjsp5jglq7xv80nyw57e3dh0vx9qfef0rjz37xlsmeehrgvzc4etqsptq9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdr8xgurwetxx3jnye33v9snqvnpv9snyvpk8y6nsc3hxvunwdehv3nrvwryx5mkgwrx8p3njc33xg6nsenpvvenxcfcxcckgeryxveryccmqz9grzjqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glcllcyve2zdx0n9yqqqqlgqqqqqeqqjq8jea2srmt6xsyvrarls59ktwfmrshzrpw7dnva8jcpp572axa5wkvdr7ega2u8xyr0a8zvafg53u5jn4rzlcd6w47zyp4tgngar4j2cq0pgh4v'
ln        | 2024-04-05:16:04:49  INFO       172.18.0.4:33354 - "GET /lnurlp/seth/callback?amount=42000&comment=%22Onward%20%F0%9F%AB%A1%22&nostr=%7B%22id%22%3A%227f6c3777c0710a7053f74b8520636c40d02bb6ec84c10f0f0dab8e4212961af6%22%2C%22pubkey%22%3A%2258ead82fa15b550094f7f5fe4804e0fe75b779dbef2e9b20511eccd69e6d08f9%22%2C%22created_at%22%3A1712336330%2C%22kind%22%3A9734%2C%22tags%22%3A%5B%5B%22e%22%2C%225f24c951f2f687772e145a75c6a9266a0b33a08e38bcb84dc1aa60eca2a612e9%22%5D%2C%5B%22p%22%2C%2258ead82fa15b550094f7f5fe4804e0fe75b779dbef2e9b20511eccd69e6d08f9%22%5D%2C%5B%22relays%22%2C%22wss%3A%2F%2Ffilter.nostr.wine%22%2C%22wss%3A%2F%2Fnostr.milou.lol%22%2C%22wss%3A%2F%2Fnostr.mutinywallet.com%22%2C%22wss%3A%2F%2Fnostr.portemonero.com%22%2C%22wss%3A%2F%2Fnostr.sethforprivacy.com%22%2C%22wss%3A%2F%2Fnostr.wine%22%2C%22wss%3A%2F%2Fnostr.xmr.rocks%22%2C%22wss%3A%2F%2Frelay.nostr.band%22%2C%22wss%3A%2F%2Frelay.orangepill.dev%22%2C%22wss%3A%2F%2Fxmr.usenostr.org%22%5D%5D%2C%22content%22%3A%22Onward%20%F0%9F%AB%A1%22%2C%22sig%22%3A%22aa2f9178d5cbef894f4a8fe46b1f774d17e7645e28107662bac5edc8e4345817bdc16094b947a2d1340e68183250cbb3a319ef4cb6aaa0921a5fecfc66dc6b48%22%7D HTTP/1.1" 200
sethforprivacy commented 6 months ago

Nvm, I missed that Zaps aren't currently supported in the readme! Will close this.

AngusP commented 6 months ago

Edit: saw you closed as I was typing, and see you meant the Nostr side of zaps -- I've "abused" the word zap here as yep, there's currently no nostr code in here to treat these payments as actual zaps, but that's planned.


Interesting -- I tested with Phoenix (mobile) and Zeus (testnet) and Alby and they all seemed happy , so wondering if this is Primal specific?

There was part of the LNURL LUD-06 spec I was wondering about:

  1. LN WALLET Verifies that h tag in provided invoice is a hash of metadata string converted to byte array in UTF-8 encoding.

This doesn't say which hash (I assumed sha256 as it almost certainly is), and also the invoices from phoenixd don't have a h tag -- they're putting the description in a "d" tag instead (https://lndecode.com/ with the invoice from your log). I can't see a way to get it to put anything in there other than opening an issue agains Phoenixd, but also whatever I've got now worked with a few wallets (wouldn't be surprised if a lot have ignored step 7., though)