Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

invoice::classify refuses a Lightning address whose user starts with lnbc, lntb or lnsb

Open Beginner friendly
#826 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
payments

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

area: rust-core bug priority: low

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_invoice and 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MostroP2P/app

All issues in MostroP2P/app

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.