LDK
← All projectsLightning Dev Kit

rust-lightning

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

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

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

305security candidates264second-pass queue1614AI analyses
175commits · 30 days
273commits · 60 days
653commits · 180 days
1332commits · 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
726Strong · 80–100
857Adequate · 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 Corallo60181423876
Elias Rohrer15415153667
auto-pr-bot622025487
Jeffrey Czyz19645182169
Wilmer Paulino15945155169
Valentine Wallace15715145169
Leo Nash11613116162
Vincenzo Palazzo11311183
Joost Jager16324162069
elnosh401434059
shaavan22622069
wpaulino2059082
Analysis record

Published AI watches

Last scanned 39 minutes ago

Low 48 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix 32-bit spin in Vec<u8> deserialization on huge lengths' (#5102)

This commit fixes a bug in how rust-lightning reads variable-length byte blobs on 32-bit systems. A malicious message could claim a huge byte count; on 32-bit builds the old code would try to allocate an oversized buffer in tiny increments…

Integer truncation / cast-down bug in deserializationPotential memory exhaustion / denial-of-service on 32-bit targetsFix caps read chunk size before usize conversion
227b5256by Matt Corallo+1−11 file
No security note in commit
Moderate 62 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Refuse to sign messages that alias channel_announcement serializations' (#5727)

This change tightens a security guardrail in LDK's message-signing helper. Previously, the code refused to sign arbitrary text if the prefixed text happened to look like a 'node_announcement' gossip message, because an attacker could repla…

signature-replay hardeninggossip-message aliasing preventiondefensive signing policy expansion
6bc00947by Matt Corallo+69−143 files
Vendor flagged security relevance
High 76 AI analysisMessage 100 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Refuse to sign messages that alias channel_announcement serializations

This commit fixes a security gap in how the Lightning Dev Kit signs arbitrary messages. Previously, the code refused to sign messages that could be mistaken for a 'node_announcement' gossip message, because such a signature could be replay…

Signature replay / cross-protocol forgery preventionExpansion of existing anti-aliasing guard to additional gossip message typesCommit message explicitly describes forged gossip signature risk
66c2acecby auto-pr-bot+69−143 files
Vendor flagged security relevance
Low 29 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Make Path and Route fields private' (#5068)

This commit makes the internal fields of two data structures, Path and Route, private and adds controlled constructors and read-only accessors. It also adds validation so that empty paths or routes are rejected. The change is primarily a d…

Encapsulation of previously public struct fieldsAddition of input validation in constructors (non-empty hops/paths)Deserialization now rejects invalid empty paths/routes
8f8f95a2by Matt Corallo+83−205 files
No security note in commit
Low 35 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Populate non-witness UTXOs in bump PSBTs' (#5471)

This change fixes how transaction fee-bumping PSBTs (Partially Signed Bitcoin Transactions) are built in LDK. Previously, when a non-witness UTXO (a non-SegWit coin) was used as an input, the PSBT only had a witness UTXO field populated fo…

PSBT input metadata correctness fixNon-witness UTXO now populated for legacy inputs in fee-bump transactionsAffects CPFP anchor and HTLC transaction signing paths
f1688ce6by Matt Corallo+4−21 file
No security note in commit
Moderate 66 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Track refused monitor updates as pending until persisted' (#5663)

This commit fixes a bug in the Lightning Dev Kit's handling of channel monitor updates that are refused because the channel's funding transaction was already spent on-chain. Previously, such refused updates were persisted as a full monitor…

Durability ordering bug: later MonitorEvent::Completed could imply earlier refused update was persistedRefused monitor update may carry forwarded HTLC preimage, creating risk of inconsistent state across restartAsynchronous persistence tracking gap for refused updates
ea277539by Matt Corallo+56−354 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Expand coverage of splices confirmed before tx_signatures complete' (#5691)

This commit only adds and modifies test code in rust-lightning. It expands test coverage for a specific edge case in Lightning channel splicing: when a splice transaction gets confirmed before both peers have finished exchanging signatures…

11a8e901by Val Wallace+102−411 file
No security note in commit
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
Repository ledger

Explore captured commits

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

Lower-priorityMove reasonable-default arguments out of `pay_for_offer`.by Matt Corallo · f65e78da · Sep 16, 2025 · 5 filesMessage 73 · AdequateInformational 18Details
Commit message · Matt Corallo

