EP
← All projectsElements Project

Core Lightning

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

BitcoinLightning NetworkNormal
Repository coverage

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

158security candidates263second-pass queue137AI analyses
147commits · 30 days
225commits · 60 days
803commits · 180 days
1853commits · 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
430Strong · 80–100
1163Adequate · 60–79
231Thin · 40–59
29Opaque · 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.
Rusty Russell9587363072
Sangbida Chaudhuri1463129066
Dusty Daemon771310066
ShahanaFarooqui931010063
daywalker908953062
Níckolas Goline4054076
Lagrang37642069
Christian Decker3643072
Vincenzo Palazzo833080
Chandra Pratap5622082
ekzyis222063
Peter Neuroth9711070
Analysis record

Published AI watches

Last scanned 20 minutes ago

Informational 23 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

downgrade: we need to remove "impressions" from askrene datastore when downgrading to v26.06.

This is a database downgrade helper fix, not a live network vulnerability. Core Lightning's downgrade tool previously failed to strip out new 'channel impression' records when rolling a database back to version v26.06. The patch teaches th…

Database downgrade path could leave incompatible records in older schemaOffline tool only; no remote or on-chain triggerFix prevents potential node startup failure after version rollback
4d926285by Rusty Russell+43−111 file
No security note in commit
Low 31 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

downgrade tool: fix invalid memory bug

This commit fixes a typo in a database downgrade helper tool. The bug caused the tool to pass a negative number (turned into a huge positive size) when copying data, which led to an out-of-memory (OOM) error. The fix swaps two variable nam…

Integer underflow / negative-to-size_t wrap leading to excessive allocationOut-of-memory crash in maintenance toolMemory corruption potential if allocation somehow succeeded
42995326by Lagrang3+8−81 file
No security note in commit
Informational 16 AI analysisMessage 90 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

add a test for downgrading askrene datastore

This commit adds a regression test for Core Lightning's database downgrade path. It ensures that when a user downgrades from an upcoming v26.09 release to an older version (v26.06), the new 'impressions' data added by the askrene routing s…

Database downgrade path for new askrene schema (impressions table)Regression test only; no production code changeNo input validation, cryptography, network, or authorization changes
1818553eby Lagrang3+156−13 files
No security note in commit
Low 25 AI analysisMessage 65 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

lightning-hsmtool: Fix getsecret does not show mnemonic after typing passphrase

This is a bug fix in a command-line helper tool used by Core Lightning node operators. The `getsecret` command was accidentally refusing to show the wallet recovery words (mnemonic) when the wallet was protected by a passphrase. After the …

Functional bug in secret-recovery pathError path blocked legitimate mnemonic recoveryNo input validation, memory-safety, or cryptographic change
8480f6c2by ekzyis+1−21 file
No security note in commit
Informational 12 AI analysisMessage 60 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

tests: add regression test for hsmtool commands with passphrase

This commit only adds and updates a regression test in the project's test suite. It checks that the hsmtool utility correctly handles both empty and non-empty passphrases when working with BIP39 mnemonic-based wallet secrets. There is no c…

Regression test added for passphrase handling in hsmtoolNo production code changes observedTest-only change to tests/test_wallet.py
8c42be35by ekzyis+47−201 file
No security note in commit
Low 33 AI analysisMessage 76 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wally: update libwally to v1.5.6

This commit updates the bundled libwally library to version 1.5.6. The practical effect is that calling the JSON-RPC `signpsbt` command on a PSBT that is already signed now succeeds as a harmless no-op, instead of returning an error on Bit…

Dependency update to incorporate upstream bug fixBehavior change from error to no-op on re-signing signed PSBTsTaproot keypath handling change in upstream cryptographic library
37526ca4by daywalker90+7−82 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: rename b32script to scriptpubkey in PSBT change paths

This commit is a simple variable rename inside a Bitcoin/Lightning wallet file. The old name 'b32script' suggested all change addresses were bech32 format, but the project now uses a newer address type (p2tr) by default. The developer rena…

b8a60579by Sangbida Chaudhuri+12−141 file
No security note in commit
Low 44 AI analysisMessage 78 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: register scriptpubkey watches at startup

