brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
lightning-amp-mppMulti-Path Payments (MPP) — split a payment across multiple parallel routes; same payment hash, payment_secret binds parts. AMP (Atomic Multipath) — variant where each part has different hash; receiver derives shared secret. USE WHEN: implementing payment splitting, debugging "couldn't route full amount", evaluating MPP vs AMP.
Independent GitHub snapshot · Automated classification · Original documentation governs
When a single channel can't carry the full payment amount or no single path has enough liquidity, the sender splits the payment.
Split into N parts, each with the same payment hash and
payment_secret (BOLT 11 's' tag).
Receiver's wallet:
total_msat = X, this part's amount.sum(amounts) >= total_msat, atomically fulfills all HTLCs
with the preimage.If timeout reached and not enough collected: fail all parts. Funds return to sender (minus any that already timed out on chain).
Each part has a different payment hash (payment_hash_i),
derived from a master secret + per-part nonce:
master_secret = random
payment_secret_i = HKDF(master_secret, i)
payment_hash_i = SHA256(payment_secret_i)
Receiver:
master_secret (Shamir-like) → derive each part's preimage →
fulfill atomically.AMP supports "spontaneous payments" (keysend-AMP) where sender doesn't need a pre-issued invoice.
Single-path:
MPP:
Pick split sizes:
Most impls: 4-16 parts max, sized to channel capacity constraints.
| Impl | Basic MPP | AMP keysend |
|---|---|---|
| LND | yes | yes |
| CLN | yes | partial |
| LDK | yes | yes |
| Eclair | yes | partial |
payment_secret not included in invoice → MPP receiver fails:
cannot bind parts.Each in-flight HTLC consumes an HTLC slot per channel (default
max 483 from accept_channel's max_accepted_htlcs). MPP across
many small parts fills slots fast.