Closed
Description
Currently the value in the "x-preimage" header is required to be Base64, because that's the format that's used in listed invoices when executing lncli listinvoices
. Not only for preimages, but also for their hashes.
But on the other hand the LightningClient
's method LookupInvoice(...)
expects a hex-encoded payment hash.
That's why in our package, when receiving a request with a correct x-preimage header, we need to:
- Base64 Decode the preimage
- Sha256 the previous value
- Hex the previous value
- Send it to lnd
So:
- Figure out which format is best for using in the header (Plain preimage, Base64 or hex)
- Change our implementation in case it's not Base64
- Document which format is expected
Activity