Skip to content

fix: strip lightning scheme prefix from scanned QR codes#767

Draft
jvsena42 wants to merge 1 commit intomasterfrom
fix/lnurl-decoding
Draft

fix: strip lightning scheme prefix from scanned QR codes#767
jvsena42 wants to merge 1 commit intomasterfrom
fix/lnurl-decoding

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Feb 6, 2026

Fixes #764

This PR fixes LNURL-pay QR code scanning failing with "Decoding error" when the QR code contains a LIGHTNING: URI scheme prefix.

Description

Some wallets and services generate LNURL QR codes with a LIGHTNING: URI scheme prefix (per BOLT specs). The bitkit-core decoder doesn't handle these prefixes, causing the scan to fail.

The app already had a removeLightningSchemes() workaround for deep links, but it wasn't applied to the QR scanner path and didn't handle the LIGHTNING: prefix. This PR:

  1. Moves scheme stripping into handleScan() so all input paths benefit (QR scanner, paste, manual entry, deep links)
  2. Adds lightning: prefix handling with case-insensitive matching

Preview

QA Notes

  1. Scan an LNURL-pay QR code that includes the LIGHTNING: prefix (e.g. LIGHTNING:LNURL1DP68GURN...)
    • Expected: decodes correctly and shows the LNURL pay flow
    • Before fix: showed "Decoding error, unable to interpret provided data"
  2. Scan a plain LNURL QR code without prefix (e.g. LNURL1DP68GURN...)
    • Expected: still works as before
  3. Scan a regular Lightning invoice QR code
    • Expected: still works as before
  4. Test deep link with lnurl: scheme prefix
    • Expected: still works as before

@jvsena42 jvsena42 self-assigned this Feb 6, 2026
@jvsena42
Copy link
Member Author

jvsena42 commented Feb 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LNURL-pay fails with decoding error in Bitkit

1 participant