Move reasonable-default arguments out of `pay_for_offer`.

`ChannelManager::pay_for_offer` and
`ChannelManager::pay_for_offer_from_human_readable_name` have
accumulated a handful of arguments, most of which we expect users
to never actually set.

Instead, here, we move `quantity` and `payer_note` (which we expect
users to never set) as well as `route_params_config` and
`retry_strategy` (which we expect users to generally stick with the
defaults on) into a new struct, which implements `Default`.

This cleans up a good bit of cruft on payment calls.

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

This commit is a routine API cleanup, not a security fix. It groups several rarely-used arguments of the `pay_for_offer` and `pay_for_offer_from_human_readable_name` functions into a new `OptionalOfferPaymentParams` struct with sensible defaults. Existing callers are updated to use the new, simpler call pattern. There is no change to payment logic, validation, or security behavior.

Lower-prioritySomewhat DRY `pay_for_offer_intern` callback methodby Matt Corallo · dbf40d3f · Sep 16, 2025 · 1 fileMessage 50 · ThinInformational 14Details
Commit message · Matt Corallo

Somewhat DRY `pay_for_offer_intern` callback method

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 14/100

This commit is a small internal cleanup in the code that handles BOLT 12 offer payments. It removes repeated boilerplate by moving the construction of a RetryableInvoiceRequest object into one shared helper, instead of building it separately in each caller. The actual values being passed (invoice request, nonce, retry flag, and expiration timer) remain the same, so there is no functional or security change.

Lower-priorityDrop spurious limitations section on `pay_for_offer`by Matt Corallo · dd122519 · Sep 16, 2025 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Matt Corallo

Drop spurious limitations section on `pay_for_offer`

For some time we've automatically opened a connection to the
blinded path introduction point when we need to send a message we
generated. However, the "Limitations" section in
`ChannelManager::pay_for_offer` lists having a direct connection
as required for the payment to succeed, which is not true.

Instead, we simply remove the section from both `pay_for_offer` and
`pay_for_offer_from_human_readable_name`.

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

This commit only removes outdated documentation comments from two functions. The deleted text incorrectly stated that users needed a direct network connection to specific nodes for certain Lightning payments to work. The code already automatically opens those connections, so the documentation was wrong and misleading, but no actual behavior changed. There is no security issue in the code change itself.

Lower-priorityMention the `bitcoin-payment-instructions` crate in docsby Matt Corallo · 0c13a663 · Sep 16, 2025 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Matt Corallo

Mention the `bitcoin-payment-instructions` crate in docs

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only updates documentation comments in a single source file. It adds a reference to an external Rust crate called `bitcoin-payment-instructions` and slightly reorders existing documentation links. No code behavior changes, no security fixes, and no functional modifications are present.

AI review queuedMiscellanous CI fixesby Leo Nash · 2ce8e647 · Sep 16, 2025 · 6 filesMessage 28 · OpaqueInformational 15Details
Commit message · Leo Nash

Miscellanous CI fixes

28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit is a collection of minor cleanups to fix automated documentation and code-quality checks. It removes unnecessary parentheses, fixes broken doc links, corrects a URL in a comment, and adds missing doc links. None of the changes alter program behavior or fix any security issue.

Lower-priorityAdd basic end-to-end splice testsby Wilmer Paulino · 307fa561 · Sep 16, 2025 · 3 filesMessage 78 · AdequateInformational 15Details
Commit message · Wilmer Paulino

Add basic end-to-end splice tests

This adds a new test for both splice-in and splice-out in favor of
maintaining the existing test. Helpers have been added to DRY up a lot
of the logic necessary for driving the splice state machine forward.

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

This commit is a routine development patch that adds and improves automated tests for a new Bitcoin Lightning channel feature called 'splicing'—a way to add or remove funds from an existing channel. It removes a temporary placeholder that deliberately aborted splicing during testing, because the tests now need the feature to run further. There is no indication this fixes a security bug or introduces a vulnerability.

Lower-prioritySet current block locktime for coinbase in provide_anchor_reservesby Wilmer Paulino · 8ab08840 · Sep 16, 2025 · 1 fileMessage 73 · AdequateInformational 16Details
Commit message · Wilmer Paulino

Set current block locktime for coinbase in provide_anchor_reserves

