offers: Allow disabling invoice response MPP
What changed, and why it matters
This commit adds a new option for Lightning invoice creators to explicitly tell payers not to use multi-path payments (MPP) when paying an invoice. It does not change any enforcement rules; it only changes what feature bits are advertised in the invoice. The existing default behavior (MPP allowed) is preserved for current callers.
No immediate security action required. Users of the new `disallow_mpp()` API should understand it only affects advertised features and ensure their receiving logic independently enforces single-path payment acceptance if that is their security requirement.
Security signals we found
New API surface for feature advertisement control
Explicit documentation that the method does not enforce single-HTLC receipt, shifting enforcement responsibility to callers
No removal or weakening of existing validation logic
No incident or vulnerability disclosure referenced in commit or materials
Evidence from the diff
The patch introduces a disallow_mpp() builder method in invoice_macros.rs that clears the basic_mpp feature bit from the invoice’s advertised features. The existing method that sets basic_mpp_optional() remains unchanged, preserving the default MPP-enabled behavior. The documentation explicitly states this controls advertisement only and does not enforce single-HTLC receipt.
Changed components
lightning/src/offers/invoice_macros.rsLDK Offers invoice request/response builder APIInspect captured patch +9 / −0
diff --git a/lightning/src/offers/invoice_macros.rs b/lightning/src/offers/invoice_macros.rs
index 1ac6e40..0f21024 100644
--- a/lightning/src/offers/invoice_macros.rs
+++ b/lightning/src/offers/invoice_macros.rs
@@ -80,6 +80,15 @@ macro_rules! invoice_builder_methods_common { (
$invoice_fields.features.set_basic_mpp_optional();
$return_value
}
+
+ #[doc = concat!("Sets [`", stringify!($invoice_type), "::invoice_features`]")]
+ #[doc = "to indicate MPP must not be used."]
+ ///
+ /// This only controls what the invoice advertises. It does not enforce single-HTLC receipt.
+ pub fn disallow_mpp($($self_mut)* $self: $self_type) -> $return_type {
+ $invoice_fields.features.clear_basic_mpp();
+ $return_value
+ }
} }
#[cfg(test)]
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.