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

Return optional recovered BOLT11 payee keys

Public commit record

What the developer wrote

Authored by Elias Rohrer

68/100 · Adequate
Return optional recovered BOLT11 payee keys

Recovering a BOLT11 payee key can fail even when an invoice includes a
valid n field. Return the recovery result as an option and document
get_payee_pub_key as the canonical accessor.

Co-Authored-By: HAL 9000

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

What changed, and why it matters

This commit changes how a Bitcoin Lightning invoice library exposes the payee's public key. Previously, a function called recover_payee_pub_key always returned a public key, even when mathematically recovering it from the invoice signature actually failed. Now it returns an optional value (None when recovery fails), and callers are directed to a safer accessor. The change prevents callers from silently getting a wrong or misleading key, which could matter for payment security decisions.

Recommended action

Review downstream callers of recover_payee_pub_key to ensure they handle the new Option<PublicKey> return type and do not rely on the previous always-succeeding behavior. Prefer get_payee_pub_key for obtaining the invoice's intended payee key.

Security signals we found

01

API semantics changed from non-optional to optional return for a cryptographic recovery operation

02

Previous behavior could silently return an explicitly included key instead of a recovered key

03

New behavior surfaces recovery failure rather than masking it

04

Documentation now directs callers to canonical accessor get_payee_pub_key

05

Test demonstrates recovery failure case with a tampered recovery ID

Risk score

Why this scored 47/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 10/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.