You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bolt11Payment::receive* methods should accept a Bolt11InvoiceDescription instead of a &str #325
This is needed for Fedimint lightning gateway to support creating invoices with description hashes
Unfortunately we can't do this (at least directly), as Bolt11InvoiceDescription wouldn't be exposable via our bindings. I'm also not the biggest fan of complicating the API too much here.
As other users had similar requirements (i.e., support for description hashes for longer strings), we so far had planned to simply default to a description hash if the provided string was too long (see #312).
Yes, I believe we can simply always hash it if that's supported
It would default to hashing whenever the description string length surpasses the maximum size of 639 bytes, and would include the description string otherwise. Just to make sure, this would work for your use case?
Actually the reasons we even have description hashes was on request of @benthecarman so he would have to answer if this is sufficient for his uses case - iirc it was nostr related.
If I understand correctly than the hashed metadata in knurl pay is not necessarily longer than 639 bytes, hence the above proposed solution would not work for knurl pay and therefore lightning addresses - correct?
I think @tnull proposed that ldk would hash a description longer then 639 bytes internally and then put the hash into the description hash field, leaving the description field empty.
Activity
tnull commentedon Jul 15, 2024
Unfortunately we can't do this (at least directly), as
Bolt11InvoiceDescriptionwouldn't be exposable via our bindings. I'm also not the biggest fan of complicating the API too much here.As other users had similar requirements (i.e., support for description hashes for longer strings), we so far had planned to simply default to a description hash if the provided string was too long (see #312).
Would this cover your use case, too?
m1sterc001guy commentedon Jul 15, 2024
Yes, I believe we can simply always hash it if that's supported
tnull commentedon Jul 16, 2024
It would default to hashing whenever the description string length surpasses the maximum size of 639 bytes, and would include the description string otherwise. Just to make sure, this would work for your use case?
joschisan commentedon Jul 16, 2024
Actually the reasons we even have description hashes was on request of @benthecarman so he would have to answer if this is sufficient for his uses case - iirc it was nostr related.
benthecarman commentedon Jul 16, 2024
For lightning addresses it is needed. Would be weird for me that ldk node doesn't expose the description hash, lots of different things use this.
joschisan commentedon Jul 16, 2024
Could you please elaborate how it is used in lightning addresses?
benthecarman commentedon Jul 16, 2024
The lnurl pay spec and nostr zap spec requires that the description hash is a hash of some of the data to make sure you're getting a valid invoice
joschisan commentedon Jul 16, 2024
If I understand correctly than the hashed metadata in knurl pay is not necessarily longer than 639 bytes, hence the above proposed solution would not work for knurl pay and therefore lightning addresses - correct?
benthecarman commentedon Jul 16, 2024
The hash and description are separate fields so you can't really just put the data from one in another
joschisan commentedon Jul 16, 2024
I think @tnull proposed that ldk would hash a description longer then 639 bytes internally and then put the hash into the description hash field, leaving the description field empty.