This change makes Core Lightning register long-lasting 'watches' for all wallet deposit addresses when the node starts up, so the new bwatch plugin can spot incoming payments from the first block it scans. It also removes a now-redundant p…

Change is part of an experimental chain-watcher (bwatch) featureAdds startup registration of scriptPubKey watches for all derived wallet keysRemoves a redundant unconfirmed-change watch, relying on the new blanket coverage
4a951d65by Sangbida Chaudhuri+89−114 files
No security note in commit
Low 29 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: dual-write chaintopology UTXO changes into our_outputs

This is a database refactoring commit in Core Lightning. It makes the wallet write UTXO (unspent transaction output) state to a new table called our_outputs in addition to the legacy outputs table, while reads still use the old table. The …

Database schema migration with dual-write mirror patternNo security claim in commit title or messageNo CVE, advisory, or researcher attribution in commit metadata
824e8195by Sangbida Chaudhuri+118−162 files
No security note in commit
Low 32 AI analysisMessage 68 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: record bwatch-discovered wallet outputs

This commit adds new wallet bookkeeping code for Core Lightning. It records Bitcoin deposits found by a new chain-watcher ('bwatch') into database tables and handles blockchain reorganizations by demoting transactions back to unconfirmed r…

New database write paths for wallet UTXOs and transactionsReorg revert logic demotes rather than deletes rows to preserve metadataOwner-string constructors added to avoid silent unwatch failures from format mismatches
bc021011by Sangbida Chaudhuri+543−07 files
No security note in commit
Informational 18 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: add our_outputs + our_txs schema migrations

This commit only adds two new empty database tables (our_outputs and our_txs) to Core Lightning's wallet. It is a preparatory schema change for a future feature; no code reads from or writes to these tables yet, and no existing behavior is…

Schema-only migration with no runtime codeNew tables are not yet populated or queried by any code pathDesign note: sentinel 0 replaces NULL for blockheight/txindex/reserved_til, which could reduce NULL-handling bugs in future code
ea4d1fcaby Sangbida Chaudhuri+38−01 file
No security note in commit
Low 28 AI analysisMessage 70 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: add migrate_backfill_bwatch_tables

This commit adds a database migration that copies existing wallet data into new tables used by an upcoming 'bwatch' wallet component. It is a data backfill, not a code fix for an active vulnerability. The main risk is that if the migration…

Database migration touching wallet UTXO and transaction tablesPotential for data inconsistency if mapping logic is wrongON CONFLICT DO NOTHING prevents overwrite but could hide duplicate-key anomalies
2e23893bby Sangbida Chaudhuri+513−04 files
No security note in commit
Low 27 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: mirror bwatch writes into legacy outputs table

This change is a behind-the-scenes bookkeeping patch for Core Lightning's wallet database. The project is moving to a new table (`our_outputs`) for tracking spendable coins, but older versions of the software still read from the old table …

Race-condition guard for foreign-key-backed confirmation_height and spend_height when bwatch is ahead of chaintopologyTemporary mirroring to keep legacy outputs table consistent with new our_outputs tableON CONFLICT DO NOTHING used for legacy insert to avoid duplicate-key failures
bba68e0aby Sangbida Chaudhuri+101−62 files
No security note in commit
Moderate 51 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: Update the max_index cache when issuing new addresses

This commit fixes a bug where Core Lightning's in-memory record of the highest address index could fall out of step with the database. When a user generated a new on-chain address, the code updated the database directly but left the cached…

Cache/database inconsistency in address index trackingPotential for stale lower index to overwrite newer persisted indexFreshly generated addresses invisible to wallet rescan/listing until restart
d05815f5by Christian Decker+37−292 files
No security note in commit
Informational 15 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

wallet: Cache the max_index for bip32 and bip86 address indices

This commit is a straightforward performance optimization. It caches two address-index values in memory instead of reading them from the database twice for every transaction output in every scanned block. The change fixes a slowdown during…

565da833by Christian Decker+15−52 files
No security note in commit
Informational 18 AI analysisMessage 90 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

common: add randbytes() wrapper to override cryptographic entropy: $CLN_DEV_ENTROPY_SEED

