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

Replace existing MPP-total args with `RecipientOnionFields`

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Replace existing MPP-total args with `RecipientOnionFields`

In some uses of LDK we need the ability to send HTLCs for only a
portion of some larger MPP payment. This allows payers to make
single payments which spend funds from multiple wallets, which may
be important for ecash wallets holding funds in multiple mints or
graduated wallets which hold funds across a trusted wallet and a
self-custodial wallet.

In the previous commit we added a new field to
`RecipientOnionFields` to describe the total value of an MPP
payment. Here we start using this field when building onions,
dropping existing arguments to onion-building methods.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit is a code cleanup and feature-enabling refactor in the Lightning Dev Kit (LDK). It moves the total amount for multi-path payments (MPP) out of individual function arguments and into a structured object called `RecipientOnionFields`. This makes it possible for future callers to send partial payments that add up to a larger total, which is useful for wallets that hold funds in multiple places. The commit itself does not appear to fix a known bug or vulnerability; it is preparation for a new capability.

Recommended action

No immediate security action required. Reviewers should verify that all call sites now correctly populate `RecipientOnionFields::total_mpp_amount_msat` and that no production path accidentally omits or missets the total. Because this is a partial commit in a series, monitor subsequent commits for the actual partial-MPP logic and any associated validation.

Security signals we found

01

Refactor centralizes MPP total amount in `RecipientOnionFields`, reducing risk of inconsistent total values being passed to onion construction

02

Removal of duplicate `total_msat` arguments eliminates a class of API misuse where caller-provided total could differ from recipient onion total

03

No direct fix for memory safety, cryptographic flaw, or consensus bug is visible in the diff

04

Change is part of a larger feature (partial MPP payments from multiple wallets) and may have follow-up commits with additional security implications

Risk score

Why this scored 34/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/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.