This guarantees we get a unique txid when calling
`provide_anchor_reserves` successively as we're immediately mining (and
therefore advancing the chain) the transaction after creating it.

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

This is a one-line change inside a test helper function. It sets the transaction locktime to the current block height instead of zero when creating a dummy coinbase transaction used only in tests. The goal is to avoid duplicate transaction IDs when the test framework rapidly mines blocks. It does not affect production Lightning node code or real funds.

Lower-prioritySwitch TestWalletSource to use P2WPKH scriptby Wilmer Paulino · 749ebb8e · Sep 16, 2025 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Wilmer Paulino

Switch TestWalletSource to use P2WPKH script

We plan to reuse it for dual-funding/splicing, and those require
standard SegWit inputs only.

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

This commit changes a test-only helper in the Lightning Dev Kit codebase so that its fake wallet produces a more modern type of Bitcoin address (SegWit/P2WPKH) instead of the older P2PKH format. The change only affects internal test utilities and does not alter production code, network behavior, or cryptographic security. There is no indication this fixes or introduces a vulnerability.

Lower-priorityImplement `KVStore` for `TestStore`by Elias Rohrer · 012bb7a0 · Sep 16, 2025 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Elias Rohrer

Implement `KVStore` for `TestStore`

We implement the async `KVStore` trait for `TestStore`. This is mostly
useful in LDK Node tests, where we use `TestStore` and we now require
all stores to implement both variants.

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

This commit adds an asynchronous version of a key-value store interface to a test-only helper called TestStore. It does not change production code, user-facing behavior, or any security-sensitive logic. It is purely a testing infrastructure change to satisfy a new trait requirement.

Lower-priorityMove `TestStore` logic to `_internal` methodsby Elias Rohrer · 828e10d7 · Sep 16, 2025 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Elias Rohrer

Move `TestStore` logic to `_internal` methods

.. to be easier reusable by different trait implementations.

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

This commit is a simple internal code cleanup in the project's test utilities. It takes the existing logic of a test-only key-value store and splits it into private helper methods, then has the public trait methods call those helpers. There is no change to behavior, no fix for a bug, and no security relevance.

Lower-priorityRemove redundant `startup_replay` arg to `claim_funds_internal`by Matt Corallo · 77026c9d · Sep 16, 2025 · 1 fileMessage 73 · AdequateInformational 12Details
Commit message · Matt Corallo

Remove redundant `startup_replay` arg to `claim_funds_internal`

`startup_replay` should always exactly mirror
`background_events_processed_since_startup`, so we should just use
that rather than having a dedicated argument for it.

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

This is a small internal code cleanup in the Lightning Dev Kit's channel manager. It removes a redundant function argument and replaces it with a direct read of an existing flag. The change does not alter behavior and is not a security fix.

Lower-priorityProperly provide `PaymentPathSuccessful` event for replay claimsby Matt Corallo · ba6528f0 · Sep 16, 2025 · 3 filesMessage 73 · AdequateInformational 21Details
Commit message · Matt Corallo

Properly provide `PaymentPathSuccessful` event for replay claims

When a payment was sent and ultimately completed through an
on-chain HTLC claim which we discover during startup, we
deliberately break the payment tracking logic to keep it around
forever, declining to send a `PaymentPathSuccessful` event but
ensuring that we don't constantly replay the claim on every
startup.

However, now that we now have logic to complete a claim by marking
it as completed in a `ChannelMonitor` and not replaying information
about the claim on every startup. Thus, we no longer need to take
the conservative stance and can correctly replay claims now,
generating `PaymentPathSuccessful` events and allowing the state to
be removed.

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

This change fixes a bookkeeping quirk in the Lightning Dev Kit. Previously, when a payment was completed via an on-chain claim discovered during startup, the software deliberately kept the payment record around forever and skipped sending a 'this payment path succeeded' event, to avoid repeatedly replaying the claim every time the node restarted. Now that the software can mark such claims as completed inside the channel monitor, it can safely send the missing success event and clean up the old payment state. This is a correctness and cleanup improvement, not a vulnerability that an attacker can exploit.

Lower-priorityStop re-hydrating pending payments once they are fully resolvedby Matt Corallo · 226520b2 · Sep 16, 2025 · 4 filesMessage 85 · StrongModerate 57Details
Commit message · Matt Corallo