This commit adds a developer-only feature that lets programmers override the randomness source used by Core Lightning during testing, via an environment variable. It is explicitly gated behind 'developer mode' and is not intended for produ…

New cryptographic-randomness override mechanism, but explicitly developer-mode onlyEnvironment-variable seeding could reduce entropy if accidentally enabled in productionNo production code changes visible in the diff
1c925e0aby Rusty Russell+29−05 files
No security note in commit
Low 37 AI analysisMessage 83 · Strong
EP Elements ProjectCore Lightning BitcoinLightning Network

common: don't consume deterministic randbytes stream for trace ids

This change fixes a subtle bug in Core Lightning's tracing code. When running with a special developer-only deterministic randomness override (CLN_DEV_ENTROPY_SEED), trace IDs were being drawn from the same predictable random stream used f…

Deterministic RNG stream contamination by observability codeTransaction output divergence between instrumented and non-instrumented buildsDeveloper-only entropy override affecting reproducibility of transaction generation
23b4b38aby ShahanaFarooqui+18−31 file
No security note in commit
Informational 19 AI analysisMessage 73 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

common: don't trigger siphash_seed() init from span hashing either.

This is a small bug-fix commit in Core Lightning's tracing code. It fixes a situation where enabling tracing accidentally changed the sequence of random numbers used elsewhere in the program, causing test outputs to differ between builds w…

No direct memory safety issueNo input validation bypassNo authentication or authorization change
e54fe678by ShahanaFarooqui+6−01 file
No security note in commit
Informational 15 AI analysisMessage 70 · Adequate
EP Elements ProjectCore Lightning BitcoinLightning Network

autogenerate-rpc-examples.py: disable entropy for generation.

This commit changes Core Lightning's internal test tooling so that automatically generated RPC documentation examples use predictable randomness and a fixed clock time. It only affects test/example generation code, not the production Light…

81443075by Rusty Russell+14−12 files
No security note in commit
Informational 15 AI analysisMessage 50 · Thin
EP Elements ProjectCore Lightning BitcoinLightning Network

autogenerate-rpc-examples.py: pin the full sorted UTXO set for multiwithdraw examples

This commit only changes an internal test script that automatically generates example RPC commands for documentation. It makes the examples more deterministic by explicitly selecting which coins the test wallet uses, so the generated docum…

6f464e46by ShahanaFarooqui+35−81 file
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.

AI review queuedwallet: handle bwatch wallet/utxo spend notificationsby Sangbida Chaudhuri · 4ba051ca · Jul 27, 2026 · 3 filesMessage 73 · AdequateTriage 12Details
Commit message · Sangbida Chaudhuri

wallet: handle bwatch wallet/utxo spend notifications

When bwatch_got_utxo() records a wallet output, it arms an outpoint
watch owned by wallet/utxo/<txid>:<outnum>. This adds the receiving
end of that watch: the dispatch entry plus the found/revert handlers.

On watch_found (a tx consumed the outpoint): mark the output spent in
our_outputs, store the spending tx in our_txs, and emit a withdrawal
coin movement. On watch_revert (a reorg removed that tx): clear
spendheight so the UTXO is spendable again.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI review queuedwallet: handle reorgs for our_outputs/our_txs by handby Sangbida Chaudhuri · bcdea215 · Jul 27, 2026 · 1 fileMessage 73 · AdequateTriage 20Details
Commit message · Sangbida Chaudhuri

wallet: handle reorgs for our_outputs/our_txs by hand

The legacy tables rely on their blocks(height) ON DELETE SET NULL
foreign keys to mark rows unconfirmed/unspent when a block is reorged
out. our_outputs/our_txs deliberately carry no blocks FK (bwatch does
not maintain a blocks table), so block disconnect and rollback must
demote their blockheight/spendheight fields explicitly.

