EP
← All projectsElements Project

Core Lightning

Modular C implementation of the Lightning Network protocol and node stack.

BitcoinLightning NetworkActive incident
Repository coverage

2334 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

228security candidates319second-pass queue1977AI analyses
103commits · 30 days
223commits · 60 days
710commits · 180 days
1582commits · 365 days
Backfill bands
Aug 5 → Feb 61049 seen37 candidatesComplete
Feb 6 → Jun 6579 seen10 candidatesComplete
Jun 6 → Jul 678 seen1 candidatesComplete
Jul 6 → Aug 5147 seen16 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

71/100 average clarity
631Strong · 80–100
1400Adequate · 60–79
272Thin · 40–59
31Opaque · 0–39
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
cdecker331217581
daywalker9019315113471
Níckolas Goline961252376
Amperstrand322278
Rusty Russell96977961173
Sangbida Chaudhuri18537157167
Vincenzo Palazzo19714185
Lagrang3115679170
dovgopoly18016165
Dusty Daemon821378066
ShahanaFarooqui931093063
Peter Neuroth1509110074
Analysis record

Published AI watches

Last scanned 13 minutes ago

Informational 15 AI analysisMessage 85 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

doc: bring lightning-downgrade's version list up to v26.12.

This commit only updates documentation. It adds new version entries to the manual page for the lightning-downgrade tool and mentions the tool in the upgrade guide. No code, database logic, or security behavior is changed.

2e7a9f5aby Ken Sedgwick+9−12 files
No security note in commit
Informational 23 AI analysisMessage 66 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

Makefile: install lightning-downgrade.

This is a packaging/build fix, not a security vulnerability. The `lightning-downgrade` utility was being compiled but accidentally left out of the list of programs installed by `make install`. As a result, official release archives contain…

06ea9ba0by Ken Sedgwick+1−01 file
No security note in commit
Low 27 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: create bwatch tables before backfilling them

This commit fixes a database upgrade bug in Core Lightning. Wallets created with version v26.06.10 were missing two new tables (our_outputs and our_txs) because they skipped the migrations that create them. When users later upgraded, a fol…

Database migration failure could prevent node startup after upgradeFixes missing table creation before data backfillAdds regression test for upgrade path from v26.06.10
ce2a6836by daywalker90+105−02 files
No security note in commit
Informational 15 AI analysisMessage 5 · Opaque
EP Elements ProjectCore Lightning BitcoinLightning Network

v26.12rc1

This commit is a routine version bump from v26.06.10 to v26.12rc1 for Core Lightning. It only updates version strings in packaging files, a changelog, and a lockfile. There are no code changes that introduce, fix, or modify any security-se…

4002c4e9by Níckolas Goline+164−1110 files
No security note in commit
Low 30 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: store payment failure details per groupid

This commit fixes a database bug in Core Lightning where failure details for a payment attempt were being overwritten by later retry attempts that shared the same payment identifier fragment. The fix makes the failure record match on an ad…

Data integrity bug causing incorrect error reporting across payment retry groupsNo memory safety, authentication, authorization, or cryptographic issues presentNo external input is trusted or validated differently
24082c6dby daywalker90+6−34 files
No security note in commit
Low 43 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

cln-plugin: do not panic when the log writer task is gone

This commit fixes a bug in Core Lightning's Rust plugin library where a plugin could crash with a panic if it tried to log a message after the internal log-writing task had already stopped, such as during shutdown. The fix makes the plugin…

panic on send failure replaced with stderr fallbacklog message no longer silently dropped on writer task exitunit test added for dropped-receiver scenario
8661ffabby cdecker+29−11 file
No security note in commit
Informational 15 AI analysisMessage 90 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

docs: explain hsmtool HTLC recovery

This commit only adds documentation to the manual page for an existing command-line tool (hsmtool). It explains how to recover funds from old Lightning payment commitments (HTLCs) after losing channel state. There are no code changes, no n…

f90c140dby Sangbida Chaudhuri+85−01 file
No security note in commit
Informational 15 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: make test_delpay_works deterministic

This commit only changes a test file to make a flaky test more reliable. It does not modify any production code, so it has no security impact on real users.

a224ca81by daywalker90+16−161 file
No security note in commit
Informational 20 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

doc: say that listtransactions gives blockheight 0 for a tx not in a block

