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

bwatch: scan blocks for scriptpubkey and outpoint matches

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

73/100 · Adequate
bwatch: scan blocks for scriptpubkey and outpoint matches

After every fetched block, walk each transaction and fire watch_found
for matching scriptpubkey outputs and spent outpoints.

Outputs are matched by hash lookup against scriptpubkey_watches; inputs
by reconstructing the spent outpoint and looking it up in
outpoint_watches.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds the actual scanning logic to a new 'bwatch' plugin that watches the Bitcoin blockchain. Before this change, the plugin fetched blocks but never inspected the transactions inside them. Now, after each block is downloaded, it walks through every transaction and checks whether any output matches a watched Bitcoin address (scriptpubkey) or whether any input spends a watched previous transaction output (outpoint). When a match is found, it sends a notification back to the main lightningd process. This is a normal feature-completion commit for a block-watcher plugin; it does not by itself look like a security fix or vulnerability.

Recommended action

Treat as routine feature development. Review the bwatch_send_watch_found() implementation and the watch hash tables for correctness, memory safety, and proper handling of duplicate or stale watches. If this plugin is intended to protect on-chain funds, ensure the scanner cannot miss blocks or transactions during reorgs or fast sync.

Security signals we found

01

New block scanning logic that touches watched scriptpubkeys and outpoints

02

Sanity check on watch start_block with LOG_BROKEN logging

03

No input validation or bounds checks visible beyond existing library helpers

04

No explicit memory-zeroing or constant-time operations visible in the diff

05

Plugin now reconstructs spent outpoints from transaction inputs

Risk score

Why this scored 24/100

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