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

graph/db: make some ChannelEdgeInfo fields optional

Public commit record

What the developer wrote

Authored by Elle Mouton

73/100 · Adequate
graph/db: make some ChannelEdgeInfo fields optional

Since not all will be required for V2 channels.

Wrap BitcoinKey1Bytes and BitcoinKey2Bytes in fn.Option since these
fields are only required for v1 channel announcements. V2 channels may
or may not have bitcoin keys present in their announcement.

NewV1Channel constructor wraps the bitcoin keys with fn.Some().
All access sites updated to unwrap the options, using UnwrapOr for
non-critical paths and UnwrapOrErr where the keys must be present
(e.g., KV serialization, ToChannelAnnouncement).
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit changes how Lightning Network channel announcement data is stored so that two public-key fields (BitcoinKey1Bytes and BitcoinKey2Bytes) are now optional rather than always required. This is preparation for a newer channel-announcement format (V2) where those keys may not be present. The change itself is a data-model refactor, not a fix for an active bug or vulnerability. It adds explicit error handling when those keys are unexpectedly missing in places that still require them, which is a defensive improvement.

Recommended action

Treat as a routine refactor. Reviewers should verify that all V1 code paths requiring bitcoin keys now correctly error when keys are None, and that V2 paths do not accidentally rely on these keys being present. Pay attention to UnwrapOr fallback sites (e.g., genMultiSigP2WSH) to ensure they are never reached with absent keys in production.

Security signals we found

01

Data model change from required to optional public-key fields

02

Addition of explicit error handling (UnwrapOrErr) on required serialization/announcement paths

03

Potential for zero-value public keys to be used in multi-sig script generation when keys are absent (UnwrapOr route.Vertex{})

04

No mention of CVE, bug bounty, or security advisory in commit message

Risk score

Why this scored 20/100

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