invoice::classify refuses a Lightning address whose user starts with lnbc, lntb or lnsb
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The bug is in invoice::classify in rust/src/api/invoice.rs, where the BOLT11_PREFIXES check runs before the Lightning address check. Read the classify function, the BOLT11_PREFIXES constant and is_lightning_address, then find the existing classify tests for invoices and addresses. Done when an address such as [email protected] or [email protected] classifies as LightningAddress, and the existing BOLT11 invoice classifications are unchanged.
Written by the indexing model from the issue text.
Description
What happens
invoice::classify (rust/src/api/invoice.rs) checks the BOLT11 prefixes before it checks for a Lightning address:
let lower = bare.to_ascii_lowercase();
if BOLT11_PREFIXES.iter().any(|p| lower.starts_with(p)) {
return match summarize(bare) {
Some(summary) => PaymentDestination::Bolt11(summary),
None => PaymentDestination::MalformedBolt11,
};
}
if is_lightning_address(&lower) { ... }
So a valid LUD-16 address whose user part starts with lnbc, lntb or lnsb (for example [email protected] or [email protected]) is classified as MalformedBolt11, never as LightningAddress.
Where it shows
Every path that judges a payout destination with classify refuses such an address:
- the buyer's add-invoice screen (
check_buyer_invoice), with the "malformed invoice" error; orders::send_invoiceand the NWC payer (InvalidInvoice);- a take with
TakePayout::Address(resolve_take_payout,InvalidLightningAddress); - the default address in Settings, since #824 judges it with the same rule.
Expected
The address is accepted as a LightningAddress. A BOLT11 invoice is bech32 and never contains @, so checking for @ (or is_lightning_address) before the BOLT11 prefixes would fix it without changing how any invoice is classified.
Found while fixing a review comment on #824.
- Dominant language
- Dart
- Stars
- 11
- Forks
- 9
- Avg merge
- 18h 25m
- Merged PRs (30d)
- 194
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MostroP2P/app
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area: ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
area: ui feature priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
MostroP2P/app#124 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Docs: correct the unbuilt "full re-verify" claim and three untrue sync commentsPossibly taken @ibanner56 claimed this today. Openarea: sync priority: low severity: trivial type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ibanner56/CallersCompendium#1942 ·
Maintainers usually reply within 1 day
-
[Bug]: 编辑器替换栏关闭按钮错位Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
appshubcc/Bettbox#584 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
transistorsoft/flutter_background_geolocation#1724 · 1 comment ·
-
bug UI: Fluent
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Notsfsssf/pixez-flutter#1430 ·
Maintainers usually reply within 1 day