EP
← All projectsElements Project

Core Lightning

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

BitcoinLightning NetworkActive incident
Repository coverage

2008 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.

184security candidates280second-pass queue1894AI analyses
55commits · 30 days
210commits · 60 days
682commits · 180 days
1670commits · 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.

70/100 average clarity
488Strong · 80–100
1231Adequate · 60–79
259Thin · 40–59
30Opaque · 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.
cdecker14910384
Níckolas Goline63844277
Rusty Russell96475958172
daywalker90117895165
Lagrang386578170
Vincenzo Palazzo13411182
dovgopoly15015164
Sangbida Chaudhuri14931146066
Dusty Daemon821378066
ShahanaFarooqui931093063
Peter Neuroth1024101071
Christian Decker36436072
Analysis record

Published AI watches

Last scanned 13 minutes ago

Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

contrib: add jaonoctus's signing key

This commit simply adds a new person's PGP public-key fingerprint to the list of trusted release signers in two documentation files. It does not change any code, fix any bug, or alter any security behavior of the software itself.

41278b4eby jaonoctus+2−02 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: fixed timestamps for invented bookkeeper deposits

This is a tiny internal fix to make a bookkeeping migration produce stable event ordering. It changes the timestamp used when creating historical 'deposit' records during a one-time database migration, so the records sort consistently with…

498e5086by daywalker90+2−01 file
No security note in commit
Informational 21 AI analysisMessage 85 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

docs: document missing and fix erroneous JSON-RPC error codes

This commit is a documentation-only cleanup of the JSON-RPC command help files. It corrects which numeric error codes are listed for each command so the published schemas match what the software actually returns. No program logic, validati…

Documentation-only change with no executable code modificationsCorrects RPC schema error-code metadata to match actual handler behaviorNo change to input parsing, authorization, cryptography, or network behavior
d1b6963bby daywalker90+204−1224 files
No security note in commit
Low 46 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

channeld: initialize tx_sigs_allowed on startup

This commit fixes a bug where a setting that controls whether unexpected transaction signatures are allowed was not initialized when the channel daemon starts. If a peer sent such signatures before the channel was fully ready, the program …

use of uninitialized variableundefined behavior (invalid bool load)network-triggered code path
c09c4520by Erick Cestari+1−01 file
No security note in commit
Informational 15 AI analysisMessage 100 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

ci: fix the coverage nightly's profile handling

This commit fixes the project's internal nightly code-coverage CI workflow. It changes how test coverage files are collected, ensures the same LLVM compiler version is used to generate and merge coverage data, and uploads a Codecov-compati…

5685c9a3by cdecker+12−211 file
No security note in commit
Low 37 AI analysisMessage 78 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

schemas: make required fields match the code

This commit is a large cleanup of Core Lightning's API schemas, generated RPC bindings, and related plugin code. The stated goal is to make the documented 'required' fields match what the C code actually always produces or expects. In prac…

Large schema-only change with no accompanying security advisory or CVEOne semantic change to plugin hook response: invoice_payment hook can now reject with only failure_message and no resultMany fields change from optional to required in public RPC/protobuf interfaces
ddbd2963by daywalker90+1786−173950 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

doc: document error 313 on every command which can return it

This commit only updates documentation. It adds error code 313 to the documented error lists for several Core Lightning commands (fundpsbt, utxopsbt, txprepare, multiwithdraw, and upgradewallet). The error code already existed in the code …

a34b9758by Peter Neuroth+30−86 files
No security note in commit
Low 25 AI analysisMessage 88 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

tools/build-release.sh: name the checksum file when verifying the signature

This commit fixes a release-script check that verifies the cryptographic signature on a file of checksums. Previously, the script only told GPG to verify the signature file itself. If someone replaced that signature file with an inline-sig…

Incorrect cryptographic verification logic in release toolingPotential false-positive signature verification with inline-signed .asc substitutionRelease-integrity hardening
8e495707by Peter Neuroth+5−21 file
No security note in commit
Low 42 AI analysisMessage 95 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

doc: pass the manifest explicitly to gpg --verify

This commit updates Core Lightning's release documentation to tell users and release managers to run gpg --verify with both the signature file and the manifest file named explicitly. The old one-argument form can silently succeed even if t…

