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

Merge pull request #11532 from bitromortac/20261104-2742-dispatch

Public commit record

What the developer wrote

Authored by bitromortac

73/100 · Adequate
Merge pull request #11532 from bitromortac/20261104-2742-dispatch

bolt12handler+invoices: carry the invoice envelope in payment paths
✓ 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 adds a new BOLT 12 feature to the LND Lightning node. It lets the node embed a small encrypted 'invoice envelope' inside the final hop of a blinded payment path, and derives the payment preimage from a new 'path id' key instead of storing it immediately. This is a design change toward stateless BOLT 12 invoice settlement. The commit also adds a development-only SQL side table for BOLT 12 invoices and changes how offer/invoice hashes are computed so that blinded paths are not included in the signed hash. The release notes explicitly note that callers with the signer:generate permission can now derive every BOLT 12 preimage the node issues, which is a deliberate permission-scope change, not a hidden bug.

Recommended action

Reviewers should verify the HMAC-based preimage derivation is sound and that the path id cannot be verified under the zero key. Confirm that the signer:generate permission scope change is acceptable to the project and documented. Ensure the new SQL side table is only created/queried when BOLT 12 development migrations are enabled, and that the invoice envelope validation on AddInvoice cannot be bypassed. Because settlement logic is noted as coming in a later change, this commit should not be treated as a complete security fix but as an incremental feature that introduces new key material and trust assumptions.

Security signals we found

01

New cryptographic key derivation (PathIDKey) from ECDH with a fixed public point and tagged HMAC for path ids/preimages.

02

Payment preimage is no longer randomly generated but deterministically derived from path id and envelope binding; any flaw in the derivation would let an attacker compute preimages.

03

Invoice envelope is carried in encrypted_recipient_data as a custom TLV (65538) and bound to the path id; tampering with envelope bytes changes the binding and invalidates the path id/preimage check.

04

Release notes explicitly disclose that signer:generate permission now allows derivation of all BOLT 12 preimages, widening that permission's scope.

05

BOLT 12 side table is gated behind a development migration and a store option; without it, BOLT 12 invoices are rejected.

06

Validation prevents BOLT 12 + AMP invoices and requires a decodable envelope on add.

07

Payer note is truncated to 64 bytes in the envelope to limit onion size; the full note is still mirrored in the signed invoice sent to the payer.

Risk score

Why this scored 34/100

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