Stop re-hydrating pending payments once they are fully resolved

`MonitorEvent`s aren't delivered to the `ChannelManager` in a
durable fasion - if the `ChannelManager` fetches the pending
`MonitorEvent`s, then the `ChannelMonitor` gets persisted (i.e. due
to a block update) then the node crashes, prior to persisting the
`ChannelManager` again, the `MonitorEvent` and its effects on the
`ChannelManger` will be lost. This isn't likely in a sync persist
environment, but in an async one this could be an issue.

Note that this is only an issue for closed channels -
`MonitorEvent`s only inform the `ChannelManager` that a channel is
closed (which the `ChannelManager` will learn on startup or when it
next tries to advance the channel state), that
`ChannelMonitorUpdate` writes completed (which the `ChannelManager`
will detect on startup), or that HTLCs resolved on-chain post
closure. Of the three, only the last is problematic to lose prior
to a reload.

In previous commits we ensured that HTLC resolutions which came to
`ChannelManager` via a `MonitorEvent` were replayed on startup if
the `MonitorEvent` was lost. However, in cases where the
`ChannelManager` was so stale that it didn't have the payment state
for an HTLC at all, we only re-add it in cases where
`ChannelMonitor::get_pending_or_resolved_outbound_htlcs` includes
it.

Because constantly re-adding a payment state and then failing it
would generate lots of noise for users on startup (not to mention
risk of confusing stale payment events for the latest state of a
payment when the `PaymentId` has been reused to retry a payment).
Thus, `get_pending_or_resolved_outbound_htlcs` does not include
state for HTLCs which were resolved on chain with a preimage or
HTLCs which were resolved on chain with a timeout after
`ANTI_REORG_DELAY` confirmations.

This critera matches the critera for generating a `MonitorEvent`,
and works great under the assumption that `MonitorEvent`s are
reliably delivered. However, if they are not, and our
`ChannelManager` is lost or substantially old (or, in a future
where we do not persist `ChannelManager` at all), we will not end
up seeing payment resolution events for an HTLC.

Instead, we really want to tell our `ChannelMonitor`s when the
resolution of an HTLC is complete. Note that we don't particularly
care about non-payment HTLCs, as there is no re-hydration of state
to do there - `ChannelManager` load ignores forwarded HTLCs coming
back from `get_pending_or_resolved_outbound_htlcs` as there's
nothing to do - we always attempt to replay the success/failure and
figure out if it mattered based on whether there was still an HTLC
to claim/fail.

Here we, finally, begin actually using the new
`ChannelMonitorUpdateStep::ReleasePaymentComplete` updates,
skipping re-hydration of pending payments once they have been fully
resolved through to a user `Event`.

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

This commit fixes a reliability issue in the Lightning Dev Kit's handling of payment events after a channel closes. In rare crash scenarios, the wallet could lose track of whether an on-chain payment had already been reported to the user, causing it to either replay old payment notifications or fail to report a resolution. The fix marks HTLCs as fully resolved in the ChannelMonitor so they are not re-processed on restart, reducing duplicate or missing payment events.

Security candidateGenerate new `ReleasePaymentComplete` monitor updatesby Matt Corallo · 71a364c1 · Sep 16, 2025 · 9 filesMessage 95 · StrongModerate 53Details
Commit message · Matt Corallo

Generate new `ReleasePaymentComplete` monitor updates

`MonitorEvent`s aren't delivered to the `ChannelManager` in a
durable fasion - if the `ChannelManager` fetches the pending
`MonitorEvent`s, then the `ChannelMonitor` gets persisted (i.e. due
to a block update) then the node crashes, prior to persisting the
`ChannelManager` again, the `MonitorEvent` and its effects on the
`ChannelManger` will be lost. This isn't likely in a sync persist
environment, but in an async one this could be an issue.

Note that this is only an issue for closed channels -
`MonitorEvent`s only inform the `ChannelManager` that a channel is
closed (which the `ChannelManager` will learn on startup or when it
next tries to advance the channel state), that
`ChannelMonitorUpdate` writes completed (which the `ChannelManager`
will detect on startup), or that HTLCs resolved on-chain post
closure. Of the three, only the last is problematic to lose prior
to a reload.

