Skip to content

signer: Use case-insensitive comparison for bolt11 invoices#698

Merged
cdecker merged 2 commits intomainfrom
2026w15-case-insensitive-invoice
Apr 14, 2026
Merged

signer: Use case-insensitive comparison for bolt11 invoices#698
cdecker merged 2 commits intomainfrom
2026w15-case-insensitive-invoice

Conversation

@cdecker
Copy link
Copy Markdown
Collaborator

@cdecker cdecker commented Apr 12, 2026

Summary

  • BOLT11 invoices use bech32 encoding which is case-insensitive (per BIP173), but the signer resolver was comparing invoice strings byte-for-byte
  • Uppercase invoices (e.g. LNBC1...) would fail to match their lowercase counterparts, causing the signer to reject valid PreapproveInvoice requests
  • Fixed all three PreapproveInvoice match arms in resolve.rs to use eq_ignore_ascii_case()

Test plan

  • Verify signer accepts PreapproveInvoice for uppercase bolt11 strings
  • Verify signer still accepts lowercase bolt11 strings (no regression)
  • Verify mixed-case bolt11 strings are accepted

🤖 Generated with Claude Code

cdecker and others added 2 commits April 12, 2026 18:16
BOLT11 invoices use bech32 encoding which is case-insensitive per
BIP173. Some implementations normalize to uppercase, causing the
signer resolver to reject valid PreapproveInvoice requests when the
invoice casing differs between the signer request and the context
request.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cdecker cdecker merged commit 9de3eca into main Apr 14, 2026
22 of 23 checks passed
@cdecker cdecker deleted the 2026w15-case-insensitive-invoice branch April 14, 2026 10:59
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.

1 participant