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

Add a `counterparty_node_id` to `ClaimedHTLC` in claimed events

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Add a `counterparty_node_id` to `ClaimedHTLC` in claimed events

When we claim a payment, `Event::PaymentClaimed` contains a list of
the HTLCs we claimed from as `ClaimedHTLC` objects. While they
include a `channel_id` the pyment came to us over, in theory
`channel_id`s aren't guaranteed to be unique (though in practice
they are in all opened channels aside from 0conf ones with a
malicious counterparty). Further, our APIs often require passing
both the `counterparty_node_id` and the `channel_id` to do things
to chanels.

Thus, here we add the missing `counterparty_node-id` to
`ClaimedHTLC`.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds extra identifying information (the counterparty's public node ID) to payment claim events in the Lightning Dev Kit. It is a defensive API improvement, not a fix for an active exploit. The change helps downstream applications reliably identify which channel partner sent a payment, especially in edge cases where channel IDs could overlap. No security vulnerability is directly patched here.

Recommended action

Treat as a routine API/observability improvement. Downstream consumers should update to use the new `counterparty_node_id` field when correlating claimed HTLCs with channels, but no urgent security deployment is required. Review whether any internal logic relies solely on `channel_id` uniqueness and should now also check `counterparty_node_id`.

Security signals we found

01

Adds counterparty_node_id to Event::PaymentClaimed/ClaimedHTLC to disambiguate channel identity

02

Commit message references non-unique channel_id risk from malicious 0conf counterparties

03

Backward-compatible TLV serialization for new optional field

04

No direct memory-safety, cryptographic, or consensus bug is fixed

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.