Verification bypass risk in release artifact validationgpg --verify single-argument form can exit 0 without reading the intended manifestDocumentation-only hardening of release process
2dee8699by Peter Neuroth+9−62 files
Vendor flagged security relevance
Low 25 AI analysisMessage 58 · Thin
EP Elements ProjectCore Lightning BitcoinLightning Network

Cargo.lock: update dependencies

This commit is a routine update to the Rust dependency lock file (Cargo.lock), bumping many third-party libraries to newer patch or minor versions. The commit message gives no security reason for the update, and no verified references link…

Routine dependency refresh with no stated security rationaleUpdates to security-sensitive transitive crates (rustls, hyper, h2, tokio, webpki-roots) but no evidence these versions fix known vulnerabilitiesNo source-code changes or patch-specific fixes visible in the diff
c1551c55by daywalker90+298−2761 file
No security note in commit
High 80 AI analysisMessage 85 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

common: bound JSON nesting depth when parsing

This commit fixes a stack-overflow risk in Core Lightning's JSON parser. Before the fix, an attacker could send a valid JSON-RPC message containing thousands of nested brackets or braces. The parser's own helper functions used recursion fo…

Stack-overflow via deeply nested JSONRecursive JSON traversal without depth boundDenial-of-service vector in JSON-RPC input parsing
83f92e4bby Níckolas Goline+90−22 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 28 · Opaque
EP Elements ProjectCore Lightning BitcoinLightning Network

common: minor typo fixes

This commit only fixes typos and comment style. It changes two C-style comments from // to /* */ and corrects a grammar error in a documentation comment ('element' to 'elements'). There are no code behavior changes, no bug fixes, and no se…

273d7f02by w3lld1+3−32 files
No security note in commit
Informational 20 AI analysisMessage 90 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

pyln-testing: truncate long testnames

This change fixes a test-infrastructure bug in Core Lightning's Python testing helpers. When running tests against a PostgreSQL database, very long test names could be silently shortened by PostgreSQL, causing different test runs or nodes …

No security-relevant signal: change is in test framework code onlyFixes a test reliability issue, not a runtime vulnerabilityNo input sanitization, authentication, cryptography, or network changes
c4fe4cbaby Peter Neuroth+59−12 files
No security note in commit
Moderate 60 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: exclude immature coinbase outputs from fee rescue selection

This fix prevents Core Lightning from trying to use freshly created bitcoins (immature coinbase rewards) as emergency funds for fee-bump transactions. Such a transaction would be invalid under Bitcoin's rules and would be rejected by the n…

Consensus-invalid transaction generation preventedFee rescue / CPFP failure mode mitigatedCoinbase maturity check added to coin selection
34883ff7by cdecker+5−12 files
Vendor flagged security relevance
Moderate 59 AI analysisMessage 91 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

askrene: fix crash loading node bias with description

This commit fixes a bug in Core Lightning's askrene plugin that could prevent a node from restarting. When a saved routing layer contained a node bias with a description, the plugin accidentally freed the description's memory while using i…

Use-after-free / double-take of a tal-allocated string during plugin startupDenial-of-service-like symptom: lightningd aborts before replying to init, node cannot restartFixes publicly reported issue #9433 by endothermicdev
4681177dby Vincenzo Palazzo+2−32 files
No security note in commit
Informational 12 AI analysisMessage 91 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: restart the node which owns the layer in node bias test

This commit only fixes a test case so it actually exercises the intended code path. It does not change any production code, so it cannot introduce or fix a real-world security vulnerability by itself. The test change is a reproducer for a …

0f3f67a0by Vincenzo Palazzo+3−21 file
No security note in commit
High 78 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

dualopend: bound the feerates a peer opens at

This commit fixes a bug in Core Lightning's experimental dual-funded channel feature. When another node tried to open a channel, Core Lightning was not checking whether the proposed transaction fees were reasonable. A peer could request a …

Missing input validation on wire-parsed feerate fieldsPeer could induce signing and storage of feerate == 0RBF remote path allowed unbounded upward feerate walks
ba08356fby cdecker+140−04 files
Vendor flagged security relevance
High 72 AI analysisMessage 100 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: regression coverage for out-of-range feerates

