getAlby / lndhub.go

Accounting wrapper for the Lightning Network. It provides separate accounts for end-users. (LndHub compatible API written in Go)
GNU General Public License v3.0
86 stars 23 forks source link

Invoice creation: cannot add memo when using v2 endpoint? #489

Open raucao opened 4 months ago

raucao commented 4 months ago

For lnurlp and Lightning Address, we currently add a memo containing the optional payer-created "comment", so that the payee can read the comment in their transaction history. However, as per LNURL specs, the description actually has to contain a different string that is already announced before a payer can add their comment.

With the v1 endpoint addinvoice, you can add the memo property, and only a hash of the actual description (which is fine, since the wallet can display the description from the lnurlp discovery endpoint it queried beforehand). However, with the v2 endpoint /invoices, it seems that you can only give it the actual description property, but not a memo.

Basically, the question is if it's possible with the v2 endpoint to store a normal comment as the memo, while also implementing LUD-06 correctly, i.e. the description hash is a hash of a metadata array, not just a comment/text.

Maybe I'm understanding something wrong here, in which case you can just treat this issue as an informational/support/docs one.

bumi commented 4 months ago

re v2 endpoint. I think it is just a different naming. the description is the memo there is description/memo and the description_hash and the BOLT11 spec is actually pretty strange about this. and the hash should be used if the description is longer than x chars.

I think LND now allows setting both description and description_hash. but for the spec it's actually more correct to only set the description_hash.

but there is also a push to drop the description_hash in the LNURL spec: https://github.com/lnurl/luds/pull/234