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

Merge pull request #11636 from bitromortac/20261111-1e97-dispatch

Public commit record

What the developer wrote

Authored by Yong

73/100 · Adequate
Merge pull request #11636 from bitromortac/20261111-1e97-dispatch

multi: settle BOLT 12 invoices, Open event when the row is stored
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit enables LND to actually receive and settle payments for BOLT 12 offers. Previously, LND could issue BOLT 12 invoices but did not store them or settle HTLCs against them. The key change is that the invoice is now reconstructed from data carried by the first incoming payment (HTLC), stored in the database, and then settled like a normal invoice. The commit also removes the old behavior of sending an 'Open' invoice event when the invoice is issued; instead, the Open event is sent when the invoice row is stored on first HTLC arrival. There are several TODOs left, including around garbage collection of canceled BOLT 12 invoices and context handling.

Recommended action

Reviewers and operators should treat this as a significant BOLT 12 feature completion with security-relevant state machine changes. Recommended: (1) audit the Reconstructor for any bypass of path-ID authentication or price checks, (2) ensure the canceled-invoice GC TODO does not allow unintended re-settlement of already-paid/canceled BOLT 12 invoices, (3) replace context.TODO() with proper context propagation in NotifyExitHopHtlc and reconstruction paths, (4) verify that partial/failing HTLC sets cannot be abused to create many open BOLT 12 rows (DoS/resource exhaustion), (5) run the new integration test testBolt12ReceiveSettle and the full BOLT 12 test matrix before release.

Security signals we found

01

New authentication boundary: BOLT 12 invoice reconstruction requires payment path ID to authenticate the invoice envelope, preventing payers from forging or modifying invoices.

02

Offer state re-check on later HTLCs: a disabled offer after the first shard will cause subsequent shards to fail, preventing settlement of invoices for disabled offers.

03

Expiry re-check on later HTLCs: invoices that expire before the MPP set completes are refused for new shards (with replay-safe handling for already-accepted shards).

04

Amount/price validation: reconstructed invoice amount must meet or exceed offer_amount * quantity, and currency-priced offers are rejected at reconstruction.

05

Removal of unindexed BOLT 12 event dispatch: previously BOLT 12 Open events had no database row/add index; now events are tied to stored rows, improving consistency and replay/backlog behavior.

06

TODO noted: canceled-invoice GC can delete a canceled BOLT 12 invoice, allowing later payment over the same blinded path to rebuild and potentially settle until expiry.

07

TODO noted: context.TODO() used in reconstruction and offer-active checks because NotifyExitHopHtlc does not yet take a context.

Risk score

Why this scored 60/100

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