Demote, never delete: a row also carries state the chain cannot
re-deliver (reserved_til, onchaind close metadata), and this path runs
not just on real reorgs but on every startup, when chaintopology
invalidates its rescan window. Rediscovery re-promotes the row via
wallet_add_our_output / wallet_transaction_add; a tx that never
re-confirms just stays unconfirmed and unspendable.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
defensive validationsigning or wallet pathsecond-pass: near security thresholdsecond-pass: security-sensitive path
AI review queuedwallet: read UTXO state from our_outputsby Sangbida Chaudhuri · 0a10e74e · Jul 27, 2026 · 2 filesMessage 68 · AdequateTriage 12Details
Commit message · Sangbida Chaudhuri

wallet: read UTXO state from our_outputs

With every writer dual-writing since the previous two commits, flip
the readers: all UTXO queries (listfunds, coin selection, reservations,
onchaind close info) now come from our_outputs, and the legacy-only
read helpers (wallet_stmt2output, gather_utxos, db_get_unspent_utxos)
are deleted.

our_output_row_to_utxo replaces wallet_stmt2output, using channel_dbid
to discriminate HD outputs from channel-close outputs, and
wallet_get_spendable_utxos centralizes the unspent+unreserved query
that wallet_find_utxo and wallet_has_funds previously duplicated.

migrate_setup_coinmoves keeps reading the legacy table directly: that
migration runs at v25.09, before our_outputs exists.

Co-authored-by: Cursor <cursoragent@cursor.com>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
Lower-prioritytests: query our_outputs in test_connection.pyby Sangbida Chaudhuri · 1cc6ae6e · Jul 27, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · Sangbida Chaudhuri

tests: query our_outputs in test_connection.py

The wallet's live UTXO state now lives in our_outputs; point the raw-SQL
assertions at it (spent means spendheight IS NOT NULL, reserved means
reserved_til > 0).

Co-authored-by: Cursor <cursoragent@cursor.com>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritytests: query our_outputs in test_misc.pyby Sangbida Chaudhuri · 2eccf473 · Jul 27, 2026 · 2 filesMessage 78 · AdequateTriage 0Details
Commit message · Sangbida Chaudhuri

tests: query our_outputs in test_misc.py

Same raw-SQL switch as test_connection.py: read the wallet's UTXO state
from our_outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritylightningd: only run watchman under --experimental-bwatchby Sangbida Chaudhuri · 92402cf6 · Jul 27, 2026 · 2 filesMessage 73 · AdequateTriage 0Details
Commit message · Sangbida Chaudhuri

lightningd: only run watchman under --experimental-bwatch

The flag is registered by the bwatch plugin, not lightningd, so peek
at the parsed configvars. Without it ld->watchman stays NULL and the
watchman_* entry points are no-ops, leaving chain_topology as the only
chain watcher: bwatch and the legacy path must not race each other.

The bwatch pytests opt in explicitly (with rescan=0) instead of
enabling bwatch globally.

Changelog-Experimental: wallet: Add bwatch-driven wallet transaction and UTXO tracking behind --experimental-bwatch.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Security candidatewallet: rename b32script to scriptpubkey in PSBT change pathsby Sangbida Chaudhuri · b8a60579 · Jul 27, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Sangbida Chaudhuri

wallet: rename b32script to scriptpubkey in PSBT change paths

Change addresses are no longer bech32-only (p2tr is the default form),
so the old name was misleading. Pure rename, no functional change;
also drop the unused txfilter.h include.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Informational 15/100

This commit is a simple variable rename inside a Bitcoin/Lightning wallet file. The old name 'b32script' suggested all change addresses were bech32 format, but the project now uses a newer address type (p2tr) by default. The developer renamed the variable to 'scriptpubkey' to avoid confusion and removed an unused header file. No behavior of the program changes.

AI review queuedwallet: make datastore helpers self-wrap a wallet transactionby Sangbida Chaudhuri · ae1a3347 · Jul 27, 2026 · 1 fileMessage 85 · StrongTriage 12Details
Commit message · Sangbida Chaudhuri

wallet: make datastore helpers self-wrap a wallet transaction

The four wallet_datastore_{get,create,update,remove} helpers used to
require the caller to be inside a wallet transaction; otherwise the
underlying db_prepare_v2 fatals at db/utils.c:103 with "Attempting to
prepare a db_stmt outside of a transaction".

watchman persists its pending bwatch ops through these helpers from
plugin callbacks that run outside any transaction, so wrap one on
demand.