In previous commits we ensured that HTLC resolutions which came to
`ChannelManager` via a `MonitorEvent` were replayed on startup if
the `MonitorEvent` was lost. However, in cases where the
`ChannelManager` was so stale that it didn't have the payment state
for an HTLC at all, we only re-add it in cases where
`ChannelMonitor::get_pending_or_resolved_outbound_htlcs` includes
it.

Because constantly re-adding a payment state and then failing it
would generate lots of noise for users on startup (not to mention
risk of confusing stale payment events for the latest state of a
payment when the `PaymentId` has been reused to retry a payment).
Thus, `get_pending_or_resolved_outbound_htlcs` does not include
state for HTLCs which were resolved on chain with a preimage or
HTLCs which were resolved on chain with a timeout after
`ANTI_REORG_DELAY` confirmations.

This critera matches the critera for generating a `MonitorEvent`,
and works great under the assumption that `MonitorEvent`s are
reliably delivered. However, if they are not, and our
`ChannelManager` is lost or substantially old (or, in a future
where we do not persist `ChannelManager` at all), we will not end
up seeing payment resolution events for an HTLC.

Instead, we really want to tell our `ChannelMonitor`s when the
resolution of an HTLC is complete. Note that we don't particularly
care about non-payment HTLCs, as there is no re-hydration of state
to do there - `ChannelManager` load ignores forwarded HTLCs coming
back from `get_pending_or_resolved_outbound_htlcs` as there's
nothing to do - we always attempt to replay the success/failure and
figure out if it mattered based on whether there was still an HTLC
to claim/fail.

Here we begin generating the new
`ChannelMonitorUpdateStep::ReleasePaymentComplete` updates,
updating functional tests for the new `ChannelMonitorUpdate`s where
required.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
boot or update path
AI analysis · Moderate 53/100

This commit fixes a reliability bug in the Lightning Dev Kit (LDK) where payment success or failure events could be lost if the node crashes at the wrong moment. The fix adds a new 'ReleasePaymentComplete' monitor update so that once a payment is fully resolved, the ChannelMonitor records it durably. This prevents users from seeing stale or repeated payment events after a restart, especially in setups where persistence happens asynchronously. It is a defensive correctness fix, not an externally exploitable vulnerability.

Lower-priorityAddress ChannelState inconsistency throughout splicingby Wilmer Paulino · 7597140c · Sep 15, 2025 · 1 fileMessage 73 · AdequateLow 42Details
Commit message · Wilmer Paulino

Address ChannelState inconsistency throughout splicing

Once a channel open has become locked (i.e., we've entered
`ChannelState::ChannelReady`), the channel is intended to remain within
this state for the rest of its lifetime until shutdown. Previously, we
had assumed a channel being spliced would go through the `ChannelState`
lifecycle again starting from `NegotiatingFunding` but skipping
`AwaitingChannelReady`. This inconsistency departs from what we strive
to achieve with `ChannelState` and also makes the state of a channel
harder to reason about.

This commit ensures a channel undergoing a splice remains in
`ChannelReady`, clearing the quiescent flag once the negotiation is
complete. Dual funding is unaffected by this change as the channel is
being opened and we want to maintain the same `ChannelState` lifecycle.

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

This commit fixes a state-machine inconsistency in how the Lightning node tracks the lifecycle of a channel when it is being spliced. Previously, a splice incorrectly moved the channel back through the same states used when a channel is first being opened. The change keeps the channel in its normal operating state during a splice and only clears a temporary 'quiet' flag once negotiation is done. This makes the code easier to reason about and prevents potential bugs where the channel could be treated as not-yet-open when it is actually already active.

Security candidateRemove tx_signatures flags for interactive signing ChannelStateby Wilmer Paulino · 67aef544 · Sep 15, 2025 · 2 filesMessage 73 · AdequateLow 27Details
Commit message · Wilmer Paulino

Remove tx_signatures flags for interactive signing ChannelState

This commit addresses an overlap of state between
`InteractiveTxSigningSession` and `ChannelState::FundingNegotiated`. The
signing session already tracks whether both holder and counterparty
`tx_signatures` have been produced, so tracking the state duplicatively
at the `ChannelState` level is unnecessary.

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

This commit is a code cleanup in a Bitcoin Lightning network library. It removes duplicate state-tracking flags from the channel state and instead relies on an existing 'interactive signing session' object to track the same information. The change simplifies the code and reduces the chance of inconsistent state, but it does not appear to fix an active security bug on its own. Some behavior changes in error handling are visible, but they look like incidental adjustments rather than a disclosed vulnerability fix.

Security candidateMove interactive signing session into ChannelContextby Wilmer Paulino · 470dd2c0 · Sep 15, 2025 · 2 filesMessage 73 · AdequateInformational 12Details
Commit message · Wilmer Paulino

Move interactive signing session into ChannelContext

Since the `InteractiveTxSigningSession` already tracks everything we
need, we can remove the duplicate interactive signing state tracking
within `ChannelState`.

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

This commit is a straightforward internal code cleanup in the Lightning Dev Kit. It moves the interactive transaction signing session from several channel-specific structs into a single shared ChannelContext struct, removing duplicate state tracking. There is no indication this fixes a security bug or changes security-relevant behavior.

Lower-priorityRemove incomplete dual funding testsby Wilmer Paulino · 1644a782 · Sep 15, 2025 · 2 filesMessage 78 · AdequateInformational 15Details
Commit message · Wilmer Paulino

Remove incomplete dual funding tests

The tests have become a bit painful to maintain, and they don't even
fully test the production code paths, so we opt to just remove them for
now. In the future, we plan to unify the dual funding code paths with
splicing.

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

This commit simply deletes a set of incomplete automated tests for an experimental dual-funded Lightning channel feature, plus one small test-only helper function that only those tests used. No production code is changed, so it cannot introduce or fix a security vulnerability in running software.

Lower-priorityDrop `Readable`/`Writeable` for `InFlightHtlcs`by Matt Corallo · a5d07675 · Sep 15, 2025 · 1 fileMessage 80 · StrongLow 32Details
Commit message · Matt Corallo

Drop `Readable`/`Writeable` for `InFlightHtlcs`

Its not clear why this needs to be serialized at all (it should
generally always be generated live when needed), but its
serialization isn't forward-compatible, so really needs to be
dropped so that we can add additional field(s) to `InFlightHtlcs`.

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

This commit removes the ability to save and load a small routing helper object called InFlightHtlcs to disk. The developer says this object should normally be built fresh while the program is running, and its old save/load format is not forward-compatible, meaning future additions could break old stored data. Removing it prevents that compatibility problem. There is no direct evidence in the commit of an active security vulnerability, but non-forward-compatible serialization in a Lightning payment router can, in principle, lead to crashes or inconsistent routing state if old data is loaded after an upgrade.

Lower-priorityMake `InFlightHtlcs` a named-field struct instead of a tuple structby Matt Corallo · 66e59f95 · Sep 15, 2025 · 1 fileMessage 85 · StrongInformational 15Details
Commit message · Matt Corallo

Make `InFlightHtlcs` a named-field struct instead of a tuple struct

In the next commit we'll track blinded path in-flights in
`InFlightHtlcs` as well as unblinded hops, so here we convert
`InFlightHtlcs` to a named-field struct so that we can add more
fields to it with less confusion.

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

This commit is a straightforward internal code cleanup. It renames an anonymous tuple-style struct to a named-field struct so that future fields can be added more easily. There is no change to behavior, no bug fix, and no security-relevant change.

Security candidatetest(invoice): add new BOLT11 test vector to test public-key recovery high-S signatureby Erick Cestari · c678a9a2 · Sep 15, 2025 · 1 fileMessage 77 · AdequateInformational 12Details
Commit message · Erick Cestari

test(invoice): add new BOLT11 test vector to test public-key recovery high-S signature

77/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Mentions testing or verification✓ Names security-relevant behavior explicitly! No meaningful explanatory body
Why it was queued
signing boundaryfuzzing or regression evidence
AI analysis · Informational 12/100

This commit only adds a new test case to the rust-lightning invoice test suite. It exercises how the library handles a BOLT11 invoice containing a high-S signature during public-key recovery. There is no code change to the actual invoice parsing or signature logic, so by itself this commit does not fix or introduce a security issue. It is a test-only addition.

Security candidaterefactor(invoice): align signature checks with BOLT11 semanticsby Erick Cestari · f63aebb2 · Sep 15, 2025 · 2 filesMessage 100 · StrongLow 35Details
Commit message · Erick Cestari

refactor(invoice): align signature checks with BOLT11 semantics

Simplify `check_signature` logic to follow the BOLT11 rules discussed:

- If an `n` field is present, verify the signature against the included
pubkey using `secp256k1_ecdsa_verify`, which enforces normalized
low-S form.

- If no `n` field is present, rely on `secp256k1_ecdsa_recover` to
extract the pubkey. Recovery accepts both high-S and low-S signatures,
matching existing implementations (lnd, c-lightning).

This avoids redundant recovery+verify checks while preserving
interoperability.

100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Low 35/100

This commit changes how Bitcoin Lightning invoices (BOLT11) are validated. Previously, the code always tried to recover the signer's public key from the signature and also verified it, which could reject some signatures that other Lightning implementations accept. Now, if the invoice explicitly includes a public key, it only verifies the signature against that key (and requires a strict low-S signature). If no public key is included, it recovers the public key from the signature, accepting both high-S and low-S signatures like lnd and c-lightning. This is described as an interoperability fix, not a security vulnerability, but it slightly weakens signature strictness in the no-pubkey case.

Lower-priorityDelay HTLC txs in 0FC channels until both commit and anchor txs confirmby Leo Nash · cae633d9 · Sep 15, 2025 · 1 fileMessage 73 · AdequateLow 46Details
Commit message · Leo Nash

Delay HTLC txs in 0FC channels until both commit and anchor txs confirm

It is possible to claim HTLCs and the P2A anchor in the same
transaction, but we leave aggregating these claims to a follow-up.

For now, we imitate the behavior of CSV anchor channels, and wait for
the commitment transaction to confirm before broadcasting HTLC
transactions.

Co-authored-by: Matt Corallo <git@bluematt.me>

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

This change adjusts how Lightning Dev Kit handles zero-fee commitment (0FC) channels. Previously, the code only delayed broadcasting HTLC (payment) claim transactions for older CSV anchor channels until the commitment transaction confirmed. Now it does the same for newer 0FC channels. The commit notes that, in theory, HTLC claims could be bundled together with the anchor-spend transaction before the commitment confirms, but that optimization is left for future work. The practical effect is a more conservative on-chain behavior that avoids potential race conditions or invalid transactions.

Lower-priorityDo not produce 0FC HTLC txs on `unsafe_get_latest_holder_commitment_txn`by Leo Nash · 1671d758 · Sep 15, 2025 · 1 fileMessage 73 · AdequateLow 45Details
Commit message · Leo Nash

Do not produce 0FC HTLC txs on `unsafe_get_latest_holder_commitment_txn`

As in CSV anchor channels, HTLC transactions in 0FC channels require
external funding before they can be finalized, so we choose to return
the commitment transaction alone here.

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

This change fixes a behavior in the Lightning Dev Kit where, for a newer type of channel (0FC, or zero-fee commitments), the function that retrieves the latest holder commitment transactions was incorrectly returning unfunded HTLC transactions alongside the commitment transaction. These HTLC transactions cannot be used as-is because they need external funding and, in some cases, cannot be broadcast until anchor claims confirm. Returning them could mislead wallet software or automated scripts into trying to broadcast invalid or premature transactions, potentially causing operational errors or failed fund recovery during a channel dispute.

AI review queuedUpdate handling of `BumpTransactionEvent::ChannelClose` for 0FC channelsby Leo Nash · 953e939b · Sep 15, 2025 · 2 filesMessage 85 · StrongLow 42Details
Commit message · Leo Nash

Update handling of `BumpTransactionEvent::ChannelClose` for 0FC channels

Set an empty witness to spend the P2A anchor, and set the version of the
anchor transaction to 3.

We still check whether the commitment transaction has enough fees to be
broadcast on its own, as these transactions may be non-zero fee due to
trimmed / rounded outputs.

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 analysis · Low 42/100

This commit updates how Lightning Dev Kit handles fee-bumping anchor transactions for a newer type of channel (zero-fee commitment channels, or 0FC). It makes two key changes: it uses a much smaller empty witness for the new-style P2A anchor output, and it sets the anchor transaction version to 3 instead of 2. These are protocol-specific adjustments needed so the new channel type can close and fee-bump correctly. The commit does not describe itself as a security fix, and the changes appear to be compatibility/correctness updates rather than a patch for an active vulnerability.