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 46 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-prioritypytest: fix regex in test_important_pluginby Vincenzo Palazzo · 04e55baf · May 11, 2026 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Vincenzo Palazzo

pytest: fix regex in test_important_plugin

Fix the expected broken-log pattern in test_important_plugin.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100

This commit fixes a single-character typo in a test's expected error message pattern. The word 'Unkown' is corrected to 'Unknown' in a regex used by an automated test. There is no change to production code, no security fix, and no user-facing behavior change.

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: send chaininfo to watchman on startupby Sangbida Chaudhuri · 100805d9 · May 11, 2026 · 4 filesMessage 68 · AdequateInformational 23Details
Commit message · Sangbida Chaudhuri

bwatch: send chaininfo to watchman on startup

On init, query bcli for chain name, headercount, blockcount and IBD
state, then forward the result to watchman via the chaininfo RPC
before bwatch starts its normal poll loop. Watchman uses this to
gate any work that depends on bitcoind being synced.

If bitcoind's blockcount comes back lower than our persisted tip,
peel stored blocks off until they line up so watchman gets a
consistent picture. During steady-state polling the same case is
handled by hash-mismatch reorg detection inside handle_block; this
shortcut only matters at startup, before we've fetched anything.

If bcli or watchman is not yet ready, log and fall back to scheduling
the poll loop anyway so init never stalls.

bwatch_remove_tip is exposed in bwatch.h so the chaininfo path in
bwatch_interface.c can use it.

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

This change is a defensive startup fix for the bwatch plugin in Core Lightning. It makes the plugin check Bitcoin's sync status and share it with another component (watchman) before starting normal block polling. It also rolls back the plugin's stored block tip if Bitcoin appears to have a shorter chain at startup. The commit does not appear to fix an active exploit; it is more like adding a safety check to prevent inconsistent state when a node restarts while Bitcoin is still syncing or has reorged.

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-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: 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-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 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: 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: 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: 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: 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 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-prioritytests: update cli tests to reflect bwatch rpcsby Sangbida Chaudhuri · f4955c82 · May 11, 2026 · 1 fileMessage 55 · ThinInformational 15Details
Commit message · Sangbida Chaudhuri

tests: update cli tests to reflect bwatch rpcs

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 updates three test strings in a Python test file. It changes the expected help output from one RPC command name ('addpsbtinput') to another ('addoutpointwatch'). There is no code change, no bug fix, and no security relevance visible in the diff.

Lower-prioritybwatch: add scid watch RPCsby Sangbida Chaudhuri · 0a5360d1 · May 11, 2026 · 3 filesMessage 68 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: add scid watch RPCs

addscidwatch and delscidwatch are how lightningd asks bwatch to
start/stop watching a specific short_channel_id for a given owner.
The scid pins the watch to one (block, txindex, outnum), so on each
new block we go straight to that position rather than scanning.

Changelog-Added: Plugins: bwatch exposes addscidwatch / delscidwatch 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, addscidwatch and delscidwatch, to the bwatch plugin in Core Lightning. They let lightningd ask the plugin to start or stop monitoring a specific Lightning channel identifier (short_channel_id) for a particular owner. The change is purely additive and exposes existing watch functionality through a new, more precise lookup path. There is no indication of a security bug or fix.

AI review queuedbwatch: notify watchman on block_processedby Sangbida Chaudhuri · e8a16948 · May 11, 2026 · 3 filesMessage 68 · AdequateLow 26Details
Commit message · Sangbida Chaudhuri

bwatch: notify watchman on block_processed

After bwatch persists a new tip, send a block_processed RPC to watchman
(lightningd) with the height and hash. bwatch only continues polling
for the next block once watchman has acknowledged that it has also
processed the new block height on its end.

This matters for crash safety: on restart we treat watchman's height as
the floor and re-fetch anything above it, so any block we acted on must
be visible to watchman before we move on.

If watchman isn't ready yet (e.g. lightningd still booting) the RPC
errors out non-fatally; we just reschedule and retry.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 26/100

This commit hardens crash recovery in Core Lightning's new block-watching plugin (bwatch). Previously, bwatch would immediately fetch the next Bitcoin block after saving one. Now it waits for lightningd's 'watchman' component to confirm it has also recorded the same block height before continuing. This prevents a situation where bwatch moves ahead of the main daemon, so if the node crashes and restarts, no block that bwatch acted on is invisible to the rest of the system.

Lower-prioritybwatch: persist block historyby Sangbida Chaudhuri · aaffcc8b · May 11, 2026 · 4 filesMessage 58 · ThinInformational 15Details
Commit message · Sangbida Chaudhuri

bwatch: persist block history

bwatch keeps a tail of recent blocks (height, hash, prev hash) so it
can detect and unwind reorgs without re-fetching from bitcoind. The
datastore key for each block is zero-padded to 10 digits so
listdatastore returns blocks in ascending height order. On startup
we replay the stored history and resume from the most recent block.

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

This commit adds a new feature to the bwatch plugin that remembers recent Bitcoin block history in the node's internal database. It is a reliability improvement for handling blockchain reorganizations, not a security fix. There is no indication of a vulnerability being patched.

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-prioritycommon: extract param_string_array from xpay into common.by Rusty Russell · 9c07b985 · May 11, 2026 · 3 filesMessage 65 · AdequateInformational 15Details
Commit message · Rusty Russell

common: extract param_string_array from xpay into common.

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

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 15/100

This commit simply moves an existing helper function that parses a JSON array of strings from one file (inside the xpay plugin) to a shared common library. No behavior changes, no bug fixes, and no security implications are visible.

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.