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

netann: update ChanAnn2 validation to work for P2WSH channels

Public commit record

What the developer wrote

Authored by Elle Mouton

65/100 · Adequate
netann: update ChanAnn2 validation to work for P2WSH channels

This commit expands the ChannelAnnouncement2 validation for the case
where it is announcing a P2WSH channel.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit updates how LND validates a new style of Lightning channel announcement (ChannelAnnouncement2) so it correctly handles both older P2WSH-style channels and newer P2TR (Taproot) channels. Before this change, the validation logic appears to have assumed P2TR channels, which could have caused LND to reject valid announcements for older P2WSH channels or, in the worst case, accept invalid ones. The change also switches the gossiper from using a raw chain hash to carrying full chain parameters, which is needed to interpret on-chain scripts correctly.

Recommended action

Review the new P2WSH validation branch for correct MuSig2 key ordering and sorted-key semantics, ensure `fetchPKScript` cannot be induced to return a misleading script class via a reorg or stale UTXO lookup, and confirm that all callers of the changed `Config.ChainHash` field have been migrated to `ChainParams`.

Security signals we found

01

Validation bypass or denial-of-service risk if ChannelAnnouncement2 for P2WSH channels was incorrectly rejected or accepted

02

Change in cryptographic key aggregation path based on on-chain script type

03

Introduction of chain parameter dependency for script parsing in gossip validation

04

Potential for malformed or non-standard scripts to trigger new error paths in gossip processing

Risk score

Why this scored 46/100

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