LDK
← All projectsLightning Dev Kit

rust-lightning

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

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

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

225security candidates209second-pass queue1479AI analyses
64commits · 30 days
198commits · 60 days
661commits · 180 days
1474commits · 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.

69/100 average clarity
359Strong · 80–100
790Adequate · 60–79
288Thin · 40–59
60Opaque · 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.
Elias Rohrer15315153667
Matt Corallo35847356473
Jeffrey Czyz17741177168
Wilmer Paulino14939149169
Leo Nash11613116162
Valentine Wallace13710135169
Vincenzo Palazzo10210184
Joost Jager16224162069
elnosh301330056
shaavan22622069
Carla Kirk-Cohen78366068
benthecarman18318071
Analysis record

Published AI watches

Last scanned 54 minutes ago

Low 32 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Only fetch TXIDs instead of entire block during gossip verification' (#4846)

This commit changes how the Lightning Dev Kit's block-sync module verifies Lightning network gossip announcements. Instead of downloading entire Bitcoin blocks (which can be large), it now downloads only the list of transaction IDs for a b…

API surface change in UtxoSource traitReduced data exposure: no longer fetches full blocks for gossip verificationNew JSON parsing for txid lists and TxOut values
ebe7a447by Matt Corallo+275−1025 files
No security note in commit
Low 35 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Allow filtered block rescans at the current tip' (#4847)

This commit changes how the Lightning Dev Kit (LDK) node software handles receiving the same block twice through its filtered-block interface. Previously, calling filtered_block_connected with the current tip again would trigger an asserti…

Assertion relaxation in block connection pathPotential denial-of-service vector removed: previously a malicious or buggy filter provider could crash the node by replaying the current tipNew test coverage for same-block filtered rescan
54ddbd0bby Matt Corallo+177−486 files
No security note in commit
Informational 15 AI analysisMessage 83 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Add test framework coverage of `Listen` block connection replays

This commit only adds a new test mode to the project's internal testing framework. It lets developers simulate a specific way blocks are delivered to the Lightning node (a 'replay' through the Listen interface) so that behavior is covered …

bf6ad23eby Matt Corallo+18−32 files
No security note in commit
Informational 15 AI analysisMessage 83 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Update functional test block connection to detect block replays

This commit changes only internal test helper code in the Lightning Dev Kit repository. It makes the functional test framework smarter about 'block replays'—situations where the same block is fed to a test node more than once—so the fake b…

No production code modifiedNo cryptographic, consensus, or networking changesCommit message frames change as test-framework correctness, not security
477facb4by Matt Corallo+41−333 files
No security note in commit
Moderate 66 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Correct HTLC confusion on unrevoked counterparty commitment txs

This patch fixes a bug in the Lightning Dev Kit where the software could confuse HTLCs (payment contracts) on live, unrevoked counterparty commitment transactions with ones from old, revoked transactions. Previously, it relied only on whet…

