lightning-amp-mpp
Multi-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.
What this skill does
# MPP and AMP When a single channel can't carry the full payment amount or no single path has enough liquidity, the sender splits the payment. ## MPP (Multi-Path Payments) — BOLT 9 bit 16 Split into N parts, each with the **same** payment hash and `payment_secret` (BOLT 11 's' tag). Receiver's wallet: 1. Receives first HTLC; sees `total_msat = X`, this part's amount. 2. Holds HTLC; doesn't fulfill yet. 3. Waits for more parts to arrive (with same payment_secret). 4. When `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). ## AMP (Atomic Multipath) — BOLT 9 bit 18 (semi-deprecated) 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: 1. Receives first part; cannot derive preimage yet. 2. As more parts arrive, accumulates info. 3. Once enough parts arrive (≥ k threshold), can derive `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. ## When to use MPP vs single-path Single-path: - Sufficient channel capacity exists. - Lower overhead (1 HTLC, 1 onion). - Easier to reason about. MPP: - Total amount exceeds single-channel capacity. - Improved success probability (split across paths with independent liquidity). - Cost: more HTLCs in flight (higher channel slot usage), longer total time. ## Split sizing strategies Pick split sizes: - **Equal split**: parts of equal size. - **Probability-weighted**: smaller parts on higher-probability routes. - **Pickhardt-flow**: optimization-based, jointly chooses parts + routes. Most impls: 4-16 parts max, sized to channel capacity constraints. ## Implementation status | Impl | Basic MPP | AMP keysend | |------|-----------|-------------| | LND | yes | yes | | CLN | yes | partial | | LDK | yes | yes | | Eclair | yes | partial | ## Common bugs - `payment_secret` not included in invoice → MPP receiver fails: cannot bind parts. - Sender splits past CLTV-block budget — total time across MPP exceeds invoice expiry. - Retry loops: failed part retried over same path → repeat failure. - Receiver fulfills before all parts arrive → partial payment, sender short-paid. ## Channel slot exhaustion 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. ## See also - [routing/SKILL.md](../routing/SKILL.md) - [htlcs/SKILL.md](../htlcs/SKILL.md) - [keysend/SKILL.md](../keysend/SKILL.md) - [bolts/SKILL.md](../bolts/SKILL.md)
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.