LDK
← All projectsLightning Dev Kit

rust-lightning

Composable Rust libraries for building Lightning wallets, nodes, and services.

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

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

300security candidates261second-pass queue1606AI analyses
175commits · 30 days
261commits · 60 days
636commits · 180 days
1314commits · 365 days
Backfill bands
Aug 5 → Feb 6819 seen18 candidatesComplete
Feb 6 → Jun 6468 seen16 candidatesComplete
Jun 6 → Jul 6128 seen8 candidatesComplete
Jul 6 → Aug 561 seen3 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
704Strong · 80–100
856Adequate · 60–79
302Thin · 40–59
62Opaque · 0–39
3security candidates with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Matt Corallo58679418876
Elias Rohrer15415153667
auto-pr-bot571823287
Jeffrey Czyz19645182169
Wilmer Paulino15945155169
Valentine Wallace15715145169
Leo Nash11613116162
Vincenzo Palazzo11311183
Joost Jager16324162069
elnosh401434059
shaavan22622069
wpaulino2059082
Analysis record

Published AI watches

Last scanned 2 minutes ago

Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Correct FeeEstimator docs on the 253 sat/kW lower bound

This is a documentation-only edit. It corrects a misleading comment in the code that wrongly claimed all fee estimates returned to LDK are forced to be at least 253 satoshis per 1000 weight units. The new comment clarifies that this minimu…

ea2051feby auto-pr-bot+9−31 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Track splice confirmation while awaiting tx_signatures' (#5570)

This change fixes a bug in Lightning Dev Kit's splicing logic. During a splice, one side can broadcast the new funding transaction as soon as it has the other side's signatures. Previously, if that transaction confirmed on-chain before the…

State-machine inconsistency in channel funding lifecycleMissing chain-source watch for in-flight splice funding transactionPotential failure to send splice_locked after splice confirms during signature exchange
ca778e61by Matt Corallo+245−32 files
No security note in commit
Moderate 63 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Account for current HTLC fees in dust exposure' (#5690)

This change fixes how Lightning nodes calculate the financial risk from tiny ('dust') HTLCs when the current on-chain fee rate is higher than the node's own local fee estimate. Previously, the code only considered a buffered fee rate when …

Incorrect fee exposure accounting for dust HTLCsPotential to accept HTLCs whose commitment/HTLC-success fees exceed their value under current feerateEconomic griefing / forced-channel-closure cost manipulation
cc798f60by Matt Corallo+108−382 files
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Replace cloned array literal with slice::from_ref in reload test' (#5689)

This is a one-line code cleanup in a test file. It replaces a cloned array literal with a slice reference to silence a Rust compiler lint. There is no change to production code, no security fix, and no functional behavior change.

03ca832fby Matt Corallo+1−11 file
No security note in commit
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Replace cloned array literal with slice::from_ref in reload test

This is a one-line change in a test file to satisfy a Rust linter warning. It replaces a needless clone of a funding transaction with a reference-based slice construction. There is no functional change, no user-facing behavior change, and …

93e0129cby auto-pr-bot+1−11 file
No security note in commit
Informational 12 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix CI: rebuild test coin-selection impl and rework reused-ID balance test' (#5684)

This commit is a test-only fix for a broken continuous integration (CI) build. It updates a test mock to match a new function signature and rewrites an existing test to use three nodes instead of two so the test scenario remains valid unde…

17bac68aby Matt Corallo+26−202 files
No security note in commit
Moderate 68 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Guard pending closing signatures before channel_ready' (#5681)

This change fixes a Lightning channel bug where a malicious peer could renegotiate the closing transaction fee while the local node was still waiting for its own signer to produce the final signature. If allowed, the local node might combi…

State-machine guard expansion to prevent fee renegotiation while a closing signature is pendingRisk of combining mismatched signatures across different closing feesRegression test demonstrates malicious peer renegotiation attempt and expected warning rejection
a01273a2by Matt Corallo+169−21 file
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Release wallet UTXOs when FundingBuilder rejects a coin selection' (#5634)

