AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 63 Bitcoin

Use BOLT11 invoice payee keys for payment params

Public commit record

What the developer wrote

Authored by Elias Rohrer

73/100 · Adequate
Use BOLT11 invoice payee keys for payment params

Payment parameters should use the canonical payee key from BOLT11
invoices. When an invoice includes an n field, using that key avoids
attempting signature recovery that may legitimately be unavailable.

Co-Authored-By: HAL 9000

This finding was discovered by Project Loupe
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in how Lightning payment parameters are built from BOLT11 invoices. Previously, the code always tried to recover the payee's public key from the invoice signature, even when the invoice already explicitly included the payee's key. Signature recovery can fail or produce the wrong key in some legitimate cases, such as when the recovery ID byte is altered. The fix makes payment routing use the explicitly included payee key when available, falling back to signature recovery only when needed. This prevents potential payment routing failures or misrouting caused by relying on recoverable signatures.

Recommended action

Review and merge the patch. After deployment, ensure that any code paths constructing PaymentParameters from BOLT11 invoices use the updated method. Consider auditing other uses of recover_payee_pub_key across the codebase to confirm they should still perform recovery rather than preferring explicit keys.

Security signals we found

01

BOLT11 invoice payee public key derivation changed from signature recovery to explicit key preference

02

PaymentParameters::from_bolt11_invoice now uses get_payee_pub_key instead of recover_payee_pub_key

03

Test cases demonstrate handling of invoices with valid included payee key but invalid recovery ID

04

Commit message notes signature recovery may legitimately be unavailable

05

Finding attributed to external discovery by Project Loupe

Risk score

Why this scored 63/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 12/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.