Co-authored-by: Cursor <cursoragent@cursor.com>

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI review queuedtests: update test_wallet.py raw-SQL queries for our_outputsby Sangbida Chaudhuri · d14ee378 · Jul 27, 2026 · 1 fileMessage 83 · StrongTriage 12Details
Commit message · Sangbida Chaudhuri

tests: update test_wallet.py raw-SQL queries for our_outputs

The wallet no longer writes UTXO state to the legacy outputs table's
status/spend_height columns, so tests that peek at the database
directly must read our_outputs instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
Security candidatewallet: register scriptpubkey watches at startupby Sangbida Chaudhuri · 4a951d65 · Jul 27, 2026 · 4 filesMessage 78 · AdequateLow 44Details
Commit message · Sangbida Chaudhuri

wallet: register scriptpubkey watches at startup

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

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

Co-authored-by: Cursor <cursoragent@cursor.com>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
secret or key materialsigning or wallet path
AI analysis · Low 44/100

This change makes Core Lightning register long-lasting 'watches' for all wallet deposit addresses when the node starts up, so the new bwatch plugin can spot incoming payments from the first block it scans. It also removes a now-redundant per-transaction watch on unconfirmed change outputs. The patch is a functional improvement for the experimental bwatch feature, not a clear-cut security fix, but a missing or incomplete watch could in principle cause deposits to be overlooked.

Security candidatewallet: dual-write chaintopology UTXO changes into our_outputsby Sangbida Chaudhuri · 824e8195 · Jul 27, 2026 · 2 filesMessage 73 · AdequateLow 29Details
Commit message · Sangbida Chaudhuri

wallet: dual-write chaintopology UTXO changes into our_outputs

Before this commit:

chaintopology ──────────────> outputs
bwatch ─────────────────────> our_outputs
└────────────────────> outputs (downgrade mirror)

wallet reads ───────────────> outputs

After this commit:

chaintopology ──────────────> our_outputs
└─────────────> outputs (downgrade mirror)

bwatch ─────────────────────> our_outputs
└────────────────────> outputs (downgrade mirror)

wallet still reads ─────────> outputs

Make each existing chaintopology writer update both representations of
its UTXO state:

- wallet_add_utxo and wallet_add_onchaind_utxo insert into both tables;
- db_set_utxo updates reservations in both tables;
- wallet_confirm_tx updates confirmation heights in both tables; and
- wallet_outpoint_spend marks outputs spent in both tables.

Keeping each pair of writes in the existing helper makes the downgrade
mirror explicit without duplicating SQL at its callers. Reads remain on
legacy `outputs` until the following commit switches them to our_outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trustsigning or wallet path
AI analysis · Low 29/100

This is a database refactoring commit in Core Lightning. It makes the wallet write UTXO (unspent transaction output) state to a new table called our_outputs in addition to the legacy outputs table, while reads still use the old table. The goal is to prepare for a future migration, not to fix an active security bug. There is no direct evidence in the commit that this change itself creates or fixes a vulnerability.

Lower-prioritytests: add our_tables backfill upgrade testby Sangbida Chaudhuri · b3717085 · Jul 27, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · Sangbida Chaudhuri

tests: add our_tables backfill upgrade test

Upgrade a pre-bwatch snapshot db and check the migration mirrored
outputs/transactions into our_outputs/our_txs, listfunds still reports
the old UTXOs, and the wallet can receive and withdraw new funds.

Co-authored-by: Cursor <cursoragent@cursor.com>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Security candidatewallet: record bwatch-discovered wallet outputsby Sangbida Chaudhuri · bc021011 · Jul 27, 2026 · 7 filesMessage 68 · AdequateLow 32Details
Commit message · Sangbida Chaudhuri

wallet: record bwatch-discovered wallet outputs

Add the wallet helpers and watch handlers that turn a bwatch
scriptpubkey match into our_txs and our_outputs rows. They validate
the matching output, notify invoice accounting, record confirmed
deposits, and install watches for later spends.

