Skip to content

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

Open
jvsena42 wants to merge 4 commits intomasterfrom
fix/lnurl-decoding
Open

fix: strip lightning scheme prefix from scanned QR codes#767
jvsena42 wants to merge 4 commits 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

Screen_recording_20260209_111526.mp4

QA Notes

  1. Scan an LNURL-pay QR code that includes the LIGHTNING: prefix (e.g. LIGHTNING:LNURL1DP68GURN8GHJ7D3N8YCRYVFKXQUKZTNY9EMX7MR5V9NK2CTSWQHXJME0D3H82UNVV3JHV6TRV5HKZURF9AMRYTMVDE6HYMP0VCE9J73N2DUXU4ZZXDHH54T0G9KN2AN689JN7URFDC7NGDPXV9KK7ATWWS7NZT34YEJ82UNPW35K7M3AXYCRQVPXWESHY6TPVFKX202XV9K8XEFXVDHK6MT9DE6R63NPD3EK2W5G3V4)
    • 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

@jvsena42 jvsena42 marked this pull request as ready for review February 9, 2026 13:38
@claude

This comment has been minimized.

1 similar comment
@claude

This comment has been minimized.

@claude

This comment has been minimized.

@jvsena42 jvsena42 marked this pull request as draft February 9, 2026 14:14
@jvsena42 jvsena42 marked this pull request as ready for review February 9, 2026 14:18
@jvsena42 jvsena42 requested a review from ovitrif February 9, 2026 14:19
@jvsena42 jvsena42 enabled auto-merge February 9, 2026 14:36
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