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

graph/db: add tests to document v1 taproot funding script bug

Public commit record

What the developer wrote

Authored by Elle Mouton

83/100 · Strong
graph/db: add tests to document v1 taproot funding script bug

Private taproot channels are currently represented in the gossip/graph
layer as v1 gossip objects with the SimpleTaprootChannelsRequiredStaging
feature bit set on the v1 ChannelAnnouncement1.

However, FundingPKScript() on a v1 ChannelEdgeInfo unconditionally
reconstructs a legacy 2-of-2 P2WSH multisig script, ignoring the
taproot feature bit entirely. This means that code paths such as
ChannelView() (used to rebuild the chain watch filter on restart)
produce the wrong funding script for these channels.

This bug has always been present since private taproot channels were
first introduced. The discovery/gossiper path (makeFundingScript)
correctly honors the taproot bit when validating announcements on
insertion, but the graph DB read paths never did.

Add failing tests at both the model level (FundingPKScript) and the
graph level (ChannelView round-trip) to document this mismatch. The
next commit fixes the behavior so these tests pass.
✓ 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 only adds automated tests that demonstrate an existing bug in LND's handling of private taproot channels. The bug causes the wallet to watch for the wrong Bitcoin address when monitoring the blockchain for channel funding transactions. Because the commit itself does not change production code, it cannot be exploited; rather, it documents a real bug that the next commit is intended to fix. If left unfixed, the bug could prevent LND from correctly detecting on-chain activity for some taproot channels.

Recommended action

Review and apply the follow-up commit that fixes FundingPKScript() and ChannelView() to honor the SimpleTaprootChannelsRequiredStaging feature bit. Until then, operators relying on private taproot channels should be aware that chain-watch filters may use incorrect scripts after restart.

Security signals we found

01

Incorrect funding script reconstruction for taproot channels in graph DB read paths

02

Chain watch filter may miss or misidentify on-chain funding outputs for private taproot channels

03

Gossiper insertion path correctly honors taproot bit, creating an inconsistency between write-time validation and read-time reconstruction

04

Commit is test-only; the actual vulnerability is in the pre-existing production code being documented

Risk score

Why this scored 62/100

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