This change fixes a wallet bug in rust-lightning where a UTXO could be selected for a Lightning funding transaction, then rejected because its previous transaction was too large to fit in a Lightning peer message. Previously, that rejectio…

API change to CoinSelectionSource::select_confirmed_utxos adding max_input_prevtx_serialized_lenWalletSync filters UTXOs by prevtx serialized length before selectionFundingBuilder enforces Lightning tx_add_input message-size limit at selection time
56054190by Matt Corallo+148−155 files
No security note in commit
Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Refuse to pay BOLT 12 invoices with records above experimental range

This commit hardens LDK's BOLT 12 payment logic so it refuses to pay invoices containing very large unknown record types (4 billion and up). These records are legal under the Lightning spec, but LDK doesn't understand them, so the change t…

Defensive refusal to pay invoices with unknown high-numbered TLV recordsReuses existing UnknownRequiredFeatures failure path instead of adding a new oneAdds explicit checks before payment state insertion and route construction
2970372fby auto-pr-bot+106−177 files
No security note in commit
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Read invoice TLV records above the experimental range

This commit fixes a backward-compatibility bug in LDK's BOLT 12 invoice parser. A previous change had capped the range of 'experimental' TLV record types at 4 billion, but the Lightning spec imposes no upper bound. As a result, invoices cr…

Backward-compatibility regression in deserialization of persisted channel monitorsDenial-of-service via unreadable monitor blocking all channel monitoringSpec compliance fix: TLV record types have no upper bound
9e28db58by auto-pr-bot+133−84 files
No security note in commit
High 74 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to sign messages that collide with gossip serializations' (#5677)

This change fixes a security issue where a signed text message could be crafted so that its prefixed form looks exactly like a Lightning 'node_announcement' gossip message. Because both use the same double-SHA256 hash and the same signing …

Signature replay / message confusion between signed messages and gossip announcementsForged `node_announcement` signatures via chosen-prefix message constructionNew validation rejects prefixed messages that deserialize as `UnsignedNodeAnnouncement`
ec40e097by Matt Corallo+74−148 files
Vendor flagged security relevance
Low 37 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Retry a single HTLC before abandoning an unfundable batch' (#5406)

This change fixes a corner case in how the Lightning node tries to claim multiple pending HTLCs (small Bitcoin payments locked in a channel) when the wallet cannot fund a single large batch transaction. Previously, if the multi-HTLC batch …

Funds-recovery robustness improvement: prevents premature abandonment of a single unbatched HTLCChange in error-handling arithmetic from checked_sub/saturating_sub with max(1)New unit tests covering both failed and successful singleton HTLC funding paths
643e8684by wpaulino+119−21 file
No security note in commit
Moderate 54 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to persist fresh monitors that alias archived monitors' (#5645)

This change prevents a Lightning node from accidentally overwriting an archived copy of a channel's security monitor with a brand-new one that happens to use the same identifier. In the old code, if a new channel reused the same identifier…

Data-loss prevention: stops archived ChannelMonitor from being overwritten by a later channel with the same keySafety guard added to both sync and async persistence pathsPersistence refusal surfaces as InProgress/UnrecoverableError rather than silent overwrite
3c606c11by Matt Corallo+298−332 files
No security note in commit
Moderate 52 AI analysisMessage 86 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Handle fee multiplication overflow when merging MPP paths' (#5288)

This change fixes a place in the Lightning payment routing code where adding up fees could overflow the maximum number a computer can store in a 64-bit integer. Previously, the code assumed this could never happen and would crash (panic) i…

Integer overflow in fee computationPreviously unreachable!() panic path reachableMPP path merge could trigger overflow
25f8a740by Matt Corallo+42−171 file
No security note in commit
Low 43 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Resume channels stuck awaiting a completed monitor persistence on reload' (#5610)