Incorrect revocation state detection for counterparty commitment transactionsHTLC direction not previously checked when matching against pending HTLCsPromotion of debug assertions to full assertions for HTLC claim path consistency
f06a08a6by Matt Corallo+26−192 files
Vendor flagged security relevance
Low 47 AI analysisMessage 85 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Return `Err`s` instead of panicking on oversized messages

This commit changes how the Lightning networking code handles oversized encrypted messages. Previously, certain conditions would cause the program to crash with a panic. Now the code returns errors instead, which is a defensive improvement…

panic-to-error conversion for oversized message encryption/decryptiondenial-of-service hardening against oversized peer messagesdebug_assert retained to preserve test coverage of invariant violations
08f12bc7by Matt Corallo+68−313 files
Vendor flagged security relevance
Moderate 62 AI analysisMessage 85 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Avoid panicking when attempting to send an oversized message

This commit fixes a crash bug in the Lightning Dev Kit's peer message handling. Previously, if a message grew too large to be sent over the encrypted peer connection, the code would panic (abruptly terminate the whole program). The patch m…

Replaces a `.expect()` panic path with a fallible `Result` in peer message encryptionAdds graceful peer disconnection when a critical message cannot be sentIncludes a regression test for oversized-message handling
c5fdc3bfby Matt Corallo+148−901 file
Vendor flagged security relevance
High 74 AI analysisMessage 78 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Avoid oversized relayed failure messages

This patch fixes a crash bug in the Lightning Dev Kit's handling of HTLC failure messages. A downstream peer could send a maximally-sized failure message without attribution data. When the node added its own attribution data while relaying…

Denial-of-service via remote-triggered panic in message encryptionOversized message exceeding Noise/Lightning wire framing limitMissing length validation before adding attribution data during relay
6b1dfb1aby Matt Corallo+64−191 file
Vendor flagged security relevance
Moderate 64 AI analysisMessage 83 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Reject attempts to advance one-hop blinded forward paths

This commit fixes a denial-of-service bug in rust-lightning where a maliciously crafted one-hop blinded reply path could cause the node to panic when it tried to respond. The fix rejects paths with too few hops before advancing them, and a…

Denial-of-service vector via malformed blinded pathPanic in onion construction due to zero-hop pathUntrusted reply path input validation gap
969a40cfby Matt Corallo+49−14 files
Vendor flagged security relevance
High 72 AI analysisMessage 96 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

lightning-types: replace Zl/Zp separators in `PrintableString`

This commit fixes a log-forgery risk in a Rust Lightning library helper called PrintableString. That helper is meant to make untrusted text safe to print by replacing dangerous characters with a placeholder. It already caught most control …

log injection / log forgery via U+2028/U+2029 line separatorsincomplete input sanitisation in PrintableStringpeer-controlled strings (node alias, BOLT 12 description/issuer/payer_note, peer_msg) as attack surface
75defa9cby Vincenzo Palazzo+63−83 files
Vendor flagged security relevance
Moderate 69 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Apply the unfunded channel peer limit to all unaccepted channels

This commit fixes a rate-limiting bug in the Lightning Dev Kit (LDK) that let a single peer bypass the cap on how many different peers can have unfunded (not-yet-funded) channels open. Previously, if a peer sent multiple channel requests q…

Denial-of-service resource exhaustion via rapid inbound channel open requestsLogic error in rate-limiting conditionRegression test added for the bypass scenario
56a4ee43by Matt Corallo+87−62 files
Vendor flagged security relevance
Moderate 60 AI analysisMessage 88 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Allow filtered block rescans at the current tip

This commit fixes a bug where replaying the current blockchain block through a normal listener callback could crash two core Lightning components (ChannelManager and OutputSweeper) with a panic. The fix recognizes a same-block replay as a …

panic in chain listener callbacksame-block replay/rescan mishandlingassertion failure on valid chain input
686f9860by Elias Rohrer+118−123 files
Vendor flagged security relevance
Moderate 57 AI analysisMessage 78 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Avoid panic when reorged claims cannot merge

This commit fixes a crash bug in the Lightning Dev Kit's on-chain transaction handler. During a deep blockchain reorganization, a previously settled HTLC claim could be 'resurrected' at a block height where it could no longer be combined w…

Assertion/panic in reorg handling pathDeep blockchain reorg as trigger conditionHTLC claim resurrection after reorg
f1dc8487by Matt Corallo+219−52 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 45 · Thin
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Update crate repository links to forgejo

This commit simply updates the 'repository' web links in 15 package metadata files from GitHub to a self-hosted Forgejo instance. It does not change any program code, build logic, dependencies, or security behavior. There is no security is…

eb77676dby benthecarman+15−1515 files
No security note in commit
Low 45 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Account for message type prefix len in prevtx length enforcement

This commit fixes a small but real accounting bug in how rust-lightning checks whether a previous transaction (prevtx) attached to a funding input will make the resulting Lightning wire message too large. The code previously compared the m…

Off-by-constant length check in protocol message size enforcementPotential acceptance of a prevtx that produces an oversized Lightning wire messageDenial-of-service / protocol-interop risk from peer message rejection
d29e1415by Wilmer Paulino+21−41 file
No security note in commit
Moderate 54 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Retransmit splice_locked for 0-conf channels missing tx_signatures

This commit fixes a bug in the Lightning Dev Kit where, after a disconnection, a node could fail to retransmit a 'splice_locked' message to a peer that was still waiting for transaction signatures. Without this retransmission, the two peer…

Protocol state desynchronization between channel peers after reconnectionMissing retransmission of splice_locked for 0-conf splice channelsPotential channel unusability or stuck splice negotiation
5434015bby Wilmer Paulino+266−12 files
No security note in commit
Low 37 AI analysisMessage 83 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

bolt12: add pay_for_bolt12_invoice for externally-sourced invoices

This commit adds a new API, pay_for_bolt12_invoice, that lets users pay a BOLT 12 invoice even if LDK did not originally request it. It is intended for advanced use cases like multi-sender payments and replaces an older, more restrictive A…

New API removes internal invoice-origin verification, shifting trust boundary to callerDocumentation explicitly warns caller to verify invoice via Bolt12Invoice::verify_using_metadata and to ensure unique payment_id to avoid duplicate paymentsInput validation added for zero amount, overpay, and partial-amount-without-MPP
5b80fe9cby Alkamal01+550−156 files
No security note in commit
Low 26 AI analysisMessage 90 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Include to_self_delay size in DelayedPaymentOutput weight calculation

This commit fixes a small accounting bug in how the Lightning wallet estimates the size (and therefore transaction fee) of a special Bitcoin transaction that sweeps funds back to the user after a channel closes. The old code always assumed…

debug assertion failure possible in development/testing buildstransaction weight/fee estimate overestimation up to 3 WUconstant replaced with per-descriptor length computation
e6652237by Matt Morehouse+97−83 files
No security note in commit
Informational 18 AI analysisMessage 65 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Correct docs on `ChannelSigner::get_per_commitment_point`

This commit only updates documentation comments for a Rust function called get_per_commitment_point. It removes an outdated warning that the method was non-asynchronous and that returning an error could cause a crash, and replaces it with …

Documentation-only changeRemoves outdated panic warningAdds retry/unblock guidance for signer errors
5057809bby Matt Corallo+6−31 file
No security note in commit
Informational 16 AI analysisMessage 35 · Opaque
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

ln/refactor: remove BlindedTrampolineEntrypoint

This commit is a small internal code cleanup in the Lightning Dev Kit's Trampoline routing code. It removes a separate 'BlindedTrampolineEntrypoint' payload variant and folds an optional blinding point into the existing 'Forward' variant. …

Refactor-only change with no added bounds checks or validationNo mention of vulnerability, CVE, security fix, or bug in commit messageTLV field changed from required to optional, but only for a newly unified variant used in internal construction
3e0c2697by Carla Kirk-Cohen+8−263 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.

AI review queuedRename `CommitmentTransaction.feerate_per_kw()`by Leo Nash · e921bf6c · Sep 6, 2025 · 6 filesMessage 58 · ThinInformational 15Details
Commit message · Leo Nash

Rename `CommitmentTransaction.feerate_per_kw()`

Use `negotiated_feerate_per_kw()` to underscore that this is the feerate
we negotiated with our peer, not the actual feerate of the commitment
transaction. The feerate of the actual commitment transaction may be
higher.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit is a simple rename of a method from `feerate_per_kw()` to `negotiated_feerate_per_kw()` across the codebase, plus an update to its documentation. The goal is to make it clearer that the returned value is the fee rate agreed with the peer, not necessarily the actual fee rate used on-chain. There are no logic changes and no security fix.

Lower-priorityCreate a single P2A anchor on commitment transactions in 0FC channelsby Leo Nash · 9008409a · Sep 6, 2025 · 1 fileMessage 73 · AdequateLow 32Details
Commit message · Leo Nash

Create a single P2A anchor on commitment transactions in 0FC channels

Zero-fee commitment channels replace today's existing `to_local_anchor`
and `to_remote_anchor` outputs with a single `shared_anchor` output.

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 32/100

This commit changes how Bitcoin transaction fees are handled for a new type of Lightning channel. Instead of each party having their own small 'anchor' output to bump the transaction fee later, the commit creates one shared anchor output. It also switches these zero-fee commitment transactions to use a non-standard version 3. This is part of an ongoing protocol update and does not by itself look like a security bug fix; it is more like feature construction.

AI review queuedSerialization for Vec<BlindedMessagePath>by Joost Jager · 8db88139 · Sep 5, 2025 · 1 fileMessage 35 · OpaqueInformational 18Details
Commit message · Joost Jager

Serialization for Vec<BlindedMessagePath>

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 18/100

This commit adds a single line of code that enables serialization (the ability to convert data into a format that can be stored or transmitted) for a list of BlindedMessagePath objects. It is a routine, additive change with no visible security implications. There is no indication this fixes or introduces a vulnerability.

Lower-priorityCorrect and clarify comments in `ChannelMonitor` loading test utilsby Matt Corallo · 487a36dd · Sep 4, 2025 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Matt Corallo

Correct and clarify comments in `ChannelMonitor` loading test utils

60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only changes comments in a test utility file. It clarifies what a test is checking and why it does not perform a certain assertion. No code behavior was changed, so there is no security impact.

Lower-priorityAdd logging to offers flowby Joost Jager · 6ab6894f · Sep 4, 2025 · 2 filesMessage 45 · ThinInformational 15Details
Commit message · Joost Jager

Add logging to offers flow

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds diagnostic log messages to the existing offers/payment flow. It does not change any security checks, validation rules, or behavior. The code still rejects oversized recipient IDs, expired invoices, and failed path creation exactly as before; it now just records why those rejections happened. There is no indication this fixes a vulnerability or introduces one.

Lower-priorityRequire channelmanager logger to implement Cloneby Joost Jager · 83f64a0a · Sep 4, 2025 · 1 fileMessage 45 · ThinInformational 17Details
Commit message · Joost Jager

Require channelmanager logger to implement Clone

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 17/100

This commit changes the Rust type requirements for the logger used by the ChannelManager so that the logger must implement the Clone trait. This is a compile-time API change, not a fix for an exploitable runtime bug. It may break downstream code that passes a logger that cannot be cloned, but it does not introduce or patch a security vulnerability on its own.

Lower-priorityUse HolderCommitmentPoint::current_transaction_numberby Jeffrey Czyz · a3a3a55e · Sep 3, 2025 · 1 fileMessage 40 · ThinModerate 54Details
Commit message · Jeffrey Czyz

Use HolderCommitmentPoint::current_transaction_number

40/100 · ThinMessage clarity
✓ Specific, descriptive subject! No meaningful explanatory body
AI analysis · Moderate 54/100

This tiny code change fixes how rust-lightning calculates which local commitment transaction number to report during Lightning channel re-establishment. The old code used an upcoming ('next') transaction number and subtracted an extra 1, which could produce an off-by-one value. If that value is wrong, a peer could be told we are on a different commitment number than we actually are, potentially causing a force-close or state mismatch during channel recovery. The fix uses the current transaction number directly.

Security candidateRetransmit announcement_signatures if requestedby Jeffrey Czyz · ff98bbf5 · Sep 3, 2025 · 2 filesMessage 58 · ThinLow 35Details
Commit message · Jeffrey Czyz

Retransmit announcement_signatures if requested

The previous commit allowed requesting retransmission of
announcement_signatures during channel reestablishment. This commit
handles such requests.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Low 35/100

This commit completes a feature that lets a Lightning node ask its peer to resend 'announcement_signatures' messages during channel reestablishment. These signatures are needed to publicly announce a channel on the network. The change simply adds the logic to honor that request, matching a protocol rule. It is a follow-up implementation patch, not a fix for an active vulnerability.

Security candidateRequest announcement_signatures retransmissionby Jeffrey Czyz · 734452ca · Sep 3, 2025 · 2 filesMessage 58 · ThinLow 34Details
Commit message · Jeffrey Czyz

Request announcement_signatures retransmission

During channel reestablishment, announcement_signatures may need to be
retransmitted. The splicing spec allows doing so without retransmitting
splice_locked first, which could normally trigger retransmitting
announcement_signatures. Instead, my_current_funding_locked lets the
sender request retransmitting it.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Low 34/100

This commit changes how Lightning nodes request missing announcement signatures after a channel reconnects. It adds a flag to the FundingLocked message so a node can explicitly ask its peer to resend announcement_signatures when needed, rather than relying on the older splice_locked retransmission path. This is a protocol-correctness improvement for splicing; it does not appear to be a direct exploit fix.

Security candidateUpdate next_funding_txid logic for channel_reestablishby Jeffrey Czyz · 77747c0a · Sep 3, 2025 · 3 filesMessage 85 · StrongLow 43Details
Commit message · Jeffrey Czyz

Update next_funding_txid logic for channel_reestablish

The splicing spec updates the logic pertaining to next_funding_txid when
handling a channel_reestablish message. Specifically:

A receiving node:
- if `next_funding_txid` is set:
- if `next_funding_txid` matches the latest interactive funding transaction
or the current channel funding transaction:
- if `next_commitment_number` is equal to the commitment number of the
`commitment_signed` message it sent for this funding transaction:
- MUST retransmit its `commitment_signed` for that funding transaction.
- if it has already received `commitment_signed` and it should sign first,
as specified in the [`tx_signatures` requirements](#the-tx_signatures-message):
- MUST send its `tx_signatures` for that funding transaction.
- if it has already received `tx_signatures` for that funding transaction:
- MUST send its `tx_signatures` for that funding transaction.
- if it also sets `next_funding_txid` in its own `channel_reestablish`, but the
values don't match:
- MUST send an `error` and fail the channel.
- otherwise:
- MUST send `tx_abort` to let the sending node know that they can forget
this funding transaction.

Note that the spec is in flux. Instead, next_funding_txid is replaced
with next_funding, which contains both a txid and retransmit_flags. The
latter is used instead of next_commitment_number to determine whether
commitment_signed should be retransmitted.

This commit updates FundedChannel::channel_reestablish accordingly.

Co-authored-by: Wilmer Paulino <wilmer@wilmerpaulino.com>
Co-authored-by: Jeffrey Czyz <jkczyz@gmail.com>

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
signing boundary
AI analysis · Low 43/100

This commit updates how the Lightning Dev Kit (LDK) node handles reconnection messages for channels that are in the middle of creating a new funding transaction (a 'splicing' or interactive funding flow). It replaces a simple transaction ID field with a richer structure that also carries flags telling the peer which messages to re-send. The change is a protocol-conformance update for a still-evolving Lightning specification; it does not appear to be a fix for an active security vulnerability, but it prevents possible state mismatches during reconnections.

Security candidateClear announcement_sigs on FundingScope promotionby Jeffrey Czyz · 70508569 · Sep 3, 2025 · 1 fileMessage 80 · StrongLow 45Details
Commit message · Jeffrey Czyz

Clear announcement_sigs on FundingScope promotion

When a splice transaction is promoted (i.e., when splice_locked has been
exchanged), announcement_signatures must be sent. However, if we try to
send a channel_announcement before they are received, then the
signatures will be incorrect. To avoid this, clear the counterparty's
announcement_signatures upon promoting a FundingScope.

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
signing boundary
AI analysis · Low 45/100

This patch fixes a Lightning channel bug that could produce an invalid channel announcement after a splice is finalized. When a channel is spliced (its on-chain funds are moved to a new transaction), both sides must exchange fresh announcement signatures before re-announcing the channel to the network. The bug caused the old counterparty signature to be kept briefly after the splice was promoted, so if the node tried to build and send a channel_announcement before the new signature arrived, it would use a stale signature and create an invalid message. The fix simply clears the old signature when the splice is promoted, forcing the node to wait for the new one. There is no direct theft-of-funds path, but it could cause gossip inconsistencies or a peer to send invalid protocol messages.

Lower-priorityHandle implicit splice_locked during channel_reestablishby Jeffrey Czyz · d4ddbc4e · Sep 3, 2025 · 2 filesMessage 73 · AdequateModerate 54Details
Commit message · Jeffrey Czyz

Handle implicit splice_locked during channel_reestablish

When handling a counterparties channel_reestablish, the spec dictates
that a splice_locked may be implied by my_current_funding_locked.
Compare that against any pending splices and handle an implicit
splice_locked message when applicable.

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

This commit fixes a protocol-handling bug in LDK's Lightning splicing feature. When two peers reconnect after a splice, the Lightning spec says a 'splice_locked' message can be implied by the other peer's current funding state. LDK previously did not recognize this implied signal, which could leave a splice stuck or cause the channel to behave incorrectly after reconnection. The change detects the implicit splice_locked and processes it normally.

Lower-priorityRemove unnecessary next_funding checkby Jeffrey Czyz · 976381a4 · Sep 3, 2025 · 1 fileMessage 58 · ThinLow 26Details
Commit message · Jeffrey Czyz

Remove unnecessary next_funding check

During channel_reestablish handling, next_local_commitment_number can
never be zero. Remove the unnecessary check conditioning on next_funding
not being set. Additionally, remove the spec requirement in the comment
that follows since it does not exist.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Low 26/100

This commit tightens a validation check during Lightning channel reconnection. It removes a special case that allowed a peer to send a zero commitment counter without also providing next_funding data. The change makes the code reject that zero-counter case outright, which is described as safe because the counter should never be zero at this stage. The commit also deletes an incorrect comment that cited a non-existent specification requirement.

Security candidateDon't retransmit tx_signatures pending monitor updateby Jeffrey Czyz · 73639c3b · Sep 3, 2025 · 1 fileMessage 65 · AdequateModerate 60Details
Commit message · Jeffrey Czyz

Don't retransmit tx_signatures pending monitor update

The ChannelMonitor must be successfully persisted before transmitting
any messages.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Why it was queued
signing boundary
AI analysis · Moderate 60/100

This commit fixes a timing issue in the Lightning Dev Kit where a node could send transaction signatures to its peer before its own local safety record (the ChannelMonitor) had been saved. Sending signatures too early could, in edge cases, leave the node in a vulnerable or inconsistent state if something crashed or went wrong before the save completed. The fix simply waits to send signatures until the monitor update is finished.

Security candidateCorrectly order channel_ready on channel_reestablishby Jeffrey Czyz · a0b6dd60 · Sep 3, 2025 · 2 filesMessage 85 · StrongModerate 63Details
Commit message · Jeffrey Czyz

Correctly order channel_ready on channel_reestablish

When handling channel_reestablish, the order in which channel_ready is
sent depends on whether or not the initial commitment_signed /
tx_signatures are being retransmitted. When they are, then channel_ready
should come after them. Otherwise, channel_ready should come before any
commitment_signed.

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 boundary
AI analysis · Moderate 63/100

This patch fixes the order in which Lightning messages are resent when a connection comes back after being dropped. In some channel states, the node was sending 'channel_ready' before the initial signatures it depends on, or after them when it shouldn't. The fix adds a new ordering flag so the correct sequence is used depending on whether the channel is still finalizing its funding transaction or is already operational. A wrong order could confuse a peer and prevent the channel from resuming correctly, potentially causing a denial of service or funds to be stuck.

Security candidateMake BlindedMessagePath creation infallibleby Valentine Wallace · 11f3476c · Sep 3, 2025 · 7 filesMessage 63 · AdequateLow 36Details
Commit message · Valentine Wallace

Make BlindedMessagePath creation infallible

The LDK codebase in general is comfortable panicking if the entropy source
provided to it is dysfunctional. Up until now we made an exception for blinded
path creation, where we would handle an error that could occur on mul_tweak
that could only occur if the session_priv provided was not actually random.
In comparable cases in onion_utils, we would panic instead.

In upcoming commits, we will be including blinded paths in outbound
revoke_and_ack messages as part of implementing async payments, where it is
difficult to handle failing back an HTLC if blinded path creation fails. Thus
we now have an incentive to make the blinded path creation methods infallible,
so do so here.

63/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
entropy or randomness
AI analysis · Low 36/100

This commit changes how LDK builds private 'blinded' communication paths so that the creation process can no longer fail in normal use. Previously, a bad random number could cause path creation to return an error. Now the code will panic (crash the program) instead if that happens, matching how LDK already handles broken randomness elsewhere. The change is described by the developers as a cleanup to simplify upcoming async-payments work, not as a fix for an active security bug.

Lower-priorityDRY PendingAddHTLCInfo creation in forward_htlcsby Valentine Wallace · 8173ac0c · Sep 3, 2025 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Valentine Wallace

DRY PendingAddHTLCInfo creation in forward_htlcs

Without this DRYing, we would be repeating the same code to instantiate the
PendingAddHTLCInfo several more times in this method, in upcoming commits.

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

This commit is a straightforward code cleanup with no security impact. It removes repeated construction of the same data structure in one function and replaces it with a single shared variable. The behavior of the program is unchanged.

Lower-priorityDRY HTLCPreviousHopData creationby Valentine Wallace · 84c997df · Sep 3, 2025 · 1 fileMessage 58 · ThinInformational 15Details
Commit message · Valentine Wallace

DRY HTLCPreviousHopData creation

In upcoming commits, we will be adding several more conversions from
PendingAddHTLCInfo into HTLCPreviousHopData. This conversion gets repeated all
over the ChannelManager already, so lay some groundwork by DRYing it up.

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

This commit is a straightforward internal code cleanup in the Lightning Dev Kit's channel manager. It removes repeated code that builds a data structure called HTLCPreviousHopData by replacing those copies with a single helper method. There is no change to user-facing behavior, network protocol handling, or security logic.

AI review queuedAdd a method to avoid re-persisting monitors during startupby Matt Corallo · d3779580 · Sep 3, 2025 · 5 filesMessage 85 · StrongInformational 20Details
Commit message · Matt Corallo

Add a method to avoid re-persisting monitors during startup

Prior to LDK 0.1, in rare cases we could replay payment claims to
`ChannelMonitor`s on startup, which we then expected to be
persisted prior to normal node operation. This required
re-persisting `ChannelMonitor`s after deserializing the
`ChannelManager`, delaying startup in some cases substantially.

In 0.1 we fixed this, moving claim replays to the background to run
after the `ChannelManager` starts operating (and only
updating/persisting changes to the `ChannelMonitor`s which need
it). However, we didn't actually enable this meaningfully in our
API - nearly all users use our `ChainMonitor` and the only way to
get a chanel into `ChainMonitor` is through the normal flow which
expects to persist.

Here we add a simple method to load `ChannelMonitor`s into the
`ChainMonitor` without persisting them.

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
second-pass: broader security terminology
AI analysis · Informational 20/100

This commit adds a new startup-only API method that lets LDK nodes load already-saved channel monitors without rewriting them to disk. It is a performance and reliability improvement, not a security fix, and does not change how normal channel watching works.

AI review queuedCheck v2 reserves after `funding_contribution_satoshis` is appliedby Leo Nash · 85a02cac · Sep 2, 2025 · 2 filesMessage 73 · AdequateModerate 59Details
Commit message · Leo Nash

Check v2 reserves after `funding_contribution_satoshis` is applied

We check this when validating `splice_init`, `splice_ack` messages, and
also when validating user-specified contributions.

From BOLT 2:
```
- If `funding_contribution_satoshis` is negative and its absolute value
is greater than the sending node's current channel balance:
- MUST send a `warning` and close the connection or send an `error`
and fail the channel.
```

and further down:
```
If a side does not meet the reserve requirements, that's OK: but if they
take funds out of the channel, they must ensure that they do meet them.
If your peer adds a massive amount to the channel, then you only have
to add more reserve if you want to contribute to the splice (and you
can use `tx_remove_output` and/or `tx_remove_input` part-way through if
this happens).
```

Therefore, we check the v2 reserve anytime
`funding_contribution_satoshis` is not equal to zero.

We allow parties to draw from their previous reserve, as long as they
satisfy their v2 reserve.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Moderate 59/100

This commit tightens the rules for Lightning channel splicing (a way to add or remove funds from an existing channel). It makes sure that after a splice, each side still has enough money left in the channel to meet the required 'channel reserve'—a safety buffer meant to discourage cheating. Before this change, the code did not fully enforce that reserve check when a splice removed funds, which could have let one party drain too much money and leave the channel in a risky state. The patch also cleans up overflow checks and fee handling.

AI review queuedAdd `NextCommitmentStats::get_balances_including_fee`by Leo Nash · 13ccaa35 · Sep 2, 2025 · 1 fileMessage 63 · AdequateInformational 17Details
Commit message · Leo Nash

Add `NextCommitmentStats::get_balances_including_fee`

`NextCommitmentStats` provides the commitment transaction fee as a
separate value to assist with applying a multiplier on it in
`can_accept_incoming_htlc`.

Nonetheless in most cases, we want the balances to include the
commitment transaction fee, so here we add a helper that gives us these
balances.

Also make the style of `tx_builder::subtract_addl_outputs` consistent
with `get_balances_including_fee`.

63/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 17/100

This commit adds a small helper function to include transaction fees when calculating Lightning channel balances. It also makes an existing internal function's code style match the new helper. There is no obvious security bug being fixed; it appears to be a routine code cleanup and convenience addition.

AI review queuedMake `for_splice` infallibleby Leo Nash · bfa0f95c · Sep 2, 2025 · 1 fileMessage 35 · OpaqueLow 29Details
Commit message · Leo Nash

Make `for_splice` infallible

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Low 29/100

This commit changes an internal function called `for_splice` so it no longer returns an error. Previously, the function could fail and callers used `?` to propagate that failure. Now it always succeeds. The change is small and appears to be a code-cleanup step in the unfinished splicing feature, but the commit message gives no explanation of why the function was made infallible or what error conditions were removed. Without more context, it is unclear whether this removes a safety check that protected against invalid splice parameters.

Lower-priorityAdd `validate_splice_ack` helper functionby Leo Nash · 35d6f65c · Sep 2, 2025 · 1 fileMessage 58 · ThinInformational 15Details
Commit message · Leo Nash

Add `validate_splice_ack` helper function

As in `splice_init`, this helps clearly delineate `splice_ack` message
validation from the subsequent state mutations.

This is a code-move.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
Why it was queued
defensive validation
AI analysis · Informational 15/100

This commit is a pure code reorganization: it moves the validation logic for a 'splice_ack' message into a new helper function called validate_splice_ack, then makes the existing splice_ack handler call that helper. No behavior changes, no new checks, no security fixes, and no new vulnerabilities are introduced.

Lower-priorityFinish validation in `splice_ack` before taking a `&mut self`by Leo Nash · a4796a44 · Sep 2, 2025 · 1 fileMessage 73 · AdequateInformational 24Details
Commit message · Leo Nash

Finish validation in `splice_ack` before taking a `&mut self`

As much as possible, we want to only mutate state once we are done with
input validation.

This also removes complaints when helper functions during validation
take a `&self`.

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

This change is a defensive code-quality refactor in a Lightning channel splicing feature. It moves input validation earlier so the function only mutates internal state after all checks pass. The commit message frames this as a hardening measure, but the diff itself does not fix a known exploitable bug or change observable behavior under normal operation.

Lower-priorityEnforce that the splice initiator set a non-zero funding contributionby Leo Nash · b5cf08d4 · Sep 2, 2025 · 1 fileMessage 50 · ThinLow 49Details
Commit message · Leo Nash

Enforce that the splice initiator set a non-zero funding contribution

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

This commit adds a check in the Lightning Dev Kit's channel code to reject splice attempts where the party initiating the splice contributes zero new funds. Previously, such a zero-contribution splice could be accepted, which may have allowed a peer to trigger invalid or unintended splice state transitions. The fix disconnects the peer with a warning when this happens.