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 queue975AI analyses
75commits · 30 days
208commits · 60 days
663commits · 180 days
1491commits · 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 Rohrer15315104667
Matt Corallo35847207373
Jeffrey Czyz17741116168
Leo Nash1161388162
Valentine Wallace1371058169
Vincenzo Palazzo10210184
Wilmer Paulino14939107069
Joost Jager16224126069
elnosh301326056
shaavan22614069
Carla Kirk-Cohen78347068
benthecarman18314071
Analysis record

Published AI watches

Last scanned 19 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 17 AI analysisMessage 83 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

fuzz: allow empty-channel force close with in-flight payments

This commit changes a fuzz-testing harness, not the production Lightning node code. It loosens a test rule so the fuzzer can simulate force-closing a channel that has no pending payments of its own, even if other channels in the test still…

Fuzz harness behavior change onlyNo modifications to production consensus, cryptography, or networking codeNo privilege boundary crossed
dbb12502by Joost Jager+32−71 file
No security note in commit
Repository ledger

Explore captured commits

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

Lower-priorityAdd `PaymentId` to logging `Record`sby Matt Corallo · 253ceede · Jan 28, 2026 · 4 filesMessage 80 · StrongInformational 15Details
Commit message · Matt Corallo

Add `PaymentId` to logging `Record`s

While `PaymentHash`es are great for searching logs, in the case of
BOLT 12 the hash isn't selected until well into the payment
process. Thus, its important that we allow for filtering by
`PaymentId` as well to ensure payment-related logs are always
reliably searchable.

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

This commit only adds a new piece of information—the PaymentId—to log records so operators can search logs more reliably, especially for newer BOLT 12 payments where the payment hash isn't known early. It does not change any payment logic, cryptography, network handling, or access controls, and it does not fix or introduce any security vulnerability.

Lower-priorityRequire `WithContext` log wrappers on `OutboundPayments` callsby Matt Corallo · 5e64c401 · Jan 28, 2026 · 2 filesMessage 93 · StrongInformational 15Details
Commit message · Matt Corallo

Require `WithContext` log wrappers on `OutboundPayments` calls

In much of LDK we pass around `Logger` objects both to avoid having
to `Clone` `Logger` `Deref`s (soon to only be `Logger`s) and to
allow us to set context with a wrapper such that any log calls on
that wrapper get additional useful metadata in them.

Sadly, when we added a `Logger` type to `OutboundPayments` we broke
the ability to do the second thing - payment information logged
directly or indirectly via logic in the `OutboundPayments` has no
context making log-searching rather challenging.

Here we fix this by retunring to passing loggers explicitly to
`OutboundPayments` methods that need them, specifically requiring
`WithContext` wrappers to ensure the callsite sets appropriate
context on the logger.

Fixes #4307

93/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 15/100

This change is a code-quality and observability fix, not a security patch. The developers noticed that payment-related log messages from an internal component called OutboundPayments were missing useful context (like the payment hash), making it harder to search and debug logs. They fixed it by passing a specially-wrapped logger into each OutboundPayments call so the context is attached at the point where the call is made. There is no vulnerability being fixed here.

Lower-priorityln: add function to build trampoline forwarding onionsby Carla Kirk-Cohen · d7955f94 · Jan 28, 2026 · 1 fileMessage 50 · ThinTriage 0Details
Commit message · Carla Kirk-Cohen

ln: add function to build trampoline forwarding onions

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Lower-priorityUse a single `WithContext` wrapper rather than several log-wrappersby Matt Corallo · 0f253c0b · Jan 28, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Matt Corallo

Use a single `WithContext` wrapper rather than several log-wrappers

In `ChannelMonitor` logging, we often wrap a logger with
`WithChannelMonitor` to automatically include metadata in our
structured logging. That's great, except having too many logger
wrapping types flying around makes for less compatibility if we
have methods that want to require a wrapped-logger.

Here we change the `WithChannelMonitor` "constructors" to actually
return a `WithContext` instead, making things more consistent.

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

This is a routine internal code cleanup in a Lightning network library. It replaces a custom logger wrapper type with a shared, existing wrapper type. There is no change to user-facing behavior, no bug fix, and no security-relevant change.

Lower-priorityRefactor monitor file listing in tests to filter .tmp filesby Joost Jager · beccec2d · Jan 28, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Joost Jager

Refactor monitor file listing in tests to filter .tmp files

Extract common logic for listing monitor files into a helper function
that filters out temporary .tmp files created during persistence
operations. This simplifies test code and improves reliability on
systems where directory iteration order is non-deterministic.

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only changes test code in the Lightning Dev Kit Rust library. It extracts repeated logic for listing monitor files into a small helper function that ignores temporary `.tmp` files. There is no change to production code, no security fix, and no vulnerability being addressed.

Lower-priorityAdd basic `CLAUDE.md` fileby Elias Rohrer · 8b1386c7 · Jan 28, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Elias Rohrer

Add basic `CLAUDE.md` file

We add a basic `CLAUDE.md` file pointing it to some workspace specifics
(in particular running `cargo fmt` on 1.75.0 MSRV, and using
`./ci/ci-tests.sh` to run tests).

Signed-off-by: Elias Rohrer <dev@tnull.de>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit adds a documentation file (CLAUDE.md) that gives instructions to an AI coding assistant about how to work with the project. It does not change any program code, build scripts, tests, or configuration that could affect security.

Lower-priorityMove HTLC interception decisions to `forward_htlcs` callsitesby Matt Corallo · 04351fd8 · Jan 27, 2026 · 3 filesMessage 85 · StrongLow 35Details
Commit message · Matt Corallo

Move HTLC interception decisions to `forward_htlcs` callsites

In the next commit we'll substantially expand the types of HTLCs
which can be intercepted. In order to do so, we want to make
forwarding decisions with access to the (specified) destination
channel. Sadly, this isn't available in `forward_htlcs`, so here we
move interception decisions out of `forward_htlcs` and into
`process_pending_update_add_htlcs` and `handle_release_held_htlc`.

Note that we do not handle HTLC interception when forwarding an
HTLC which was decoded in LDK versions prior to 0.2, which is noted
in a suggested release note. This is due to a gap where such HTLC
might have had its routing decision made already and be waiting
for an interception decision in `forward_htlcs`, but now we will
only make an interception decision when decoding the onion.

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

This commit refactors when and where the Lightning node decides to intercept HTLCs (payments it is asked to forward). It moves the interception decision from a later forwarding stage to the earlier moment when the incoming HTLC is decoded. The change is preparatory work for a larger feature and includes a noted backwards-compatibility limitation: HTLCs first received on LDK versions before 0.2 will no longer be intercepted and will instead be forwarded or failed automatically. There is no direct evidence in the commit that this fixes an active security vulnerability, but it changes payment-handling logic in a security-sensitive area.

Lower-priorityExpose the outgoing HTLC's CLTV expiry in `Event::HTLCIntercepted`by Matt Corallo · ce91315b · Jan 27, 2026 · 3 filesMessage 73 · AdequateInformational 20Details
Commit message · Matt Corallo

Expose the outgoing HTLC's CLTV expiry in `Event::HTLCIntercepted`

In the previous commit our interception documentation noted that in
some cases devs may wish to validate the CLTV expiry of HTLCs
before forwarding. Here we enable that by exposing the next-hop's
CLTV value in `Event::HTLCIntercepted`

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

This commit adds a new piece of information—the outgoing HTLC's CLTV expiry block height—to the Event::HTLCIntercepted event in the Lightning Dev Kit. This lets developers who intercept payments inspect when the forwarded HTLC would time out, so they can validate it before forwarding. It is a feature/API enhancement, not a fix for an active vulnerability.

Lower-prioritySupport generic HTLC interceptionby Matt Corallo · a0723ad7 · Jan 27, 2026 · 10 filesMessage 70 · AdequateLow 37Details
Commit message · Matt Corallo

Support generic HTLC interception

At various points we've had requests to support more generic HTLC
interception in LDK. In most cases, full HTLC interception was not,
in fact, the right way to accomplish what the developer wanted, but
there have been various times when it might have been.

Here, we finally add full HTLC interception support, doing so with
a configurable bitfield to allow developers to intercept only
certain classes of HTLCs.

Specifically, we currently support intercepting HTLCs:
* which were to be forwarded to intercept SCIDs (as was already
supported),
* which were to be forwarded to offline private channels (for LSPs
to accept HTLCs for offline clients so that they can attempt to
wake them before failing the HTLC),
* which were to be forwarded to online private channels (for LSPs
to take additional fees or enforce certain policies),
* which were to be forwarded over public channels (for general
forwarding policy enforcement),
* which were to be forwarded to unknown SCIDs (for everything
else).

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 37/100

This commit expands an existing Lightning payment interception feature in LDK. Previously, developers could only intercept payments routed through special fake channel IDs. Now they can intercept a wider range of forwarded payments (private channels, public channels, unknown channel IDs) using a configurable bitfield. The change is a feature addition, not a fix for a known vulnerability, but it touches sensitive payment-forwarding logic and changes a public configuration option from a boolean to a bitfield.

Lower-priorityDrop lockorder comments on `ChannelManager`by Matt Corallo · 653692ea · Jan 27, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Matt Corallo

Drop lockorder comments on `ChannelManager`

While its nice to document things, the lockorder comment at the top
of `ChannelManager` is just annoying to always update and doesn't
add all that much value. Developers likely shouldn't be checking it
while writing code, our automated lockorder issue detection
framework more than suffices to catch any bugs in test-reachable
code. That makes it basically write-only which isn't exactly a
useful comment.

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 only removes documentation comments describing the order in which internal locks should be acquired in the ChannelManager. No code logic, lock usage, or behavior changed. It is a cleanup of stale developer comments, not a security fix or vulnerability.

Lower-priorityMove HTLC holding into HTLC decode from `forward_htlcs`by Matt Corallo · b5d1f7e2 · Jan 27, 2026 · 1 fileMessage 85 · StrongLow 35Details
Commit message · Matt Corallo

Move HTLC holding into HTLC decode from `forward_htlcs`

When we added support for async payments (which requires holding
HTLCs until we receive an onion message), we added the hold logic
to `ChannelManager::forward_htlcs`. This made sense as we reused
the forwarding datastructure in the holding logic so already had
the right types in place, but it turns out only a single call of
`forward_htlcs` should ever result in an HTLC being held.

All of the other calls (un-holding an HTLC, forwarding an
intercepted HTLC, forwarding an HTLC decoded by LDK prior to 0.2,
or processing a phantom receive) should never result in an HTLC
being held. Instead, HTLCs should actually only ever be held when
the HTLC is decoded in `process_pending_update_add_htlcs` before
forwarding.

Because of this, and because we want to move the interception (and
thus also the holding logic) out of `forward_htlcs`, here we move
the holding logic into `process_pending_update_add_htlcs`.

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

This commit is a code cleanup that moves where in the program Lightning payments are intentionally held (paused) for async delivery. It does not add or remove security behavior, but it changes which internal function is responsible for deciding to hold a payment. Because the change is described as a prerequisite for moving interception logic out of a central forwarding function, it could affect correctness of payment handling if done wrong, but the diff itself appears to preserve the same hold logic in a different location.

Lower-priorityFix the HTLC failure reason reported when a peer is offlineby Matt Corallo · d497ec20 · Jan 27, 2026 · 2 filesMessage 73 · AdequateLow 33Details
Commit message · Matt Corallo

Fix the HTLC failure reason reported when a peer is offline

If a peer is offline, but only recently went offline and thus the
channel has not yet been marked disabled in our gossip, we should
be returning `LocalHTLCFailureReason::PeerOffline` rather than
`LocalHTLCFailureReason::ChannelNotReady`. Here we fix the error
returned and tweak documentation to make the cases clearer.

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

This commit fixes a small but meaningful error-code bug in the Lightning Dev Kit. When a payment is being routed through a node whose peer just went offline (but the network gossip hasn't yet marked the channel as disabled), the node was incorrectly reporting 'channel not ready' instead of 'peer offline'. The fix makes the reported failure reason accurate, which helps other nodes and payment senders understand why a route failed and choose better routes.

Lower-priorityDRY HTLC failure paths in `process_pending_update_add_htlcs`by Matt Corallo · 4d5b0a6e · Jan 27, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Matt Corallo

DRY HTLC failure paths in `process_pending_update_add_htlcs`

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

This commit is a straightforward code cleanup that removes repeated HTLC failure handling code by introducing a small macro. It also improves logging context and adds a duplicate-intercept error log. There is no security fix or behavior change visible in the diff.

Lower-priorityBOLT 12: Validate bech32 padding per BIP-173by Vincenzo Palazzo · cea1c72c · Jan 26, 2026 · 2 filesMessage 86 · StrongLow 45Details
Commit message · Vincenzo Palazzo

BOLT 12: Validate bech32 padding per BIP-173

Add validation for bech32 padding in BOLT 12 offer parsing per BIP-173
which states: "Any incomplete group at the end MUST be 4 bits or less,
MUST be all zeroes, and is discarded."

This adds a test vector from the BOLT specification that ensures offers
with invalid padding (exceeding the 4-bit limit) are properly rejected.

Previously, LDK would accept offers with invalid bech32 padding. This
was identified through differential fuzzing across Lightning
implementations (see lightning/bolts#1312).

The fix calls `validate_segwit_padding()` from the bech32 crate during
offer parsing, and introduces a new `InvalidPadding` variant to
`Bolt12ParseError` to surface these errors.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>

86/100 · StrongMessage clarity
✓ 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 validationfuzzing or regression evidence
AI analysis · Low 45/100

This change fixes how LDK parses BOLT 12 offers encoded in bech32. Previously, LDK accepted offers whose bech32 padding was invalid according to the BIP-173 standard. The fix now rejects such malformed offers, matching the protocol specification and preventing potential parsing disagreements between Lightning implementations.

AI review queued`ElectrumSyncClient`: Skip unconfirmed `get_history` entriesby Elias Rohrer · cc1eb168 · Jan 23, 2026 · 1 fileMessage 73 · AdequateLow 49Details
Commit message · Elias Rohrer

`ElectrumSyncClient`: Skip unconfirmed `get_history` entries

Electrum's `blockchain.scripthash.get_history` will return the
*confirmed* history for any scripthash, but will then also append any
matching entries from the mempool, with respective `height` fields set
to 0 or -1 (depending on whether all inputs are confirmed or not).

Unfortunately we previously only included a filter for confirmed
`get_history` entries in the watched output case, and forgot to add such
a check also when checking for watched transactions. This would have us
treat the entry as confirmed, then failing on the `get_merkle` step
which of course couldn't prove block inclusion. Here we simply fix this
omission and skip entries that are still unconfirmed (e.g., unconfirmed
funding transactions from 0conf channels).

Signed-off-by: Elias Rohrer <dev@tnull.de>

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

This patch fixes a bug in rust-lightning's Electrum-based transaction sync. When checking whether watched transactions were confirmed, the code previously treated unconfirmed mempool entries from Electrum's get_history as if they were already confirmed. It would then try to fetch a Merkle proof of block inclusion, which cannot exist for an unconfirmed transaction, causing a failure. The fix skips any history entry whose height is 0 or -1 (unconfirmed) in the watched-transaction path, matching what was already done for watched outputs. A debug assertion was also replaced with a proper error log and return if a server returns duplicate history entries.

AI review queuedrustfmt: format priv_short_conf_testsby Thrishalmadasu · b0883ba5 · Jan 23, 2026 · 1 fileMessage 35 · OpaqueInformational 15Details
Commit message · Thrishalmadasu

rustfmt: format priv_short_conf_tests

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

This commit only reformats a test file using rustfmt. It changes whitespace and line breaks but does not alter any actual code logic, behavior, or security-sensitive functionality. There is no security impact.

Lower-prioritySet dont_forward on private channel updates and add testsby Thrishalmadasu · 194678d4 · Jan 23, 2026 · 2 filesMessage 60 · AdequateLow 48Details
Commit message · Thrishalmadasu

Set dont_forward on private channel updates and add tests

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

This commit fixes a protocol-compliance issue in LDK's Lightning channel update messages. Private (unannounced) channels now correctly set the 'dont_forward' flag on their channel_update messages, telling other nodes not to relay them across the network. Public channels continue not to set this flag. The change also adds a warning log when a node receives a channel_update for an unknown channel that has dont_forward set, which can help diagnose configuration mistakes. This is a correctness and privacy improvement rather than a critical vulnerability.

Lower-priorityDrop unnecessary Rust install in SemVer CIby Elias Rohrer · 5da74997 · Jan 23, 2026 · 1 fileMessage 80 · StrongInformational 15Details
Commit message · Elias Rohrer

Drop unnecessary Rust install in SemVer CI

In the last few days there was incompatibility of `cargo-semver-checks`
with the new stable Rust 1.93.0. While this should fixed by today's
release of `cargo-semver-checks`, we take the opportunity to drop an
unnecessary install step from the CI workflow, as the action will bring
their own Rust version if not configured otherwise.

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
documentation-only discount
AI analysis · Informational 15/100

This commit removes an unnecessary step in an automated CI workflow that checks semantic versioning. It is a routine maintenance change with no security implications.

Lower-priorityfuzz: add transaction broadcast assertionsby Joost Jager · ecf502a7 · Jan 22, 2026 · 1 fileMessage 78 · AdequateInformational 12Details
Commit message · Joost Jager

fuzz: add transaction broadcast assertions

Add transaction tracking to TestBroadcaster and verify no unexpected
broadcasts occur during normal fuzzing operation:

- Store all broadcast transactions in TestBroadcaster
- Clear the broadcast set after initial channel opens
- Assert in test_return! that no transactions were broadcast

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

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Informational 12/100

This commit only adds extra checks inside a fuzz test harness. It makes the test's fake transaction broadcaster record any transactions it is asked to broadcast, clears that record after initial channel setup, and then asserts that no further broadcasts happen during normal fuzzing operation. It does not change production code, user-facing behavior, or fix a known bug.

Lower-priorityfuzz: track pending and resolved paymentsby Joost Jager · 246083e0 · Jan 22, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Joost Jager

fuzz: track pending and resolved payments

Track payment lifecycle by maintaining pending_payments and
resolved_payments arrays per node:

- When sending a payment, add its PaymentId to pending_payments
- On PaymentSent/PaymentFailed events, move the PaymentId from
pending to resolved (or assert it was already resolved for
duplicate events)

This tracking enables verifying payment state consistency after
node restarts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Matt Corallo <git@bluematt.me>

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Informational 15/100

This commit only adds bookkeeping inside a fuzzing test harness. It tracks which payments are in-flight versus finished so the test can later check consistency after simulated node restarts. There is no change to production code, no user-facing behavior change, and no security fix.

Security candidatefuzz: convert send helpers to closures with node indicesby Joost Jager · 0a48663f · Jan 22, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Joost Jager

fuzz: convert send helpers to closures with node indices

Replace the standalone `send_noret` and `send_hop_noret` functions with
closures defined inside the main loop. This allows them to capture the
`nodes` array and use simple node indices (0, 1, 2) instead of passing
`&nodes[x]` references at each call site.

The `send_payment` and `send_hop_payment` functions are modified to take
pre-computed `PaymentSecret`, `PaymentHash`, and `PaymentId` parameters,
with the closures handling the credential generation. This centralizes
where `PaymentId` is constructed, which will make it easier to add
payment tracking in a future change.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Matt Corallo <git@bluematt.me>

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
fuzzing or regression evidencecredential or privilege state
AI analysis · Informational 15/100

This commit is a code cleanup inside a fuzzing test file. It converts helper functions into closures and changes how payment identifiers are passed around. There is no change to the actual Lightning node logic that runs in production, and nothing in the commit suggests a security fix or vulnerability.

Lower-priorityfuzz: simplify get_payment_secret_hash return typeby Joost Jager · 7d518922 · Jan 22, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Joost Jager

fuzz: simplify get_payment_secret_hash return type

Change `get_payment_secret_hash` to return `(PaymentSecret, PaymentHash)`
directly instead of `Option<...>`.

The function calls `create_inbound_payment_for_hash` with `min_value_msat=None`
and `min_final_cltv_expiry=None`, which cannot fail. Remove the retry loop
and use `.expect()` since the call will always succeed with these parameters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Matt Corallo <git@bluematt.me>

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
fuzzing or regression evidence
AI analysis · Informational 15/100

This is a small code cleanup inside a fuzz testing harness. It removes an unnecessary retry loop and changes a helper function to return a plain value instead of an optional value. It does not change production Lightning code, user-facing behavior, or security-sensitive logic.

Lower-priorityfuzz: rename chan_id to scid in hop payment functionsby Joost Jager · 151762c8 · Jan 22, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Joost Jager

fuzz: rename chan_id to scid in hop payment functions

Rename `middle_chan_id` to `middle_scid` and `dest_chan_id` to `dest_scid`
in `send_hop_noret` and `send_hop_payment`. These parameters are short
channel IDs (SCIDs), not channel IDs, so the rename improves clarity.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Matt Corallo <git@bluematt.me>

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
fuzzing or regression evidence
AI analysis · Informational 15/100

This commit is a simple variable rename in a fuzz testing file. It changes 'chan_id' to 'scid' (short channel ID) in two helper functions to make the code clearer. There is no functional change and no security impact.

Lower-priorityfuzz: consolidate payment counters into single counterby Joost Jager · 24c61fa5 · Jan 22, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Joost Jager

fuzz: consolidate payment counters into single counter

Replace the separate `p_id: u8` (for payment hash generation) and
`p_idx: u64` (for payment IDs) with a single `p_ctr: u64` counter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Matt Corallo <git@bluematt.me>

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
fuzzing or regression evidence
AI analysis · Informational 15/100

This commit is a code cleanup inside a fuzzing test file. It merges two separate counters used to generate fake payment identifiers into one counter. There is no change to the actual Lightning network library code that users rely on, and nothing in the commit suggests a security fix or vulnerability.

Lower-priorityAdd `total_consistency_lock` check in `handle_post_event_actions`by Matt Corallo · 8bdd1faf · Jan 21, 2026 · 1 fileMessage 85 · StrongInformational 23Details
Commit message · Matt Corallo

Add `total_consistency_lock` check in `handle_post_event_actions`

We expect callers of `handle_post_event_actions` to hold a read
lock on `total_consistency_lock`, and found that we forgot it in
`process_pending_events` until recently. Here we add a relevant
assertion to avoid such issues in the future.

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

This commit adds a safety check (a debug-only assertion) inside a Rust Lightning library function that handles follow-up work after events. The function expects callers to already hold a specific read lock, and one caller was recently fixed to do so. The new assertion is meant to catch future mistakes where a caller forgets the lock. It is a defensive hardening change, not a fix for an active exploit.