This commit fixes a bug where a Lightning node could get stuck after restarting. If the node crashed or restarted while it was still saving the initial channel monitor to disk, and that save later finished in another process, the restarted…

Fixes a state-machine stall on node reload that could leave channels non-functionalRemoves an overstrict assertion that would panic on a legitimate post-reload stateAdds explicit detection of monitor persistence completed in a prior process
11815ed1by Matt Corallo+334−74 files
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Correct KeysManager docs on spliced channels' remote_key derivation' (#5609)

This change only updates documentation and code comments in the Lightning Dev Kit library. It clarifies that a particular key-derivation setting is fixed when a channel is first opened and is not changed by splicing. No code behavior was a…

83a4d243by Matt Corallo+17−91 file
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix DelayedPaymentKey/HtlcKey from_basepoint docs and document justice tx witness script' (#5596)

This commit only changes documentation comments in two source files. It corrects the wording of how certain public keys are derived in the Lightning protocol and adds details about which witness script a signer must use when creating justi…

Documentation-only changeClarifies key derivation semantics for Lightning commitment transactionsClarifies justice transaction witness script requirements for signers
2f832195by Matt Corallo+44−62 files
No security note in commit
Informational 19 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Document that TokioSpawner requires all of LDK in a tokio context' (#5621)

This change only adds documentation comments to a Rust struct. It does not modify any executable code, so it cannot by itself introduce or fix a security vulnerability. The new text warns developers that using TokioSpawner incorrectly can …

Documentation-only changeNo code logic modifiedNo unsafe blocks added
6e555fa2by Matt Corallo+11−01 file
No security note in commit
High 70 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Make custom signers verify holder commitment sigs synchronously' (#5616)

This commit hardens how Lightning Dev Kit handles custom signing modules. Previously, LDK relied on each custom signer to check that the other party's signatures on a holder commitment transaction were valid. The change adds a ready-made v…

New synchronous signature-verification helper for holder commitment transactionsTrait documentation now mandates verification before Ok(()) because LDK acts immediatelyInMemorySigner now validates that holder funding key belongs to signer before signature checks
0e3b6d33by Matt Corallo+324−954 files
Vendor flagged security relevance
Moderate 64 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse channel_ready while the initial funding_signed is pending' (#5612)

This update fixes a corner case in the Lightning Dev Kit where a node could get confused if it received a 'channel_ready' message while still waiting for its own signer to produce the first commitment signature. The patch makes the node re…

State-machine confusion between funding_signed and channel_ready in async signer flowPremature channel_ready could advance counterparty_next_commitment_point before initial commitment is signedPatch closes channel rather than allowing inconsistent commitment state
d68d2235by Matt Corallo+101−12 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-priorityMerge PR 'Reject spendable output indices that truncate to a different UTXO' (#5506)by Matt Corallo · 7f291250 · Nov 6, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Reject spendable output indices that truncate to a different UTXO' (#5506)

from auto-pr-bot/bot/250-reject-spendable-output-indices-8821ec into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5506
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Re-sign closing transactions when the peer changes the output set' (#5507)by Matt Corallo · f6988f79 · Nov 6, 2026 · 3 filesMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Re-sign closing transactions when the peer changes the output set' (#5507)

from auto-pr-bot/bot/179-re-sign-closing-transactions-whe-4cfcb5 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5507
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
AI review queuedMerge PR 'Keep a zero-conf splice locked when its funding is unconfirmed' (#5505)by Matt Corallo · f42f24d4 · Nov 5, 2026 · 2 filesMessage 81 · StrongModerate 55Details
Commit message · Matt Corallo

Merge PR 'Keep a zero-conf splice locked when its funding is unconfirmed' (#5505)

from jkczyz/2026-10-0conf-splice-unconfirm-panic into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5505
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discountsecond-pass: broader security terminology
AI analysis · Moderate 55/100

This patch fixes a logic bug in how the Lightning node handles zero-confirmation splice transactions when they are temporarily kicked out of the blockchain by a reorganization. Previously, the code would incorrectly clear the 'splice_locked' state for a zero-conf splice when its funding transaction became unconfirmed, which could cause the node to resend splice_locked messages or panic. The fix keeps zero-conf splices locked even if the funding transaction is unconfirmed, matching the behavior of zero-conf channels. The commit title and test comments explicitly describe this as preventing a panic and incorrect re-signaling.

Lower-priorityMerge PR 'Only loop event processing again on a second concurrent call' (#5504)by Matt Corallo · cc2c1b36 · Nov 5, 2026 · 2 filesMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Only loop event processing again on a second concurrent call' (#5504)

from auto-pr-bot/bot/222-only-loop-in-channelmanager.rs-p-e2758f into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5504
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Don't let route hints blame unrelated public channels' (#5503)by Matt Corallo · 4a0f81cd · Nov 5, 2026 · 6 filesMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Don't let route hints blame unrelated public channels' (#5503)

from benthecarman/route-hint-scid-source-check into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5503
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Abandon claims of irrevocably spent HTLC outputs' (#5501)by Matt Corallo · 3407f256 · Nov 5, 2026 · 6 filesMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Abandon claims of irrevocably spent HTLC outputs' (#5501)

from saidalaoui/drop-claims-for-resolved-htlc-outputs into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5501
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
AI review queuedAbandon claims of irrevocably spent HTLC outputsby SaidAlaoui · f7da7601 · Nov 5, 2026 · 6 filesMessage 80 · StrongModerate 57Details
Commit message · SaidAlaoui

Abandon claims of irrevocably spent HTLC outputs

When a `ChannelMonitor` learns a preimage after a commitment
transaction confirms, it builds the claims of all HTLC outputs on that
transaction again. It removes duplicates only against the outpoints
which it still tracks. Once the spend of an HTLC output has
`ANTI_REORG_DELAY` confirmations, the outpoint is no longer tracked,
so the claim is registered again. `ChannelManager::read` replays
stored preimages on every load, so a restart is enough to create such
a claim. The claim can never confirm, but it stays in the monitor and
we yield it again on every rebroadcast.

On every block, `ChannelMonitor` now passes the outputs of the confirmed
commitment transaction which have an irrevocable spend to
`OnchainTxHandler::abandon_spent_outpoints`. A spend is irrevocable when
its HTLC is in `htlcs_resolved_on_chain`, or when its
`HTLCSpendConfirmation` has `ANTI_REORG_DELAY` confirmations. The second
case covers our own HTLC-Success transactions on our commitment
transaction, which wait for the CSV delay before their HTLC is in
`htlcs_resolved_on_chain`. A claim which only spends such outputs is
dropped, along with the `claimable_outpoints` entries of any outpoints
split out of it earlier, which would otherwise make us panic if we saw
their spends again. A claim which also spends other outputs is split,
and its timer is set to the current height, so that we build the claim
of the other outputs again in the same block. This also removes such
claims from monitors which were persisted with them.

This also drops the HTLC-Timeout claims of non-anchor channels for
HTLC outputs which our counterparty claimed with the preimage. Those
packages cannot be split, so they stayed in `locktimed_packages`, and
we broadcast an HTLC-Timeout transaction which could never confirm at
the HTLC expiry. `test_htlc_on_chain_success` and
`retry_with_no_persist` expected those broadcasts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Moderate 57/100

This commit fixes a bug in the Lightning Dev Kit where the wallet could keep trying to claim bitcoin that was already spent by someone else. After a channel closes on-chain, the code normally tries to grab any HTLC outputs it can. A bug caused it to recreate already-impossible claims every time it learned a new payment secret or restarted, because it only avoided duplicate claims for outputs it was still actively tracking. Once an output's spend was buried under enough confirmations, it was dropped from tracking, so the old claim was added again. These impossible claims could never confirm, but they stayed in the monitor forever and were re-broadcast repeatedly. In rare cases they could also trigger a panic if a previously-split claim later saw its output spent again. The fix detects outputs that are already irreversibly spent and tells the on-chain transaction handler to abandon those claims, splitting or dropping them as needed.

Security candidateMerge PR 'Persist LSPS2 deferred funding transaction and broadcast authorization' (#5487)by wpaulino · 49123026 · Nov 5, 2026 · 1 fileMessage 86 · StrongLow 35Details
Commit message · wpaulino

Merge PR 'Persist LSPS2 deferred funding transaction and broadcast authorization' (#5487)

from bot/5381-persist-deferred-funding-transac-5b1ff1 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5487
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
access controlmerge-commit duplicate discount
AI analysis · Low 35/100

This small patch fixes a state-persistence bug in a Lightning service feature (LSPS2). When a funding transaction or broadcast authorization was recorded, the code forgot to mark the peer's state as needing to be saved to disk. That could let the in-memory change disappear after a restart, potentially causing the node to lose track of money-moving transactions or re-broadcast at the wrong time. It is a reliability/consistency fix rather than an obvious remote exploit.

Lower-priorityMerge PR 'Reject empty HTLC locator sets in PaymentForwarded decoding' (#5493)by wpaulino · ca5c6806 · Nov 5, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · wpaulino

Merge PR 'Reject empty HTLC locator sets in PaymentForwarded decoding' (#5493)

from bot/5424-reject-paymentforwarded-records-b9ca73 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5493
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
AI review queuedMerge PR 'Verify UTXO output matches previous transaction in coin selection' (#5490)by wpaulino · f23b996c · Nov 5, 2026 · 1 fileMessage 91 · StrongModerate 59Details
Commit message · wpaulino

Merge PR 'Verify UTXO output matches previous transaction in coin selection' (#5490)

from bot/5422-reject-utxos-that-disagree-with-5358a3 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5490
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

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
Why it was queued
signing or wallet pathmerge-commit duplicate discountsecond-pass: security-sensitive path
AI analysis · Moderate 59/100

This change tightens a safety check when a Lightning wallet picks which Bitcoin coins (UTXOs) to spend. Previously, the code only confirmed that the referenced transaction had an output at the expected position. Now it also confirms that the actual output amount and script exactly match what the wallet claims. This prevents a class of bugs or attacks where a wallet source provides a UTXO whose details do not match the real previous transaction, which could lead to building invalid or unexpected funding/closing transactions.

Security candidateMerge PR 'Use checked addition for anchor reserve UTXO input weight' (#5488)by wpaulino · d9112962 · Nov 5, 2026 · 1 fileMessage 81 · StrongModerate 58Details
Commit message · wpaulino

Merge PR 'Use checked addition for anchor reserve UTXO input weight' (#5488)

from bot/5372-overflowing-utxo-weight-bypasses-4f282a into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5488
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
memory safetymerge-commit duplicate discount
AI analysis · Moderate 58/100

This patch fixes a place where two numbers representing the size of a Bitcoin transaction input were added together using normal addition, which could silently overflow and wrap around to a tiny value in Rust. By switching to checked addition, the code now treats an overflow as a failure case and falls back to a maximum fee, preventing a malformed or extremely large UTXO from causing an underpriced fee estimate. The practical security impact is moderate: it could let an attacker-provided UTXO slip past a reserve check, but the surrounding code has other safeguards and the scenario requires a very large, crafted satisfaction_weight.

Lower-priorityMerge PR 'Use confirmed funding scope for revoked HTLC justice claims' (#5468)by wpaulino · 9eba6d33 · Nov 5, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · wpaulino

Merge PR 'Use confirmed funding scope for revoked HTLC justice claims' (#5468)

from bot/5376-use-confirmed-splice-parameters-6397e8 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5468
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Security candidateMerge PR '`MonitorEvent`s resolve outbound payment claims' (#4545)by wpaulino · ff943dc8 · Nov 5, 2026 · 10 filesMessage 81 · StrongModerate 52Details
Commit message · wpaulino

Merge PR '`MonitorEvent`s resolve outbound payment claims' (#4545)

from valentinewallace/2026-04-mon-resolves-outb-claims into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4545
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
boot or update pathmerge-commit duplicate discount
AI analysis · Moderate 52/100

This commit changes how Lightning Dev Kit handles payment claims when an outbound HTLC is resolved. Previously, off-chain payment claims were tied to a specific message-handling flow (RAA release) and could get out of sync with the channel monitor's durable events. The patch makes monitor events the durable source of truth for resolving outbound payments, adds tracking so the same HTLC can have both an off-chain and an on-chain claim event, and ensures older LDK versions (0.3 and earlier) don't misinterpret off-chain events as on-chain ones. It also fixes edge cases around restarts, upgrades, downgrades, and replayed events. The primary risk is not a remote exploit but a correctness/consensus bug that could, in edge cases, lead to stuck payments, phantom balances, or premature payment completion.

Security candidateLSPS2: Release pruned pending requests from the total limitby auto-pr-bot · 0d95586c · Nov 5, 2026 · 2 filesMessage 83 · StrongHigh 76Details
Commit message · auto-pr-bot

LSPS2: Release pruned pending requests from the total limit

The LSPS2 service counts unanswered `get_info`/`buy` requests in a global
`total_pending_requests` counter and refuses new requests from any peer
once it reaches `MAX_TOTAL_PENDING_REQUESTS`. When a peer disconnected,
its pending requests were dropped from the per-peer map by
`prune_pending_requests` without lowering the counter, so every request
still unanswered at disconnect permanently consumed one of the 1,000
global slots until the process restarted. A peer with throw-away node
keys could thus pin an LSP at the limit and refuse `lsps2.get_info` and
`lsps2.buy` to all clients, and ordinary clients that lost their
connection before being answered drifted the counter upward, too.

Have `prune_pending_requests` return how many entries it removed (the
same shape LSPS1's already has) and subtract that from the counter in
`peer_disconnected`, using the same saturating `fetch_update` and
out-of-sync `debug_assert!` idiom as `remove_pending_request`.
`peer_disconnected` is the only caller of `prune_pending_requests`, and
together with `remove_pending_request` this covers every removal from
`pending_requests`, so the counter stays in sync with the per-peer maps
as `verify_pending_request_counter` asserts.

Reported by Anthropic's OSS Scanner as ANT-2026-S58419MV and
independently by Erick Cestari.

@tnull asked:

> @auto-pr-bot please fix this, including in the commit message that
> this was reported by Anthropic's OSS Scanner, as ANT-2026-S58419MV.
>
> Release requests pruned in peer_disconnected from
> total_pending_requests, keeping the counter in sync with what
> prune_pending_requests removes. Add a regression test that fails
> without the fix.

Requested-by: @tnull
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

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
access controlfuzzing or regression evidence
AI analysis · High 76/100

This commit fixes a denial-of-service bug in the LSPS2 (Lightning Service Provider Specification 2) service code. The service tracks how many unanswered client requests it has globally and stops accepting new ones after 1,000. When a client disconnected before being answered, the per-client request list was cleaned up, but the global counter was not reduced. That meant every such request permanently consumed one of the 1,000 slots until the program restarted. An attacker could repeatedly connect, send a request, and disconnect to exhaust the slot limit, blocking legitimate clients from using the service. The fix makes the cleanup routine report how many requests it removed and subtracts that from the global counter when a peer disconnects. A regression test is included.

Lower-priorityAdd a helper for the confirmed funding spend of a `ChannelMonitor`by SaidAlaoui · 4e2138b3 · Nov 4, 2026 · 1 fileMessage 85 · StrongTriage 0Details
Commit message · SaidAlaoui

Add a helper for the confirmed funding spend of a `ChannelMonitor`

`provide_payment_preimage` looks up the txid of the transaction which
spends the funding output, both before and after it reaches its
confirmation threshold. Move the lookup into `confirmed_funding_spend`
so that the next commit can use it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Lower-priorityStrictly limit in-flight gossip validations to 32by auto-pr-bot · d95d6647 · Nov 2, 2026 · 2 filesMessage 88 · StrongTriage 0Details
Commit message · auto-pr-bot

Strictly limit in-flight gossip validations to 32

When the routing message handler's processing queue is high we so far
relied on pausing reads to limit the number of in-flight gossip
validations, but messages which have already been read are still
processed, leaving us handling up to a socket buffer worth of gossip
messages per peer beyond the limit. Thus the number of in-flight gossip
validations was not strictly bounded.

@matt asked:

> Now that we've merged
> https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5241
> we should more tightly limit the number of in-flight gossip validations
> in the same infrastructure - @auto-pr-bot when we're processing messages
> from a peer and the next message is a gossip message and we have
> `processing_queue_high` on the routing message handler, dont process the
> message and use the `stashed_read_data` logic. This should strictly
> limit our in-flight gossip validations to 32. To avoid allowing 1000
> malicious peers to starve an honest peer that mostly exchanges channel
> messages with us but occasionally sends us gossip we'll have to keep a
> `VecDeque` queue of gossip-blocked peers and make sure we process them
> in order.

Instead of processing a gossip message when the queue is high, we stash
the plaintext bytes of the message on the peer, stash any raw bytes which
followed it on the wire in the peer's `stashed_read_data`, and queue the
peer in a FIFO `VecDeque`. `process_events` handles stashed messages in
the order peers became blocked, and only once the processing queue has
drained, so one peer cannot starve others of gossip processing and no
gossip is lost. When a blocked peer's stash is handled, the stashed
message is re-decoded and dispatched by the same read loop as regular
messages, followed by any bytes which had been read before it became
blocked; anything it sends while blocked is not read until then, as its
reads stay paused while a message is stashed.

We cannot stash the ciphertext, as the decryption key stream has already
been rolled past it, and stashing the decoded message rather than its
plaintext bytes would make `PeerManager`'s automatically derived
`Send`/`Sync` require `CustomMessageReader::CustomMessage: Send`, a
public API change which would also complicate backporting.

@matt asked:

> Argh, no, the review bot is right - we should go back to the byte
> storage so that we don't change the public API and this can be
> trivially backported.

Because no messages are handled from a gossip-blocked peer, including
the reply to any ping we send it, it would otherwise be disconnected by
`timer_tick_occurred`'s liveness check a tick or two after being
blocked. Instead we pause liveness checking while a peer is
gossip-blocked, as its silence is our own backpressure rather than a
dead connection.

Note that raw bytes for the peer may be delivered by another thread
while its stash is being processed, so the stash points merge any
concurrently stashed bytes into the remaining read data, preserving
stream order.

Requested-by: @matt
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

88/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
Lower-priorityUse confirmed funding scope for revoked HTLC justice claimsby auto-pr-bot · 39d7a4d4 · Nov 2, 2026 · 1 fileMessage 91 · StrongTriage 8Details
Commit message · auto-pr-bot

Use confirmed funding scope for revoked HTLC justice claims

check_spend_counterparty_htlc already selects the confirmed funding
scope to look up claimable outpoints, but built each RevokedOutput with
self.funding's channel parameters. While a splice is confirmed but not
yet promoted, those are the ancestor funding parameters, not the
parameters of the commitment and second-stage HTLC being punished, so
the resulting claim package supplied the signer with the wrong funding
outpoint, value, and splice key context. Signers that validate the
exact ChannelTransactionParameters were allowed to reject the claim,
leaving the output to the counterparty after the contest delay.

@wpaulino asked:

> @auto-pr-bot open a PR fixing this issue, but don't bother with a
> test since we don't yet support updating the channel type via a
> splice.

No test is added per that request; the confirmed-splice state the fix
targets cannot be reached through the public API today.

Fixes #5376

Requested-by: @wpaulino
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5376#issuecomment-462766
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>

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
Why it was queued
defensive validation
Lower-priorityMerge PR 'Fix flaky hold-time check in trampoline single-hop receive test' (#5459)by Val Wallace · 1ef8b853 · Oct 30, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · Val Wallace

Merge PR 'Fix flaky hold-time check in trampoline single-hop receive test' (#5459)

from claude/rust-lightning-5344-7eb688 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5459
Reviewed-by: Val Wallace <val@noreply.git.rust-bitcoin.org>

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
Why it was queued
merge-commit duplicate discount
Lower-priorityFix flaky hold-time check in trampoline single-hop receive testby Jeffrey Czyz · 7ec3b073 · Oct 30, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · Jeffrey Czyz

Fix flaky hold-time check in trampoline single-hop receive test

The test asserted that both hops reported a zero hold time. The
intermediate hop's hold time is derived from the wall clock, so on a
slow CI machine the fulfill arrives more than 100ms after forwarding
and the hop reports a non-zero value, failing the test.

The purpose of the check is to confirm that fulfill attribution data
decodes for every hop of a trampoline payment. Assert the number of
decoded hold times and that the final node's is zero instead, since
only the final node always reports zero.

Fixes #5344

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

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-priorityMerge PR 'Document Forgejo access for agents' (#5434)by Matt Corallo · bb2fbd1e · Oct 30, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · Matt Corallo

Merge PR 'Document Forgejo access for agents' (#5434)

from 2026-10-agent-forgejo-access into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5434
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
documentation-only discountmerge-commit duplicate discount
Lower-priorityMerge PR 'Serialize byte arrays directly' (#5317)by tankyleo · 62fbfcd2 · Oct 30, 2026 · 1 fileMessage 76 · AdequateTriage 0Details
Commit message · tankyleo

Merge PR 'Serialize byte arrays directly' (#5317)

from 2026-10-ser-byte-arrays into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5317
Reviewed-by: benthecarman <benthecarman@noreply.git.rust-bitcoin.org>

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Stop at first rejecting sub-handler in composite peer_connected' (#5442)by tnull · 023c460e · Oct 29, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · tnull

Merge PR 'Stop at first rejecting sub-handler in composite peer_connected' (#5442)

from bot/5354-stop-at-the-first-rejecting-sub-0c59ee into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5442
Reviewed-by: tnull <tnull@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Persist emptied LSPS5 peer state before removing its key' (#5437)by tnull · 86890b68 · Oct 29, 2026 · 2 filesMessage 81 · StrongTriage 0Details
Commit message · tnull

Merge PR 'Persist emptied LSPS5 peer state before removing its key' (#5437)

from bot/5348-lsps5-persist-emptied-peer-state-7046cc into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5437
Reviewed-by: tnull <tnull@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'Prune expired LSPS1 orders in builds without the `time` feature' (#5443)by tnull · a0bb5254 · Oct 29, 2026 · 3 filesMessage 81 · StrongTriage 0Details
Commit message · tnull

Merge PR 'Prune expired LSPS1 orders in builds without the `time` feature' (#5443)

from bot/5357-lsps1-prune-expired-orders-in-bu-420068 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5443
Reviewed-by: tnull <tnull@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-priorityMerge PR 'lightning-liquidity: bind LSPS responses to the requesting peer' (#5448)by tnull · 1ce2658e · Oct 29, 2026 · 5 filesMessage 81 · StrongTriage 0Details
Commit message · tnull

Merge PR 'lightning-liquidity: bind LSPS responses to the requesting peer' (#5448)

from bot/5359-lightning-liquidity-bind-lsps-re-12c3e5 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5448
Reviewed-by: tnull <tnull@noreply.git.rust-bitcoin.org>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount