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

wallet: register scriptpubkey watches at startup

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

78/100 · Adequate
wallet: register scriptpubkey watches at startup

init_wallet_scriptpubkey_watches walks every HD key (BIP32 + BIP86) up
to {bip32,bip86}_max_index + keyscan_gap and arms a watch for each
form, so bwatch can report deposits from the very first block it
scans. wallet_get_newindex does the same for fresh keys, keeping
coverage as the wallet grows.

The per-UTXO watch on unconfirmed change is now redundant (the
perennial per-key watch already covers that scriptpubkey), so drop it.

Co-authored-by: Cursor <cursoragent@cursor.com>
✓ 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 change makes Core Lightning register long-lasting 'watches' for all wallet deposit addresses when the node starts up, so the new bwatch plugin can spot incoming payments from the first block it scans. It also removes a now-redundant per-transaction watch on unconfirmed change outputs. The patch is a functional improvement for the experimental bwatch feature, not a clear-cut security fix, but a missing or incomplete watch could in principle cause deposits to be overlooked.

Recommended action

Treat as a normal code review item for the experimental bwatch feature. Verify that init_wallet_scriptpubkey_watches() covers every address form wallet_can_spend() recognizes, that the keyscan_gap lookahead is sufficient, and that removing the unconfirmed-change watch does not create a window where a confirming change output is missed before the per-key watch is active. No urgent security action is indicated by the commit alone.

Security signals we found

01

Change is part of an experimental chain-watcher (bwatch) feature

02

Adds startup registration of scriptPubKey watches for all derived wallet keys

03

Removes a redundant unconfirmed-change watch, relying on the new blanket coverage

04

Uses UINT32_MAX start_block to avoid rescan, depending on bwatch polling for catch-up

05

No explicit security framing, CVE, or vulnerability description in commit message

Risk score

Why this scored 44/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/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.