The watch_revert handler demotes the rows back to unconfirmed (the 0
sentinel) rather than deleting them: a row also carries state a
rediscovery cannot restore (reserved_til, onchaind close metadata),
and the still-armed watches re-promote it if the tx confirms again.
This matches the legacy tables, whose blocks(height) foreign keys
demote rows to NULL when the block row is removed.

Unlike got_utxo(), this path does not write transaction_annotations:
nothing reads per-transaction annotations anymore, so only the legacy
scanner keeps populating them (for downgrade, like the other legacy
tables).

The watchman dispatch entry is wired in the following commit. Keep this
path alongside got_utxo() and wallet_transaction_add(): the legacy
scanner must continue populating outputs and transactions for one release
so downgrades do not require a rescan.

Co-authored-by: Cursor <cursoragent@cursor.com>

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trustdefensive validationsigning or wallet path
AI analysis · Low 32/100

This commit adds new wallet bookkeeping code for Core Lightning. It records Bitcoin deposits found by a new chain-watcher ('bwatch') into database tables and handles blockchain reorganizations by demoting transactions back to unconfirmed rather than deleting them. It is a feature/refactoring commit, not a fix for a known vulnerability, and the commit message does not describe any security issue.

AI review queuedwallet: route transaction reads/writes through our_txsby Sangbida Chaudhuri · 2c1ab4d0 · Jul 27, 2026 · 2 filesMessage 73 · AdequateTriage 12Details
Commit message · Sangbida Chaudhuri

wallet: route transaction reads/writes through our_txs

Now that the bwatch wallet path records every relevant transaction in
our_txs, point the wallet's transaction readers at that table.

Since our_txs.blockheight is NOT NULL with 0 = unconfirmed, the legacy
NULL handling disappears: wallet_transactions_by_height no longer needs
its "IS NULL vs = ?" query split, and wallet_transaction_height reads
the column unconditionally.

wallet_transaction_add keeps dual-writing the legacy transactions
table: the close path still inserts into channeltxs, whose
transaction_id foreign key points at transactions(id), and
wallet_get_funding_spend joins it. That legacy write can only go away
with channeltxs itself.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
Security candidatewallet: add our_outputs + our_txs schema migrationsby Sangbida Chaudhuri · ea4d1fca · Jul 27, 2026 · 1 fileMessage 73 · AdequateInformational 18Details
Commit message · Sangbida Chaudhuri

wallet: add our_outputs + our_txs schema migrations

The next commits move wallet UTXO and tx tracking off chaintopology and
onto bwatch. bwatch doesn't maintain a blocks table, but the legacy
utxoset, transactions and channeltxs tables all have FOREIGN KEY
references into blocks(height) (CASCADE / SET NULL), so we can't just
retarget the existing tables.

Instead, introduce parallel tables (our_outputs, our_txs) without the
blocks(height) FK. The new bwatch-driven code writes only to these,
the legacy tables stay populated by the existing code path during this
release so downgrade still works, and a future release can drop them
once we're past the downgrade window.

Losing the FK also changes what NULL means. In the legacy tables a
NULL blockheight was never written by hand: the ON DELETE SET NULL
trigger produced it when a reorg deleted the block row. These tables
have no such trigger, so unconfirmed is stored as blockheight 0
(NOT NULL) instead, for three reasons:

- everything feeding these tables already speaks u32-with-0: watchman
notifications carry blockheight as a required JSON number, and
wallet_transaction_height() has always returned 0 for unconfirmed,
so values bind straight through without a NULL/non-NULL branch at
every read and write site;

- integer comparisons keep working: the unconfirmed->confirmed
promotion is a single "WHERE blockheight < ?" (0 sorts below any
real height) and reorg rollback is "SET blockheight = 0 WHERE
blockheight >= ?", where a NULL row would match neither;