This commit adds regression tests for three related bugs where wildly wrong Bitcoin transaction feerates could enter Core Lightning. In the worst case, a malicious or broken fee source could make the node think a feerate was zero (due to a…

Integer overflow in feerate conversion (u32 wrap from 0xFFFFFFFF perkb to 0 perkw)Absurd feerate from external fee source bypassing sanity ceilingDatabase-stored out-of-range feerate causing startup abort/crash loop
65bdbc47by cdecker+137−02 files
No security note in commit
Moderate 64 AI analysisMessage 86 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

lightningd: don't assert on funding feerates read from the db

This update fixes a crash bug in Core Lightning. When the software tried to list details of a channel opening in progress, it could crash if a stored fee rate was extremely large or zero. The crash happened because the code used an interna…

Integer overflow in RBF escalation (u32 * 25 / 24) leading to assertion failureAssertion failure in read-only introspection RPC (listpeerchannels) causing crash-loop at startupDatabase value treated as invariant despite originating from external fee estimator
d67c4936by cdecker+72−227 files
Vendor flagged security relevance
Moderate 53 AI analysisMessage 86 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: clamp absurd inflight funding feerates on upgrade

This commit fixes a bug where Core Lightning nodes could get stuck in a crash loop. If a node had previously stored an extremely high or zero fee rate for an in-progress channel funding operation (a 'splice' or dual-funded channel RBF), a …

Integer overflow in fee-rate calculation (u32 overflow when multiplying by 25/24)Assertion failure leading to daemon crash loop at startupDatabase migration clamps out-of-range stored funding feerates
f057c692by cdecker+34−01 file
Vendor flagged security relevance
Repository ledger

Explore captured commits

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

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.

Lower-prioritybwatch: fire blockdepth notifications per blockby Sangbida Chaudhuri · b5c5fe4b · May 11, 2026 · 5 filesMessage 80 · StrongInformational 23Details
Commit message · Sangbida Chaudhuri

bwatch: fire blockdepth notifications per block

Subdaemons like channel_open and onchaind care about confirmation
depth, not the underlying tx. Walk blockdepth_watches on every new
block and send watch_found with the current depth to each owner.

This is what keeps bwatch awake in environments like Greenlight,
where we'd otherwise prefer to hibernate: as long as something is
waiting on a confirmation milestone, the blockdepth watch holds the
poll open; once it's deleted, we're free to sleep again.

Depth fires before the per-tx scan so restart-marker watches get a
chance to spin up subdaemons before any outpoint hits land for the
same block. Watches whose start_block is ahead of the tip are stale
(reorged-away, awaiting delete) and skipped.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 23/100

This commit adds a new internal notification path in Core Lightning's block-watching plugin. It makes the plugin send a depth update to other parts of the node every time a new block arrives, so components waiting for confirmation milestones (like channel-close handling) wake up on time. The change itself is a feature/fix for reliability in hibernating environments such as Greenlight, not a patch for an externally reported security vulnerability. There is no evidence in the commit or supplied references of an exploitable weakness.

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-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-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.

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: 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.

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.

AI review queuedbwatch: detect reorgs and roll back tipby Sangbida Chaudhuri · 65c92ec3 · May 11, 2026 · 3 filesMessage 68 · AdequateLow 46Details
Commit message · Sangbida Chaudhuri

bwatch: detect reorgs and roll back tip

When handle_block fetches the next block, validate its parent hash
against our current tip. If they disagree we're seeing a reorg: pop our
in-memory + persisted tip via bwatch_remove_tip, walk the history one
back, and re-fetch from the new height. Each fetch may itself reorg
further, so the loop naturally peels off as many stale tips as needed
until the chain rejoins.

After every rollback, tell watchman the new tip via
revert_block_processed so its persisted height tracks bwatch's. If we
crash before the ack lands, watchman's stale height will be higher than
ours on restart, which retriggers the rollback.

If the rollback exhausts our history (we rolled back past the oldest
record we still hold) we zero current_height/current_blockhash and let
the next poll re-init from bitcoind's tip.

Notifying owners that their watches were reverted lands in a subsequent
commit.

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

This commit adds blockchain reorganization (reorg) handling to Core Lightning's 'bwatch' plugin. A reorg happens when the Bitcoin network temporarily replaces a known block with a different one. Previously, bwatch appears to have blindly trusted each new block's parent hash, which could have left the plugin tracking an invalid or forked chain. The patch detects mismatched parent hashes, rolls back its internal tip one block at a time, and tells another component ('watchman') to do the same. It is a defensive correctness fix rather than an active exploit patch; the commit message notes that notifying users whose transactions were affected is deferred to a later commit.