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

Fix trampoline error packet encryption using trampoline shared secret

Public commit record

What the developer wrote

Authored by Maurice

73/100 · Adequate
Fix trampoline error packet encryption using trampoline shared secret

When handling HTLC failures in trampoline routing, error packets were not
being properly encrypted with the trampoline shared secret. This caused
error messages to be unreadable by the original sender when failures
occurred within trampoline hops.

The fix prioritizes trampoline_shared_secret over phantom_shared_secret
when both are available, ensuring error packets can be properly decrypted
by trampoline senders.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in the Lightning Dev Kit where failure messages for trampoline-routed payments were encrypted with the wrong secret. As a result, the original sender could not read error messages when a payment failed inside a trampoline route. The fix makes the code use the trampoline-specific shared secret for encrypting those failure messages, falling back to the phantom secret only when no trampoline secret is available.

Recommended action

Review whether any additional failure paths (e.g., trampoline combined with phantom/MPP edge cases) also need the trampoline shared secret, and consider adding regression tests that verify failure packets are decryptable by trampoline senders. The TODO in the commit suggests the trampoline+phantom double-wrap case is not yet handled.

Security signals we found

01

Wrong shared secret used for failure-packet encryption in trampoline routing

02

Trampoline senders unable to decrypt failure messages

03

New secret field threaded through HTLC state and serialization

04

Prioritization of trampoline secret over phantom secret when both present

05

TODO comment notes incomplete handling of trampoline+phantom combined case

Risk score

Why this scored 57/100

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