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

ln: use total_msat to calculate the amount for our next trampoline

Public commit record

What the developer wrote

Authored by Carla Kirk-Cohen

85/100 · Strong
ln: use total_msat to calculate the amount for our next trampoline

For regular blinded forwards, it's okay to use the amount in our
update_add_htlc to calculate the amount that we need to foward onwards
because we're only expecting on HTLC in and one HTLC out.

For blinded trampoline forwards, it's possible that we have multiple
incoming HTLCs that need to accumulate at our node that make our total
incoming amount from which we'll calculate the amount that we need to
forward onwards to the next trampoline. This commit updates our next
trampoline amount calculation to use the total intended incoming amount
for the payment so we can correctly calculate our next trampoline's
amount.

`decode_incoming_update_add_htlc_onion` is left unchanged because
the call to `check_blinded` will be removed in upcoming commits.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a bug in how the Lightning Dev Kit calculates the amount to forward when acting as a trampoline node for blinded multi-path payments. Previously, the code used the amount from a single incoming payment packet, which could be too small when several partial payments are meant to combine. The fix uses the intended total payment amount instead, preventing the node from rejecting or misrouting trampoline forwards that arrive in multiple pieces.

Recommended action

Review whether this bug could have caused live trampoline forwards to fail or be rejected, and consider backporting to maintained release branches that support blinded trampoline forwarding. No immediate emergency response is indicated, but users relying on trampoline routing should upgrade.

Security signals we found

01

Logic error in payment amount validation for blinded trampoline forwards

02

Multi-path payment (MPP) aggregation not accounted for in forward amount calculation

03

Potential incorrect HTLC rejection or under-forwarding for trampoline payments

04

Fix uses aggregate total_msat rather than single incoming HTLC amount

Risk score

Why this scored 59/100

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