- it removes the footgun the legacy code warned about ("Note:
blockheight=NULL is not the same as is NULL!"), where lookups had
to branch between "= ?" and "IS NULL".

The same logic gives txindex 0 = unconfirmed/unknown (a *confirmed*
txindex of 0 means coinbase, which blockheight disambiguates) and
reserved_til 0 = not reserved. NULL survives only where 0 is a real
value or genuinely ambiguous: spendheight (NULL = unspent),
channel_dbid, commitment_point.

Schema only here — wallet handlers that write into these tables and the
backfill from outputs/transactions land in subsequent commits.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trustsigning or wallet path
AI analysis · Informational 18/100

This commit only adds two new empty database tables (our_outputs and our_txs) to Core Lightning's wallet. It is a preparatory schema change for a future feature; no code reads from or writes to these tables yet, and no existing behavior is changed. There is no direct security vulnerability here, though any new table design could later affect how safely wallet data is tracked.

Security candidatewallet: add migrate_backfill_bwatch_tablesby Sangbida Chaudhuri · 2e23893b · Jul 27, 2026 · 4 filesMessage 70 · AdequateLow 28Details
Commit message · Sangbida Chaudhuri

wallet: add migrate_backfill_bwatch_tables

Populate our_outputs/our_txs from the legacy outputs/transactions
tables so the bwatch wallet path starts with the same state as the
existing wallet.

Use outputs rather than utxoset because it already contains only
wallet-owned rows and carries wallet metadata like reservations and
channel-close info.

Downgrade only drops the new tables: later commits keep mirroring
writes into the legacy tables, so no copy-back migration is needed.

Co-authored-by: Cursor <cursoragent@cursor.com>

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
update trustsigning or wallet path
AI analysis · Low 28/100

This commit adds a database migration that copies existing wallet data into new tables used by an upcoming 'bwatch' wallet component. It is a data backfill, not a code fix for an active vulnerability. The main risk is that if the migration copies data incorrectly, a future version of Core Lightning could misread the wallet state—potentially showing wrong balances, missing transactions, or in rare cases making unsafe spending decisions. The commit includes tests that check the copy logic for several common cases.

Security candidatewallet: mirror bwatch writes into legacy outputs tableby Sangbida Chaudhuri · bba68e0a · Jul 27, 2026 · 2 filesMessage 73 · AdequateLow 27Details
Commit message · Sangbida Chaudhuri

wallet: mirror bwatch writes into legacy outputs table

The bwatch path writes wallet UTXOs to our_outputs while the legacy
`outputs` table is what a downgraded binary reads. Mirror every
our_outputs write (insert, spend, unspend-on-spend-revert, reservation)
into `outputs` so a downgrade for one release needs no copy-back or
rescan. Reorg demotion needs no mirror: the legacy rows are demoted by
their blocks(height) foreign keys when chaintopology removes the block.
The mirroring stops in the release that removes chaintopology, freezing
all the legacy tables at the same height.

The spend mirror guards its spend_height the same way the insert guards
confirmation_height: outputs.spend_height has a foreign key on
blocks(height), which only chaintopology populates, and bwatch can
deliver the spend before chaintopology has processed that block.
Record NULL in that case (status already marks the row spent) and let
chaintopology's own spend pass fill in the height.

The wallet still reads from `outputs`; switching reads over to
our_outputs comes next.

Co-authored-by: Cursor <cursoragent@cursor.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
update trustsigning or wallet path
AI analysis · Low 27/100

This change is a behind-the-scenes bookkeeping patch for Core Lightning's wallet database. The project is moving to a new table (`our_outputs`) for tracking spendable coins, but older versions of the software still read from the old table (`outputs`). The patch copies every new-table write back into the old table so that if a user downgrades to the previous release, their wallet still sees the correct coins and balances. It is not a fix for an externally exploitable bug; it is a compatibility/migration safeguard.

Lower-prioritypyln-testing: wait for listen port release before starting a nodeby Ken Sedgwick · 1136b217 · Jul 27, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · Ken Sedgwick

pyln-testing: wait for listen port release before starting a node

A node's connectd is a separate process holding the listen socket,
and on shutdown it exits on its own schedule after lightningd itself
is gone -- under valgrind, its teardown can lag by tens of seconds.
If a test restarts the node in that window, the new connectd fails
with 'Address already in use', lightningd exits, and the test times
out waiting for 'Server started with public key'. Seen in CI in
test_emergencyrecoverpenaltytxn, where the port was still held 37
seconds after the old connectd began shutting down.

The filesystem port locks don't cover this: they keep other workers
from reserving the port, but the restarting node owns its reservation
both times; nothing waits for the old connectd to actually release
the socket.

Before launching lightningd, bind-probe the node's port (with
SO_REUSEADDR, matching connectd, so TIME_WAIT sockets don't count as
in use) and only proceed once the bind succeeds.

