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

Add a `payment_metadata` map in BOLT 12 blinded message path ctxs

Public commit record

What the developer wrote

Authored by Matt Corallo

83/100 · Strong
Add a `payment_metadata` map in BOLT 12 blinded message path ctxs

Similar to how BOLT 11 payments can use a `payment_metadata` to
provide arbitrary bytes in the invoice to be communicated back to
them when receiving, its useful to be able to provide some bytes
which are communicated back upon receiving a payment.

Here we do so in the BOLT 12 blinded message path contexts,
offering a `BTreeMap<u64, Vec<u8>>` instead to enable more easily
including multiple sets of data.

We don't yet wire it up to the public `ChannelManager` API, but do
allow selecting values for those using the manual
`OffersMessageFlow`.

Tests by claude
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit adds a new optional field called payment_metadata to BOLT 12 invoice request contexts in the Lightning Dev Kit. It lets payment recipients attach small pieces of custom data to an offer, which are then copied into the invoice and returned to them when a payment arrives. The change is a feature addition, not a bug fix, and the commit message and code comments explicitly warn that the metadata must stay small or payments could fail to route. There is no indication in the commit that this resolves a security vulnerability.

Recommended action

Treat as a normal feature commit. If reviewing for production use, verify that downstream code enforces size limits on payment_metadata before it reaches the onion, since the commit only documents the risk and does not add explicit length or total-size caps.

Security signals we found

01

New optional user-controlled byte field added to BOLT 12 path contexts

02

Metadata is propagated into invoice blinded payment paths and surfaced in PaymentClaimable events

03

Commit message and comments warn that large metadata can make payments unpayable or QR codes too large

04

No bounds check on individual value length or total map size is visible in the diff

05

No public ChannelManager API yet exposed, limiting how callers can set metadata

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/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.