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

lightningd: use scriptpubkey, not watch_txid for initial spotting of the funding tx.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
lightningd: use scriptpubkey, not watch_txid for initial spotting of the funding tx.

funding_depth_cb handled three cases, implicitly:

1. First time we see the funding tx.
2. When we see the funding tx block reorged out.
3. When we see the tx depth increase.

This replaces first one with a scriptpubkey watch. The other two stay
using the watch_txid for now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change alters how Core Lightning first detects a channel's funding transaction on the Bitcoin blockchain. Previously it looked for an exact transaction ID; now it watches for any transaction that pays to the channel's expected 2-of-2 multisig script. The commit message frames this as a refactor of the three existing cases handled by the funding-depth callback, not as a security fix. There is no direct evidence in the diff of a vulnerability being patched, but the change could reduce sensitivity to transaction malleability or to cases where the funding transaction ID is not yet known.

Recommended action

Review the watch_scriptpubkey_ implementation to confirm it correctly validates both the expected outpoint and amount before invoking channel_funding_found, and ensure the interaction between the new scriptpubkey watch and the existing txid watch does not miss reorgs or double-trigger. Treat as a routine refactor unless additional context shows it fixes a known issue.

Security signals we found

01

Changes blockchain watching logic for funding transactions

02

Replaces txid-based initial detection with scriptpubkey-based detection

03

No explicit security claim in commit message or diff

04

Could affect behavior under transaction malleability or reorg scenarios

Risk score

Why this scored 24/100

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