This commit only updates documentation to explain that the `listtransactions` command reports a block height and transaction index of 0 when a transaction is not currently in a block (for example, because it hasn't been mined yet or was re…

bc281be3by Peter Neuroth+4−42 files
No security note in commit
Informational 20 AI analysisMessage 50 · Thin
EP Elements ProjectCore Lightning BitcoinLightning Network

fixup! pyln-client: don't crash Millisatoshi.to_approx_str() on zero

This is a small bug fix in a Python helper library used by Core Lightning. The Millisatoshi.to_approx_str() method previously crashed with a math error when converting a zero amount to a human-readable string. The patch makes zero return "…

No security-relevant signals presentFix is a routine correctness/robustness improvement
02612ed5by Amartya Singh+4−31 file
No security note in commit
Moderate 62 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: reject unmodifiable PSBTs in addpsbtoutput/addpsbtinput

This update fixes a crash in two wallet commands, addpsbtoutput and addpsbtinput. These commands let users add extra transaction outputs or inputs to a PSBT (a Bitcoin transaction planning file). If a user supplied a PSBT whose version 2 '…

Daemon crash (assertion failure) on crafted/strict PSBT inputMissing validation of PSBT v2 modifiable flags before mutationUser-controlled input directly passed to libwally without precondition check
42472816by daywalker90+14−12 files
Vendor flagged security relevance
Moderate 59 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: show addpsbtoutput/addpsbtinput crash on an unmodifiable v2 PSBT

This commit only adds a new test case that demonstrates two Core Lightning commands, addpsbtoutput and addpsbtinput, crash with an internal assertion when given a v2 PSBT that does not allow adding inputs or outputs. The test is marked as …

Daemon abort due to failed assertion in PSBT helper functionsRPC commands addpsbtoutput and addpsbtinput lack validation of PSBT modifiability flags before calling libwallyPotential denial-of-service vector: any caller able to submit a crafted v2 PSBT can crash lightningd
42e268abby daywalker90+60−01 file
No security note in commit
Informational 20 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

pyln-client: don't crash Millisatoshi.to_approx_str() on zero

This commit fixes a minor bug in Core Lightning's Python client library where calling a pretty-printing method on a zero-amount payment would crash with a ValueError. It is a routine correctness fix, not a security vulnerability. There is …

5ebe365dby Amartya Singh+3−12 files
No security note in commit
Moderate 59 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

dualopen and splicing: add minimal verification of tx_signatures

This commit adds missing safety checks in Core Lightning when a peer sends signatures for opening or splicing a dual-funded Lightning channel. Before the patch, the software accepted peer-provided transaction witnesses without verifying th…

Missing input validation on peer-provided witness dataBOLT-2 compliance fix for tx_signaturesRejection of empty witness stacks
c6be4f71by Lagrang3+633−97 files
Vendor flagged security relevance
Moderate 54 AI analysisMessage 85 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

channeld: abort_channels no longer fails a channel with a signed splice

This fix prevents a user-issued 'abort channels' command from incorrectly failing a Lightning channel when a splice transaction has already been signed. Previously, the code would pass the latest in-flight splice to a routine that aborts i…

Denial-of-service/availability impact: user-initiated abort could inadvertently fail a funded channelProtocol compliance fix: avoids sending tx_abort after tx_signatures, which BOLT 2 forbidsState-handling bug in splice negotiation lifecycle
c87f5573by Andezion+22−11 file
No security note in commit
Moderate 51 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

lightningd: fix crash on mutual close of an unconfirmed dual-funded channel

This update fixes a bug where a specific type of Lightning channel close could crash the node. It only happens when both parties cooperatively close a dual-funded channel that has not yet been confirmed and has gone through a funding bump …

NULL pointer dereference leading to daemon crash (denial of service)Crash occurs in cooperative-close path for unconfirmed dual-funded/RBF channelsFix uses canonical channel funding key instead of splice-only field
555143beby Sangbida Chaudhuri+9−31 file
Vendor flagged security relevance
High 74 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

cln-grpc: reject malformed request values instead of panicking

This commit fixes a security bug in Core Lightning's gRPC plugin (cln-grpc). Previously, a malformed request from a gRPC client could crash the plugin: bad public keys, hashes, secrets, channel IDs, or enum values triggered Rust 'unwrap()'…

Denial-of-service via malformed gRPC request causing tonic worker task panicDenial-of-service via std::process::exit(1) in ProofField conversion on missing oneofSilent integer truncation of u16/u8 fields via 'as' casts
b2703436by daywalker90+1558−12135 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 51 · Thin
EP Elements ProjectCore Lightning BitcoinLightning Network

nix: drop protobuf again

This commit removes the protobuf package from the Nix build environment because it is no longer needed. A previous change made the cln-grpc component use its own bundled protoc compiler instead of relying on the system one. The Python bind…

a0459eeeby Peter Neuroth+0−11 file
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

make: check gRPC protos for breaking changes against the last release

This commit adds a new automated check to the project's build process that compares gRPC protocol definitions against the last release to catch accidental breaking changes early. It does not change any runtime code, fix a bug, or introduce…

db5fea70by daywalker90+43−84 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-prioritysplice: Make feerate opening + feerate_offsetby Dusty Daemon · ee2d5f81 · May 11, 2026 · 10 filesMessage 90 · StrongModerate 55Details
Commit message · Dusty Daemon

splice: Make feerate opening + feerate_offset

Splicing feerate was being derived by `default_feerate` which was actually `unilateral_feerate`, which is incorrect.

Instead we define an explicit `splice_feerate` in the chain topology that is `opening` + `feerate_offset`.

This slipped through testing because regtest isn’t a great test of fees we see in the wild.

Changelog-Fixed: Fixes high fee issue that caused `splicein` and `spliceout` to abort.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Moderate 55/100

This commit fixes a bug in Core Lightning's splicing feature where the fee rate used for splice transactions was accidentally based on the much higher 'unilateral close' fee rate instead of the intended 'opening' fee rate plus a small offset. The result was that normal splice-in and splice-out operations could be rejected or aborted because the calculated fee looked too high. The fix introduces a dedicated splice fee rate and updates the safety checks and tests accordingly. It is a correctness/availability issue rather than a remote exploit, but it could cause users to pay excessive fees or fail to use splicing.

Lower-prioritybwatch: add typed hash tables for watchesby Sangbida Chaudhuri · ca2e79ff · May 11, 2026 · 4 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add typed hash tables for watches

We have 4 types of watches: utxo (outpoint), scriptpubkey, scid and
blockdepth. Each gets its own hash table with a key shape that makes
lookups direct.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit is a routine internal refactor of a new plugin called bwatch. It adds typed hash tables so the plugin can quickly look up different kinds of blockchain 'watches' (things it monitors on the Bitcoin blockchain). There is no user-facing change, no bug fix, and no security-sensitive behavior introduced.

Lower-prioritybwatch: persist watchesby Sangbida Chaudhuri · ef8b11e4 · May 11, 2026 · 3 filesMessage 51 · ThinInformational 18Details
Commit message · Sangbida Chaudhuri

bwatch: persist watches

Each watch (and its set of owners) is serialized through the wire
format from the earlier commit and stored in the datastore. On startup
we walk each type's prefix and reload the watches into their
respective hash tables, so a restart resumes watching the same things
without anyone re-registering.

51/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides detailed explanatory context
AI analysis · Informational 18/100

This commit adds a save-and-reload feature for the bwatch plugin so that after a restart it remembers which Bitcoin transactions, outputs, and channel IDs it was monitoring. It stores these in the node's internal datastore and reads them back on startup. There is no obvious security bug in the change, but it is a new persistence mechanism that could affect reliability and, if misused, could let a stale or incorrect watch live longer than intended.

Lower-prioritybwatch: add watch_found and watch_revert notificationsby Sangbida Chaudhuri · 34d8c6fe · May 11, 2026 · 2 filesMessage 73 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add watch_found and watch_revert notifications

Add two RPCs for surfacing watches to lightningd on a new block or
reorg.

bwatch_send_watch_found informs lightningd of any watches that were
found in the current processed block. The owner is used to
disambiguate watches that may pertain to multiple subdaemons.

bwatch_send_watch_revert is sent in case of a revert; it informs the
owner that a previously reported watch has been rolled back.

These functions get wired up in subsequent commits.

Made-with: Cursor

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds two internal notification functions inside Core Lightning's new block-watching plugin. They are not yet connected to anything; the commit message says they will be wired up later. There is no user-facing change and no security fix or vulnerability present in the diff.

Lower-prioritybwatch: scan blocks for scriptpubkey and outpoint matchesby Sangbida Chaudhuri · 4f12b48a · May 11, 2026 · 3 filesMessage 73 · AdequateInformational 24Details
Commit message · Sangbida Chaudhuri

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.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 24/100

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.

Lower-prioritybwatch: thread per-watch parameter through block scanningby Sangbida Chaudhuri · 852ed1ab · May 11, 2026 · 3 filesMessage 73 · AdequateInformational 19Details
Commit message · Sangbida Chaudhuri

bwatch: thread per-watch parameter through block scanning

To support rescans (added next), bwatch_process_block_txs and
bwatch_check_scid_watches gain a `const struct watch *w` parameter
so the caller can ask the scanner to check just one watch instead
of all of them.

When a new watch is added with start_block <= current_height (say
the watch starts at block 100 but bwatch is already at 105) we
need to replay blocks 100..105 for that watch alone — not re-scan
every active watch over those blocks.

w == NULL -> check every active watch (normal polling)
w != NULL -> check only that one watch (rescan)

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 19/100

This commit refactors a Core Lightning plugin so that block scanning can be limited to a single user-provided watch instead of checking every active watch. It is a preparatory change for adding a 'rescan' feature and does not, by itself, change any externally reachable behavior. There is no indication it fixes a security bug or introduces a vulnerability.

Lower-prioritybwatch: add scriptpubkey watch RPCsby Sangbida Chaudhuri · 64cd3fed · May 11, 2026 · 3 filesMessage 68 · AdequateInformational 11Details
Commit message · Sangbida Chaudhuri

bwatch: add scriptpubkey watch RPCs

addscriptpubkeywatch and delscriptpubkeywatch are how lightningd asks
bwatch to start/stop watching an output script for a given owner.

Changelog-Added: Plugins: bwatch exposes addscriptpubkeywatch / delscriptpubkeywatch RPCs.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 11/100

This commit adds two new internal plugin commands, addscriptpubkeywatch and delscriptpubkeywatch, to the bwatch plugin in Core Lightning. They let lightningd ask bwatch to start or stop monitoring a Bitcoin output script (scriptpubkey) for a specific owner. The change is a straightforward feature addition with no obvious security bug in the diff itself.

Lower-prioritybwatch: add outpoint watch RPCsby Sangbida Chaudhuri · 6ed4be67 · May 11, 2026 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add outpoint watch RPCs

addoutpointwatch and deloutpointwatch are how lightningd asks bwatch
to start/stop watching a specific (txid, outnum) for a given owner.

Changelog-Added: Plugins: bwatch exposes addoutpointwatch / deloutpointwatch RPCs.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds two new internal plugin commands, addoutpointwatch and deloutpointwatch, to the bwatch plugin in Core Lightning. They let the lightning node start or stop watching a specific transaction output (a txid plus output number) on behalf of a named owner. There is no indication in the commit that this is a security fix or that it addresses any vulnerability; it reads as ordinary feature work.

Lower-prioritybwatch: add blockdepth watch RPCsby Sangbida Chaudhuri · 5bb206dd · May 11, 2026 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add blockdepth watch RPCs

addblockdepthwatch and delblockdepthwatch are how lightningd asks
bwatch to start/stop a depth-tracker for a given (owner, start_block).
start_block doubles as the watch key and the anchor used to compute
depth = tip - start_block + 1 on every new block.

Changelog-Added: Plugins: bwatch exposes addblockdepthwatch / delblockdepthwatch RPCs.
Made-with: Cursor

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds two new internal plugin commands, addblockdepthwatch and delblockdepthwatch, to the bwatch plugin in Core Lightning. They let another part of the node ask bwatch to track how many blocks have passed since a chosen starting block height. There is no indication in the commit that this fixes a bug or addresses a security issue; it appears to be a normal feature addition.

Lower-prioritypytest: add tests for bwatch.by Sangbida Chaudhuri · 8ba5ff59 · May 11, 2026 · 2 filesMessage 55 · ThinInformational 15Details
Commit message · Sangbida Chaudhuri

pytest: add tests for bwatch.

55/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds new automated tests for an existing Core Lightning feature called 'bwatch' (a block-watching plugin). It does not change the actual production code that users run, so it cannot introduce a security vulnerability or fix one in the shipped software. A few existing tests were also updated to disable the bwatch plugin so their datastore checks remain accurate.

Lower-prioritybwatch: poll chain and append blocksby Sangbida Chaudhuri · 591a57b2 · May 11, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: poll chain and append blocks

Add the chain-polling loop. A timer fires bwatch_poll_chain, which calls
getchaininfo to learn bitcoind's tip; if we're behind, we fetch the next
block via getrawblockbyheight, append it to the in-memory history and
persist it to the datastore. After each successful persist we reschedule
the timer at zero delay so we keep fetching back-to-back until we catch
up to the chain tip. Once getchaininfo reports no new block, we settle
into the steady-state cadence (30s by default, tunable via the
--bwatch-poll-interval option).

This commit only handles the happy path. Reorg detection, watchman
notifications and watch matching land in subsequent commits.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds a routine background loop to a new Core Lightning plugin called bwatch. The plugin periodically asks Bitcoin for the latest block, downloads any missing blocks one at a time, keeps an in-memory history, and saves each block to the plugin's datastore. It is described by the author as the 'happy path' only; handling of chain reorganizations, watch notifications, and matching logic is explicitly left for later commits. There is no security-relevant behavior, vulnerability, or incident described in the commit or supplied references.

Lower-prioritycommon: add helpers for bitcoin blockids.by Rusty Russell · bf5ee2a6 · May 11, 2026 · 7 filesMessage 68 · AdequateInformational 15Details
Commit message · Rusty Russell

common: add helpers for bitcoin blockids.

Like bitcoin_txid, they are special backwards-printed snowflakes.

Thanks Obama!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds helper functions for converting Bitcoin block IDs between hex strings and internal binary structures, and exposes them through JSON parsing/serialization helpers. It is a straightforward code refactoring and feature addition with no apparent security relevance.

Lower-prioritybwatch: add skeleton and makefileby Sangbida Chaudhuri · 764e81d5 · May 11, 2026 · 9 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add skeleton and makefile

bwatch is an async block scanner that consumes blocks from bcli or any
other bitcoind interface and communicates with lightningd by sending
it updates. In this commit we're only introducing the plugin and some
files that we will populate in future commits.

Changelog-Added: bwatch plugin, this is to handle block processing outside of lightningd. Not yet hooked up to lightningd.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds a brand-new, empty plugin called 'bwatch' to the Core Lightning build system. It contains only placeholder files, a basic plugin entry point, and no actual block-scanning logic. It is not yet connected to the main lightningd process. There is no security issue here—this is just the first scaffolding commit for a future feature.

Lower-prioritybwatch: add rescan engine for historical blocksby Sangbida Chaudhuri · acc0b667 · May 11, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add rescan engine for historical blocks

bwatch_start_rescan(cmd, w, start_block, target_block) replays
blocks from start_block..target_block for a single watch w (or
for all watches if w is NULL).

The rescan runs asynchronously: fetch_block_rescan ->
rescan_block_done -> next fetch, terminating with rescan_complete
(which returns success for an RPC-driven rescan and aux_command_done
for a timer-driven one).

Nothing calls bwatch_start_rescan yet; the add-watch RPCs wire it
up next.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds a new internal engine that can replay older Bitcoin blocks so newly created transaction watches can catch up on past confirmations. It is purely additive code: the new rescan function is defined but not yet connected to any user-facing command, so it cannot be triggered by users today. There is no obvious security bug in the added code, and nothing in the commit claims to fix a security issue.

Lower-prioritybwatch: scan blocks for scid matchesby Sangbida Chaudhuri · 8eccae35 · May 11, 2026 · 1 fileMessage 68 · AdequateInformational 12Details
Commit message · Sangbida Chaudhuri

bwatch: scan blocks for scid matches

After the per-tx scriptpubkey/outpoint pass, walk every scid watch and
fire watch_found for any whose encoded blockheight matches the block
just processed.

The watch's scid encodes the expected (txindex, outnum), so we jump
straight there without scanning. If the position is out of range
(txindex past the block, or outnum past the tx) we send watch_found
with tx=NULL, which lightningd treats as the "not found" case.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 12/100

This commit adds a new block-scanning step in Core Lightning's 'bwatch' plugin. After the existing checks for transaction scripts and outpoints, it now also checks 'short channel ID' (scid) watches. If a watched scid's encoded block height matches the block just processed, it looks up the exact transaction and output number encoded in the scid and reports the result to lightningd. If the encoded position doesn't exist, it reports 'not found' so lightningd can clean up the watch. There is no indication in the commit that this fixes a security vulnerability; it appears to be a missing functional feature.

Lower-prioritybwatch: notify watch owners on reorgby Sangbida Chaudhuri · 3b73db58 · May 11, 2026 · 1 fileMessage 68 · AdequateModerate 63Details
Commit message · Sangbida Chaudhuri

bwatch: notify watch owners on reorg

When bwatch removes its tip block on a reorg, fire watch_revert for
the affected owners so lightningd-side handlers actually run.

Two cases, depending on whether the watch has an anchor block:

- scriptpubkey watches have no anchor (a wallet address can receive
funds in any block), so notify every owner on every removed block.
Handlers are cheap and defensive — they check their own state and
no-op if there is nothing to undo.

- outpoint, scid, and blockdepth watches each carry a start_block.
Notify only those with start_block >= removed_height (the watch's
anchor is gone). Older watches stay armed and refire naturally on
the new chain.

Owners are snapshotted before dispatch so revert handlers can safely
call watchman_unwatch_* and mutate the watch tables.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 63/100

This commit fixes a bug in Core Lightning's blockchain-watch plugin (bwatch). When the Bitcoin chain reorganizes (a block that was considered part of the chain gets replaced by a different one), bwatch was removing the old tip block without telling the rest of the node. The fix makes bwatch notify all relevant 'watch owners' before the block is discarded, so lightningd can undo any state changes tied to that now-orphaned block. Without the fix, the node could keep stale or incorrect state after a reorg, which in a Lightning node can lead to incorrect channel balances or missed on-chain events.

Lower-prioritybwatch: gate chain polling behind --experimental-bwatchby Sangbida Chaudhuri · c3d4ae3c · May 11, 2026 · 4 filesMessage 73 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: gate chain polling behind --experimental-bwatch

The plugin still loads (so its options and RPCs stay registered) but
stays inert — no chain polling, no watch replay — unless the user
explicitly opts in with --experimental-bwatch.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit adds an opt-in flag called --experimental-bwatch. The bwatch plugin still loads, but it will not poll the Bitcoin blockchain or process any chain watches unless the user explicitly enables the new flag. It is a feature-gating change, not a fix for an active security bug.

Lower-prioritydoc: document bwatch-poll-interval in lightningd-config.5by Sangbida Chaudhuri · 63802396 · May 11, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Sangbida Chaudhuri

doc: document bwatch-poll-interval in lightningd-config.5

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit only adds documentation for an existing configuration option called bwatch-poll-interval. It describes how long the bwatch plugin waits between checks for new blocks from bitcoind. There are no code changes and no security implications.

Lower-prioritybwatch: trigger rescan when a watch is added behind tipby Sangbida Chaudhuri · 9af6b376 · May 11, 2026 · 1 fileMessage 85 · StrongLow 26Details
Commit message · Sangbida Chaudhuri

bwatch: trigger rescan when a watch is added behind tip

bwatch_add_watch returns the watch it created (or found); each
addwatch RPC now passes that into add_watch_and_maybe_rescan,
which:

- returns success immediately if start_block > current_height
(the watch only cares about future blocks), and
- otherwise calls bwatch_start_rescan over
[start_block, current_height] for that one watch and leaves
the RPC pending until the rescan completes.

This lets callers add a watch for an event that already confirmed
(e.g. a channel funding tx some blocks back) and still get a
watch_found.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 26/100

This change fixes a functional gap in Core Lightning's block watcher plugin. Previously, if you asked the node to watch for a transaction or output that had already been confirmed in the past, the watch would be recorded but the node would not look back through old blocks to find it. Now, when a watch is added for a starting block at or behind the current chain tip, the plugin automatically triggers a rescan over the relevant historical range for that specific watch, and keeps the RPC call pending until the rescan finishes. This is a correctness/reliability improvement rather than a typical security vulnerability patch.

Lower-prioritybwatch: add listwatch RPCby Sangbida Chaudhuri · 32333bc0 · May 11, 2026 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add listwatch RPC

listwatch returns every active watch as a flat array. Each entry
carries its type-specific key (scriptpubkey hex, outpoint, scid
triple, or blockdepth anchor) plus the common type / start_block /
owners fields, so callers can dispatch on the per-type key without
parsing the type string first.

Mostly used by tests and operator tooling to inspect what bwatch
is currently tracking.

Changelog-Added: Plugins: bwatch exposes listwatch RPC.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit adds a new read-only RPC command called listwatch to the bwatch plugin. It simply lets users and tests see what blockchain watches are currently active. There is no change to how watches are created, deleted, or processed, and no security-sensitive logic is modified.

Lower-prioritybwatch: add addwatch/delwatch helpersby Sangbida Chaudhuri · 5371cfab · May 11, 2026 · 2 filesMessage 68 · AdequateInformational 12Details
Commit message · Sangbida Chaudhuri

bwatch: add addwatch/delwatch helpers

bwatch_add_watch and bwatch_del_watch are the high-level entry points
the RPCs (added in a later commit) use. Adding a watch that already
exists merges the owner list and lowers start_block if the new request
needs to scan further back, so a re-registering daemon (e.g. onchaind
on restart) doesn't lose missed events. Removing a watch drops only
the requesting owner; the watch itself is removed once the owner list
is empty.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Informational 12/100

This commit adds two helper functions for managing blockchain watches in a new plugin called bwatch. It lets different parts of the program register interest in a transaction or output, merge duplicate registrations, and remove their interest when done. There is no obvious security bug in the change itself; it is routine infrastructure code.

Lower-prioritytests: wait for bwatch block write before stopping in test_db_hookby Sangbida Chaudhuri · d5e69b24 · May 11, 2026 · 1 fileMessage 83 · StrongInformational 13Details
Commit message · Sangbida Chaudhuri

tests: wait for bwatch block write before stopping in test_db_hook

I'm not entirely sure about changing this test but this test was written prior to bwatch. Bwatch unconditionally triggers datastore writes on startup when it polls bcli.

If the async poll chain completes during shutdown rather than normal operation, the db_write hook fires after dblog has wound down, so the main DB gets the write but dblog doesn't capture it.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 13/100

This change only adjusts a test to wait for a background bookkeeping process to finish before stopping the node. It is not a security fix for production code; it makes a flaky test more reliable so the test's own database mirror does not miss a late write during shutdown.

Lower-prioritylibplugin: expose json_add_keypath.by Rusty Russell · c1b428a7 · May 11, 2026 · 2 filesMessage 50 · ThinInformational 15Details
Commit message · Rusty Russell

libplugin: expose json_add_keypath.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

50/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides an explanatory body
AI analysis · Informational 15/100

This commit simply makes an existing internal helper function available for use by other parts of the codebase. It does not change any behavior, fix any bug, or introduce any new functionality that could be misused. There is no security relevance visible in the change itself.

Lower-priorityccan: add json_escape_len in json_out_addstrnby Sangbida Chaudhuri · 8bc7d3c7 · May 11, 2026 · 1 fileMessage 45 · ThinLow 49Details
Commit message · Sangbida Chaudhuri

ccan: add json_escape_len in json_out_addstrn

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 49/100

This is a one-line fix in a helper library that builds JSON output. The function json_out_addstrn is supposed to add a string of a specific length, but it was escaping the entire string using a function that ignores the requested length. This could cause a string that contains bytes beyond the intended length to be incorrectly included in JSON output, potentially leaking nearby memory or producing malformed JSON. The patch makes the escaping respect the intended length.

Lower-prioritycommon: expose json_hex_to_be32/be64by Sangbida Chaudhuri · 2dd780c9 · May 11, 2026 · 4 filesMessage 58 · ThinInformational 15Details
Commit message · Sangbida Chaudhuri

common: expose json_hex_to_be32/be64

These helper functions decode hex strings from JSON into big-endian 32-bit and 64-bit values, useful for parsing datastore entries exposing these into a more common space so they can be used by bwatch in the future.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 15/100

This commit simply moves two small helper functions that decode hex strings into numbers from two plugin files into a shared library. It is a routine code cleanup/refactoring change with no security relevance visible in the diff or commit message.