support decoding uppercase bolt11 values #9
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to https://docs.lightning.engineering/the-lightning-network/payment-lifecycle/understanding-lightning-invoices:
"Lightning Network invoices, like other bech32 encoded strings, are typically entirely lowercase. However, there are significant space improvements when encoding uppercase characters only in QR codes, which is why you might encounter uppercase Lightning invoices more frequently. This is also why a Lightning invoice QR code might decode as uppercase only."
So I think this should support decoding also uppercase invoices.
For example Zeus generates invoices in uppercase for QR codes, and when I pay directly with my LND it lands on my list of payments as uppercase.
Then when using for example nostr-wallet-connect for listing transactions (new extensions), it uses this lib for bolt11 decoding and it can't decode.
I think instead of forcing each dependency to remember to lowercase the bolt11 before decoding it, we could just lowercase it here.