Fixes: #9354
Changelog-None

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Lower-priorityplugins: defer spenderp awaiting-channel recoveryby bittylicious · b2d3fd84 · Jul 26, 2026 · 1 fileMessage 45 · ThinTriage 0Details
Commit message · bittylicious

plugins: defer spenderp awaiting-channel recovery

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Lower-priorityplugins: recover awaiting channels after initby bittylicious · 83529491 · Jul 26, 2026 · 1 fileMessage 45 · ThinTriage 0Details
Commit message · bittylicious

plugins: recover awaiting channels after init

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI review queuedwallet: Read the max_index for addresses from the in-memory cacheby Christian Decker · 5b9ff9ff · Jul 23, 2026 · 1 fileMessage 50 · ThinTriage 12Details
Commit message · Christian Decker

wallet: Read the max_index for addresses from the in-memory cache

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
Security candidatewallet: Update the max_index cache when issuing new addressesby Christian Decker · d05815f5 · Jul 23, 2026 · 2 filesMessage 73 · AdequateModerate 51Details
Commit message · Christian Decker

wallet: Update the max_index cache when issuing new addresses

The write-through cache added for the address max_index was only kept in
sync in wallet_can_spend(). wallet_get_newindex() still read and wrote
the bip32_max_index/bip86_max_index db vars directly, leaving the
in-memory cache stale after every newaddr. Since listaddresses and the
rescan window now read from that cache, freshly issued addresses were
invisible until the next restart (and wallet_can_spend could even write a
stale, lower value back to the db).

Route all reads and writes through wallet_max_addr_index() and
wallet_set_max_addr_index() so the cache and the db never diverge.

Changelog-None
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
secret or key materialsigning or wallet path
AI analysis · Moderate 51/100

This commit fixes a bug where Core Lightning's in-memory record of the highest address index could fall out of step with the database. When a user generated a new on-chain address, the code updated the database directly but left the cached value unchanged. That meant newly created addresses would not show up in address lists or rescan windows until the node was restarted, and in some cases the stale cache could overwrite the newer database value with an older one. The patch routes all reads and writes through helper functions so the cache and database stay synchronized.

Security candidatewallet: Cache the max_index for bip32 and bip86 address indicesby Christian Decker · 565da833 · Jul 23, 2026 · 2 filesMessage 83 · StrongInformational 15Details
Commit message · Christian Decker

wallet: Cache the max_index for bip32 and bip86 address indices

We were looking up the index for the addresses to scan, twice, for
every single output, for every single TX for every block. No wonder
that was being slow.

Changelog-Fixed: wallet: Addressed a performance regression during blockchain scans

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
secret or key materialsigning or wallet path
AI analysis · Informational 15/100

This commit is a straightforward performance optimization. It caches two address-index values in memory instead of reading them from the database twice for every transaction output in every scanned block. The change fixes a slowdown during blockchain scans and does not alter security behavior.

AI review queueddocs: Fixing Ubuntu installation docs - updated release tag references - removed protobuf-compiler dependency - removed rustup default installation, changed it to only for Ubuntu <25.10 (rust <1.85) - added note about tzdata config halting executionby ScuttoZ · 947ed0f3 · Jul 22, 2026 · 1 fileMessage 85 · StrongTriage 0Details
Commit message · ScuttoZ

docs: Fixing Ubuntu installation docs
- updated release tag references
- removed protobuf-compiler dependency
- removed rustup default installation, changed it to only for Ubuntu <25.10 (rust <1.85)
- added note about tzdata config halting execution

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
Why it was queued
documentation-only discountsecond-pass: broader security terminology
Lower-priorityCI: set readme branch name to stableby daywalker90 · 6a243ef5 · Jul 22, 2026 · 1 fileMessage 57 · ThinTriage 0Details
Commit message · daywalker90

CI: set readme branch name to stable

Changelog-None

57/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount