LDK
← All projectsLightning Dev Kit

rust-lightning

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

BitcoinCryptographic librariesLightning NetworkNormal
Repository coverage

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

252security candidates228second-pass queue1525AI analyses
83commits · 30 days
181commits · 60 days
555commits · 180 days
1254commits · 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.

70/100 average clarity
473Strong · 80–100
836Adequate · 60–79
294Thin · 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.
Elias Rohrer15315153667
Matt Corallo43553371574
Jeffrey Czyz19545182169
Wilmer Paulino15945155169
Leo Nash11613116162
Valentine Wallace14511138169
Vincenzo Palazzo11311183
Joost Jager16224162069
elnosh391333058
auto-pr-bot2478087
shaavan22622069
Carla Kirk-Cohen78366068
Analysis record

Published AI watches

Last scanned 1 hour, 1 minute ago

Moderate 55 AI analysisMessage 76 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Persistent `MonitorEvent`s' (#4491)

This commit makes on-chain 'MonitorEvent' notifications durable and replay-safe. Previously, if a node crashed after a ChannelMonitor persisted a block update but before the ChannelManager processed the resulting event, the event could be …

Durability/atomicity fix for async persistence: prevents lost MonitorEvents across crashesNew ack-based event lifecycle with random event IDsArchival gating on unacknowledged events to avoid losing preimage/timeout information
9a324e72by wpaulino+467−45912 files
No security note in commit
Low 47 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Fix payment attribution edge cases and simplify claiming' (#5021)

This commit refactors how LDK nodes claim incoming Lightning payments. It replaces a separate 'claim with known custom TLVs' method with an options struct passed to the normal claim call, and fixes two edge cases in payment attribution dat…

API change: claim_funds now takes ClaimFundsOptions, consolidating TLV-known behavior into one pathFailure-packet length bound added to prevent oversized onion error messagesIncoming failure packet truncated at 32 KiB before processing
ee7c61c2by Matt Corallo+256−17322 files
No security note in commit
Low 47 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'release utxos from failed splices' (#4973)

This change fixes a wallet bookkeeping problem in rust-lightning's built-in coin-selection wrappers. Previously, when a splice attempt failed or coin selection errored after picking UTXOs, those UTXOs stayed marked as 'reserved' in memory …

Resource exhaustion / denial-of-service via permanent in-memory UTXO reservationIncorrect state tracking in coin-selection wrapperNew API method required for correct lifecycle management (release_utxos)
7220a6fdby jkczyz+295−383 files
No security note in commit
Low 49 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Restore `Wallet` UTXO locks when coin selection fails afterwards

This commit fixes a bug in the wallet's coin-selection code. When the wallet picked UTXOs to spend, it locked them immediately so they couldn't be reused. But if a later step—fetching the change address or the previous transaction—failed, …

Resource lock leak on error pathUTXO lock state inconsistency between selection and confirmationDenial-of-service/funds-unavailability risk from persistent UTXO locks
81afd9caby elnosh+146−331 file
No security note in commit
Informational 19 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'tx-sync: Parallelize esplora status queries' (#4913)

This commit rewrites how a Lightning wallet talks to Esplora block-explorer servers so that many status checks happen in parallel instead of one at a time. It is a performance/refactoring change. There is no direct evidence in the commit t…

Concurrency/timing change in transaction confirmation logicNew inconsistency check preserved when a previously-confirmed tx is reported unconfirmedAdded defensive error path for missing pre-fetched block status
c303f515by Matt Corallo+140−371 file
No security note in commit
Low 30 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Skip Electrum creator transaction downloads' (#4992)

This change stops the Electrum-based transaction sync client from downloading the very transaction that created an output it is watching. Previously, the client could request that transaction from Electrum, even though a transaction can ne…

Avoids unnecessary Electrum transaction.get requests for watched outputsReduces information disclosure to Electrum server about watched outpointsAdds regression test verifying request suppression
c36e50cbby Matt Corallo+142−02 files
No security note in commit
Low 44 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Use preferred sPK of watched txn in electrum, not rand ones' (#4867)

This change improves how the Lightning Dev Kit's Electrum and Esplora transaction-sync clients track watched Bitcoin transactions. Previously, the code ignored the script pubkey (the 'address' associated with a transaction) supplied when r…

Previously ignored `script_pubkey` argument in `register_tx` for transaction watchersElectrum script-history queries previously used an arbitrary transaction output, which could be OP_RETURN and therefore unindexed by some Electrum serversNew logic prefers caller-supplied script pubkey and falls back to non-OP_RETURN outputs
bfe5ca89by tnull+52−243 files
No security note in commit
Low 33 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Serialize transient Event variants; move persist decision into ChannelManager' (#4791)

This commit changes how LDK stores pending event notifications. It adds serialization support for several event types that previously were not fully saved to disk, and introduces a helper method so the code can decide which events are wort…

Data-loss prevention: previously non-round-trippable event variants are now fully serialized, avoiding accidental event loss when users serialize Event queues themselvesState-consistency hardening: ChannelManager now explicitly skips events that describe non-surviving restart state, preventing replay of stale eventsDefensive assertion: debug builds assert that every persisted event round-trips to Some(event), catching serialization mismatches
a0d4632eby Matt Corallo+694−818 files
No security note in commit
Informational 15 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Document that funding signing events can go stale' (#4960)

This commit only adds documentation comments to two source files. It explains that certain funding-signing events can become stale if the underlying negotiation fails, and that callers may see specific harmless errors as a result. No code …

26eecf2dby Matt Corallo+15−02 files
No security note in commit
Moderate 58 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Add `Wallet::release_utxos` to free UTXOs from abandoned transactions

This commit fixes a design flaw in LDK's built-in wallet helper where coins selected for a splice-in (or other unclaimed funding) were permanently reserved in memory if the transaction was abandoned. Over repeated failed splices, all spend…

Denial-of-service via UTXO exhaustion from repeated failed splice negotiationsRisk of inability to broadcast fee-bumping/claim transactions due to lack of available UTXOsNew API surface (release_utxos) introduced to mitigate resource leak
52ab13fdby elnosh+148−43 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 100 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Drop the honggfuzz version pin from the CI fuzz job

This commit removes a fixed-version pin for the honggfuzz fuzzing tool in a continuous-integration script. The project now uses the current release of honggfuzz instead of an older pinned version. There is no change to the actual Lightning…

4a1635efby auto-pr-bot+1−51 file
No security note in commit
Informational 15 AI analysisMessage 86 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Run the CI fuzz job on the stable toolchain

This commit changes the Rust toolchain used in the continuous integration (CI) fuzzing job from a fixed older version (1.75) to the latest stable release. It is purely a build/test infrastructure change to fix a dependency compatibility is…

21c4ed2bby auto-pr-bot+3−32 files
No security note in commit
Informational 19 AI analysisMessage 91 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Expose the dummy-hop tail constructor publicly

This commit makes a previously internal helper function public so that outside developers can build dummy-hop tails for blinded payment paths without recreating the logic themselves. It is an API usability change, not a fix for a known sec…

No security-relevant behavior change in the diffAPI visibility broadened from crate-public to publicCLTV expiry overflow check already present and unchanged
c5443353by auto-pr-bot+14−71 file
No security note in commit
Moderate 54 AI analysisMessage 100 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Fail commitment sig verification without counterparty params

This change adds a safety check in a Bitcoin Lightning Network library (LDK). Previously, if the software tried to verify a peer's commitment signature before it had learned the peer's channel parameters, it could crash with a panic. Now i…

Defensive check added on peer-driven code path to prevent panicMissing counterparty_parameters could previously cause panic during commitment transaction constructionChannel closure returned instead of panic
de7ecc2fby auto-pr-bot+24−01 file
Vendor flagged security relevance
Informational 15 AI analysisMessage 100 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Clarify the commitment validation failure message

This commit only changes the wording of an error message sent to peers when a commitment transaction fails validation. It replaces the vague phrase 'Failed to validate our commitment' with the clearer 'Received commitment failed validation…

3284a006by auto-pr-bot+11−114 files
No security note in commit
Moderate 61 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Move holder commit sig checks to `InMemorySigner`' (#4885)

This commit moves the checks that validate a counterparty's signatures on the holder's commitment and HTLC transactions out of the general channel code and into the signer module (InMemorySigner). Previously, these signature checks were do…

Moved signature validation from channel state machine into signer moduleAdded new tests that corrupt signatures and verify rejectionChanged error message from 'Invalid commitment tx signature from peer' / 'Invalid funding_created signature from peer' to 'Failed to validate our commitment'
83f5ba55by Matt Corallo+626−31024 files
No security note in commit
Low 42 AI analysisMessage 86 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'Drop stale splice signature on disconnect' (#4954)

This change fixes a Lightning channel splicing bug: when two peers temporarily disconnect during a splice, any half-finished signature the other side already sent is now discarded. Before the fix, that stale signature could be reused after…

State-invalidation bug in multi-step protocol (splice negotiation)Stale cryptographic signature not cleared on disconnectPotential reuse of old commitment state after reconnect
c9a77251by Matt Corallo+22−12 files
No security note in commit
Moderate 58 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Drop stale splice signature on disconnect

This fix prevents a Lightning channel from being accidentally force-closed. During a splice (a way to resize a payment channel), one side's initial signature could be kept in memory after the peers disconnected. If the peers later reconnec…

State inconsistency: in-memory buffered message not cleared on disconnectDuplicate message processing after reconnectionForce-close consequence for active Lightning channel
71405b4bby Wilmer Paulino+22−12 files
Vendor flagged security relevance
Informational 20 AI analysisMessage 81 · Strong
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

Merge PR 'offers: rename matches_invoice_signing_pubkey to key_can_sign_invoice' (#4942)

This commit is a simple rename of a public function from `matches_invoice_signing_pubkey` to `key_can_sign_invoice`, plus matching updates to its documentation, callers, tests, and changelog. No behavior changed. It is not a security fix.

a476cf92by Matt Corallo+13−133 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
LDK Lightning Dev Kitrust-lightning BitcoinCryptographic librariesLightning Network

offers: rename matches_invoice_signing_pubkey to key_can_sign_invoice

This commit is a simple rename of a function and its documentation from matches_invoice_signing_pubkey to key_can_sign_invoice. No logic, behavior, or security properties changed. It is a follow-up code-review naming cleanup.

388187caby Vincenzo Palazzo+13−133 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-priorityln/refactor: add blinded forwarding failure helper functionby Carla Kirk-Cohen · 4954de51 · Mar 9, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Carla Kirk-Cohen

ln/refactor: add blinded forwarding failure helper function

We'll want this extracted when we need to handle trampoline and regular
forwards.

Co-authored-by: Arik Sosman <git@arik.io>
Co-authored-by: Maurice Poirrier <mpch@hey.com>

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

This commit is a pure code cleanup: it extracts existing HTLC failure-handling logic into a new helper function and a small closure, with no functional changes. There is no security fix or behavior change visible in the diff.

Lower-priorityln: add trampoline routing payment claimingby Carla Kirk-Cohen · e25d97ce · Mar 9, 2026 · 1 fileMessage 80 · StrongLow 29Details
Commit message · Carla Kirk-Cohen

ln: add trampoline routing payment claiming

Implement payment claiming for `HTLCSource::TrampolineForward` by
iterating through previous hop data and claiming funds for each
HTLC. Similar to regular forwards, we need to block the outbound
channel's RAA on the inbound monitor persisting preimages received.
If we have multiple inbound HTLCs for trampoline, we'll add multiple
blockers so that we don't proceed until each inbound HTLC is claimable.

Co-authored-by: Arik Sosman <git@arik.io>
Co-authored-by: Maurice Poirrier <mpch@hey.com>

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

This commit finishes a previously unimplemented code path for 'trampoline routing' in the Lightning Dev Kit. Before this change, if a payment arrived via a trampoline forward, the software had a placeholder 'todo!()' where it should claim the funds. The commit adds the actual claiming logic, including safety checks that prevent the next channel step from proceeding until the incoming payment proof is durably saved. It is a feature-completion patch with defensive safety logic, not a fix for a known active vulnerability.

Lower-priorityln/refactor: pass closure to create PaymentForwarded eventby Carla Kirk-Cohen · 077aa088 · Mar 9, 2026 · 1 fileMessage 85 · StrongInformational 16Details
Commit message · Carla Kirk-Cohen

ln/refactor: pass closure to create PaymentForwarded event

When we introduce trampoline forwards, we're going to want to provide
two external pieces of information to create events:
- When to emit an event: we only want to emit one trampoline event, even
when we have multiple incoming htlcs. We need to make multiple calls
to claim_funds_from_htlc_forward_hop to claim each individual htlc,
which are not aware of each other, so we rely on the caller's closure
to decide when to emit Some or None.
- Forwarding fees: we will not be able to calculate the total fee for
a trampoline forward when an individual outgoing htlcs is fulfilled,
because there may be other outgoing htlcs that are not accounted for
(we only get the htlc_claim_value_msat for the single htlc that was
just fulfilled). In future, we'll be able to provide the total fee
from the channelmanager's top level view.

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

This commit is a code cleanup (refactor) inside the Lightning Dev Kit's channel manager. It moves the creation of a 'PaymentForwarded' event out of an internal helper function and into the caller by passing a closure. The actual logic for normal forwards is preserved unchanged; the change is preparing the code for future 'trampoline' forwarding support. There is no indication this fixes a security bug or introduces a vulnerability.

Lower-priorityln/refactor: add claim funds for htlc forward helperby Carla Kirk-Cohen · f70e6525 · Mar 9, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Carla Kirk-Cohen

ln/refactor: add claim funds for htlc forward helper

Will need to share this code when we add trampoline forwarding. This
commit exactly moves the logic as-is, in preparation for the next
commit that will update to suit trampoline.

Co-authored-by: Arik Sosman <git@arik.io>
Co-authored-by: Maurice Poirrier <mpch@hey.com>

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

This commit is a pure code reorganization (refactor) in the Lightning Dev Kit's channel manager. It extracts existing HTLC forwarding claim logic into a new helper function so the same code can be reused for an upcoming 'trampoline forwarding' feature. No behavior changes, bug fixes, or security-sensitive modifications are present in the diff.

Lower-priorityln: add failure_type helper to HTLCSource for HTLCHandlingFailureTypeby Carla Kirk-Cohen · bde040b1 · Mar 9, 2026 · 1 fileMessage 85 · StrongInformational 20Details
Commit message · Carla Kirk-Cohen

ln: add failure_type helper to HTLCSource for HTLCHandlingFailureType

To create the right handling type based on source, add a helper. This
is mainly useful for PreviousHopData/TrampolineForward. This helper
maps an OutboundRoute to a HTLCHandlingFailureType::Forward. This value
isn't actually used once we reach `forward_htlc_backwards_internal`,
because we don't emit `HTLCHandlingFailed` events for our own payments.
This issue is pre-existing, and could be addressed with an API change
to the failure function, which is left out of scope of this work.

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

This commit is a small internal cleanup in a Lightning Network library. It adds a helper method so the code can pick the correct failure classification (regular forward vs. trampoline forward) based on where an HTLC came from, instead of always assuming a regular forward. The commit message explicitly says the wrong value for the node’s own outbound payments was already not used, so this is mostly preparatory/refactoring work rather than a fix for an active security bug.

Lower-priorityln: add TrampolineForward variant to HTLCSource enumby Maurice · 028b6370 · Mar 9, 2026 · 3 filesMessage 73 · AdequateLow 26Details
Commit message · Maurice

ln: add TrampolineForward variant to HTLCSource enum

We only have payment details for HTLCSource::TrampolineForward available
once we've dispatched the payment. If we get to the stage where we need
a HTLCId for the outbound payment, we expect dispatch details to be
present.

Co-authored-by: Arik Sosman <git@arik.io>
Co-authored-by: Maurice Poirrier <mpch@hey.com>

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

This commit adds a new internal bookkeeping variant called TrampolineForward to LDK's HTLCSource enum, which tracks Lightning payments being forwarded through a trampoline routing node. It also adds placeholder 'todo!()' stubs in several code paths that are not yet implemented for this new variant. The commit is part of ongoing trampoline-payment feature work and does not by itself fix a known security bug. The unimplemented stubs could, in theory, cause a panic if a trampoline forward reaches those code paths, but the commit message and diff treat this as expected incomplete functionality rather than a disclosed vulnerability.

Lower-priorityln: add TrampolineForward SendHTLCId variantby Carla Kirk-Cohen · 7bda2afb · Mar 9, 2026 · 1 fileMessage 68 · AdequateInformational 18Details
Commit message · Carla Kirk-Cohen

ln: add TrampolineForward SendHTLCId variant

This commit adds a SendHTLCId for trampoline forwards, identified by
their session_priv. As with an OutboundRoute, we can expect our HTLC
to be uniquely identified by a randomly generated session_priv.

TrampolineForward could also be identified by the set of all previous
outbound scid/htlc id pairs that represent its incoming HTLC(s). We
choose the 32 byte session_priv to fix the size of this identifier
rather than 16 byte scid/id pairs that will grow with the number of
incoming htlcs.

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

This commit adds a new internal identifier type for tracking forwarded Lightning payments that use Trampoline routing. It is a small, structural code change that does not appear to fix or introduce a security vulnerability on its own. It simply lets the software distinguish Trampoline forwards from other kinds of payment routes when recording which HTLCs were sent.

Lower-priorityevents: add TrampolineForward variant to HTLCHandlingFailureTypeby Carla Kirk-Cohen · ec5168b1 · Mar 9, 2026 · 1 fileMessage 50 · ThinInformational 17Details
Commit message · Carla Kirk-Cohen

events: add TrampolineForward variant to HTLCHandlingFailureType

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

This commit adds a new event variant so the software can report when it fails to forward a special kind of Lightning payment called a 'trampoline' payment. It is purely an observability/logging change and does not alter how payments are handled, accepted, or rejected. There is no indication it fixes a security bug.

Lower-priorityln+events: allow multiple prev_channel_id in HTLCHandlingFailedby Carla Kirk-Cohen · c7e0a536 · Mar 9, 2026 · 4 filesMessage 73 · AdequateInformational 18Details
Commit message · Carla Kirk-Cohen

ln+events: allow multiple prev_channel_id in HTLCHandlingFailed

In preparation for trampoline failures, allow multiple previous channel
ids. We'll only emit a single HTLCHandlingFailed for all of our failed
back HTLCs, so we want to be able to express all of them in one event.

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 straightforward internal API and data-format change in the Lightning Dev Kit. It changes one field in an event from holding a single channel identifier to holding a list of channel identifiers, so that future trampoline-routing failures can report all related channels at once. It also adds backward-compatible serialization logic so older versions can still read the new event format. There is no indication this fixes an active security bug; it is preparatory refactoring.

Lower-priorityln/refactor: rename FreeOtherChannelImmediately to FreeDuplicateClaimImmediatelyby Carla Kirk-Cohen · c26e451b · Mar 9, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Carla Kirk-Cohen

ln/refactor: rename FreeOtherChannelImmediately to FreeDuplicateClaimImmediately

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 simple rename of an internal code label from FreeOtherChannelImmediately to FreeDuplicateClaimImmediately, plus matching comment updates. It does not change program behavior, fix a bug, or alter any security logic.

Lower-priorityln: make channel required in `MonitorUpdateCompletionAction`by Carla Kirk-Cohen · 103686d0 · Mar 9, 2026 · 1 fileMessage 73 · AdequateLow 27Details
Commit message · Carla Kirk-Cohen

ln: make channel required in `MonitorUpdateCompletionAction`

`downstream_counterparty_and_funding_outpoint` was added to LDK in
0.0.116. We do not allow direct upgrades with pending forwards to 0.1
from 0.0.123 and below, so we can now assume that this field will
always be present.

This change also makes it impossible to create a
`EmitEventOptionAndFreeOtherChannel` action with nothing in it (no
event or channel), which could have been possible now that we've made
the event optional).

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

This commit tightens an internal data structure in the Lightning Dev Kit so that a channel identifier is always required when releasing a blocked channel after a monitor update. Previously the channel field was optional, which could have allowed creating an action that neither emitted an event nor freed a channel—an empty no-op. The change removes that possibility and updates serialization to treat the field as required, reflecting that older versions without it are no longer supported for direct upgrades.

Lower-priorityln/refactor: rename EmitEventAndFreeOtherChannel to note optional eventby Carla Kirk-Cohen · 631cf882 · Mar 9, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Carla Kirk-Cohen

ln/refactor: rename EmitEventAndFreeOtherChannel to note optional event

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 simple code cleanup: it renames an internal enum variant from EmitEventAndFreeOtherChannel to EmitEventOptionAndFreeOtherChannel to better reflect that the event field is optional. No behavior changes, no security fixes, and no bug fixes are present.

Lower-priorityln: make event optional in EmitEventAndFreeOtherChannelby Carla Kirk-Cohen · dd15359d · Mar 9, 2026 · 2 filesMessage 85 · StrongInformational 24Details
Commit message · Carla Kirk-Cohen

ln: make event optional in EmitEventAndFreeOtherChannel

In the commits that follow, we want to be able to free the other
channel without emitting an event so that we can emit a single event
for trampoline payments with multiple incoming HTLCs. We still want
to go through the full claim flow for each incoming HTLC (and persist
the EmitEventAndFreeOtherChannel event to be picked up on restart), but
do not want multiple events for the same trampoline forward.

Changing from upgradable_required to upgradable_option is forwards
compatible - old versions of the software will always have written this
field, newer versions don't require it to be there but will be able to
read it as-is.

This change is not backwards compatible, because older versions of the
software will expect the field to be present but newer versions may not
write it. An alternative would be to add a new event type, but that
would need to have an even TLV (because the event must be understood
and processed on restart to claim the incoming HTLC), so that option
isn't backwards compatible either.

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

This commit changes how Lightning Dev Kit stores an internal event record when a payment is forwarded, specifically for an upcoming feature called trampoline payments. It makes one field optional so that future code can avoid emitting duplicate events when multiple incoming payments are part of the same trampoline forward. The change is forward-compatible but not backward-compatible: older versions of LDK will expect the field to always be present, so downgrading while trampoline forwards are in progress is not supported. There is no direct security vulnerability in this patch; it is a data-format change to enable a future feature.

Security candidateln/events: multiple htlcs in/out for trampoline PaymentForwardedby Carla Kirk-Cohen · 607abaff · Mar 9, 2026 · 7 filesMessage 50 · ThinInformational 19Details
Commit message · Carla Kirk-Cohen

ln/events: multiple htlcs in/out for trampoline PaymentForwarded

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
boot or update path
AI analysis · Informational 19/100

This commit is a routine API refactor in the Lightning Dev Kit. It changes how a 'payment forwarded' event reports the incoming and outgoing payment channels, grouping them into lists so that future 'trampoline' routing can report multiple parts. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a feature/structural improvement.

Lower-prioritySmall tweaks to CLAUDE.mdby Matt Corallo · 5574dbef · Mar 9, 2026 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · Matt Corallo

Small tweaks to CLAUDE.md

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit only edits a project documentation file (CLAUDE.md) that gives coding guidelines for AI assistants. It changes wording about when to run code formatting and adds a guideline about writing self-contained comments. No program code, build scripts, tests, or security-relevant configuration were modified.

Lower-priorityFix spurious `debug_assert` in UTXO gossip dedup checkby Elias Rohrer · 40bc82cf · Mar 6, 2026 · 1 fileMessage 85 · StrongLow 25Details
Commit message · Elias Rohrer

Fix spurious `debug_assert` in UTXO gossip dedup check

`check_replace_previous_entry` hit `debug_assert!(false)` when
`channel_announce` was `None` on a still-live `UtxoMessages`. The
comment claimed this was unreachable because `channel_announce` is set
under the same lock as the channel map entry. However, there is a
legitimate race:

1. A channel announcement arrives, an async UTXO lookup starts, and
`pending_channels[scid]` is set with a `Weak` to the
`UtxoMessages`.
2. The lookup resolves. `resolve_single_future` takes both
`channel_announce` and `complete` via `.take()`, but the
`Arc<Mutex<UtxoMessages>>` is still alive on the stack of
`check_resolved_futures`.
3. A duplicate announcement for the same SCID arrives during this
window. `check_replace_previous_entry` upgrades the `Weak`,
finds `channel_announce` is `None`, and hits the assert.

Replace the unconditional `debug_assert!(false)` with a targeted check
that `complete` has also been taken (confirming the future resolved),
which would catch a genuinely unexpected state where
`channel_announce` is `None` but `complete` is still pending.

Co-Authored-By: HAL 9000

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

This commit fixes a harmless but incorrect internal sanity check (a debug-only assertion) in the Lightning Dev Kit's code that handles duplicate routing announcements. The assertion could fire in a legitimate race condition even though nothing was wrong. The fix replaces the overly broad assertion with a more precise one that only complains if the program state is genuinely inconsistent. It is not a security vulnerability and cannot be exploited by an attacker.

Lower-priorityRefactor complete_interactive_funding_negotiation_for_bothby Jeffrey Czyz · 6c100549 · Mar 4, 2026 · 1 fileMessage 53 · ThinInformational 14Details
Commit message · Jeffrey Czyz

Refactor complete_interactive_funding_negotiation_for_both

Use a single get_and_clear_pending_msg_events() + match pattern for the
initiator's turn, matching the existing acceptor code path. Also add
assertions that all expected initiator inputs and outputs were sent.

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

53/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Provides detailed explanatory context! Too few words to establish purpose
AI analysis · Informational 14/100

This commit is a test-only refactor. It rewrites a helper function in the splicing test suite to use a cleaner match statement and adds assertions that expected test inputs/outputs were actually sent. It does not change production code, cryptographic logic, network handling, or any behavior that could affect real users' funds or node security.

Security candidateContribute to splice as acceptorby Jeffrey Czyz · d964be91 · Mar 4, 2026 · 3 filesMessage 68 · AdequateLow 33Details
Commit message · Jeffrey Czyz

Contribute to splice as acceptor

When both nodes want to splice simultaneously, the quiescence
tie-breaker designates one as the initiator. Previously, the losing
node responded with zero contribution, requiring a second full splice
session after the first splice locked. This is wasteful, especially for
often-offline nodes that may connect and immediately want to splice.

Instead, the losing node contributes to the winner's splice as the
acceptor, merging both contributions into a single splice transaction.
Since the FundingContribution was originally built with initiator fees
(which include common fields and shared input/output weight), the fee is
adjusted to the acceptor rate before contributing, with the surplus
returned to the change output.

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

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundary
AI analysis · Low 33/100

This commit changes how the Lightning Dev Kit handles a rare situation where both sides of a channel try to splice funds at the same time. Previously, the node that lost the tie-breaker would sit out and start a second splice later. Now, the loser contributes its funds to the winner's splice as an 'acceptor,' combining both into one transaction. The change also adjusts fees and change outputs when the winner's chosen fee rate differs from what the loser expected. This is a protocol optimization, not a clear security fix, but it touches fee accounting and transaction construction, which are sensitive areas.

Security candidateAdjust FundingContribution for acceptorby Jeffrey Czyz · 7942c745 · Mar 4, 2026 · 6 filesMessage 58 · ThinLow 44Details
Commit message · Jeffrey Czyz

Adjust FundingContribution for acceptor

When constructing a FundingContribution, it's always assumed the
estimated_fee is for when used as the initiator, who pays for the common
fields and shared inputs / outputs. However, when the contribution is
used as the acceptor, we'd be overpaying fees.

Additionally, the initiator's chosen fee rate may not be compatible with
the acceptors contributions. The selected UTXOs may not be enough to pay
for a higher feerate (i.e., the change output is not enough to pay or
there is no change output).

This change provides a method on FundingContribution for adjusting the
fee rate with the above concerns in mind. It also updates it to include
a max_feerate specified by the user when initiating a splice. This
ensures the acceptor isn't forced to pay an overly high fee rate.

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

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

This commit fixes a fee-calculation bug in Lightning splicing. Previously, when both sides tried to splice at the same time, the loser of a tie-break (the 'acceptor') built their contribution as if they were going to pay for the whole shared transaction. That made them overpay fees, and a high fee rate chosen by the other side could drain more from their wallet than intended or even make the transaction invalid. The patch adds logic to re-estimate fees from the acceptor's perspective and lets users set a maximum fee rate they are willing to accept.

Security candidateInclude change output weight in estimate_transaction_feeby Jeffrey Czyz · d9327ba9 · Mar 4, 2026 · 2 filesMessage 73 · AdequateLow 37Details
Commit message · Jeffrey Czyz

Include change output weight in estimate_transaction_fee

Add a `change_output: Option<&TxOut>` parameter to
`estimate_transaction_fee` so the initial fee estimate accounts for the
change output's weight. Previously, the change output weight was omitted
from `estimated_fee` in `FundingContribution`, causing the estimate to
be slightly too low when a change output was present.

This also eliminates an unnecessary `Vec<TxOut>` allocation in
`compute_feerate_adjustment`, which previously cloned outputs into a
temporary Vec just to include the change output for the fee estimate.

A mock `TightBudgetWallet` is added to `splicing_tests` to demonstrate
that `validate()` correctly rejects contributions where the input value
is sufficient without the change output weight but insufficient with it.

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

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

This commit fixes a fee-estimation bug in rust-lightning's channel funding and splicing code. When building a transaction that creates a change output, the code previously forgot to include the change output's size/weight when estimating the required transaction fee. That made the fee estimate slightly too low. The patch adds the missing weight and adds a test showing that a contribution with barely enough money would now be correctly rejected, whereas before it might have been accepted and later failed to broadcast or confirm reliably.

Security candidateStop persisting QuiescentAction and remove legacy codeby Jeffrey Czyz · 3e9dff9c · Mar 4, 2026 · 5 filesMessage 73 · AdequateLow 35Details
Commit message · Jeffrey Czyz

Stop persisting QuiescentAction and remove legacy code

Now that the Splice variant (containing non-serializable
FundingContribution) is the only variant produced, and the previous
commit consumes the acceptor's quiescent_action in splice_init(),
there is no longer a need to persist it. This allows removing
LegacySplice, SpliceInstructions, ChangeStrategy, and related code
paths including calculate_change_output, calculate_change_output_value,
and the legacy send_splice_init method.

With ChangeStrategy removed, the only remaining path in
calculate_change_output was FromCoinSelection which always returned
Ok(None), making it dead code. The into_interactive_tx_constructor
method is simplified accordingly, and the signer_provider parameter
is removed from it and from splice_init/splice_ack since it was only
needed for the removed change output calculation.

On deserialization, quiescent_action (TLV 65) is still read for
backwards compatibility but discarded, and the awaiting_quiescence
channel state flag is cleared since it cannot be acted upon without
a quiescent_action.

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

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

This commit removes old, no-longer-used code paths for splicing (a way to resize a Lightning channel). It stops saving a 'quiescent action' to disk because the only remaining variant cannot be serialized, and it drops legacy change-output calculation logic. On loading old data, the stored action is read and then discarded, and the 'awaiting quiescence' flag is cleared so the node does not get stuck waiting for something it can no longer act upon. The change is mostly cleanup and hardening against stale persisted state.

Lower-prioritySplit InteractiveTxConstructor::new into outbound/inbound variantsby Jeffrey Czyz · 77ce89bb · Mar 4, 2026 · 2 filesMessage 73 · AdequateLow 26Details
Commit message · Jeffrey Czyz

Split InteractiveTxConstructor::new into outbound/inbound variants

Replace the single public InteractiveTxConstructor::new() with separate
new_for_outbound() and new_for_inbound() constructors. This moves the
initiator's first message preparation out of the core constructor,
making it infallible and removing is_initiator from the args struct.

Callers no longer need to handle constructor errors, which avoids having
to generate SpliceFailed/DiscardFunding events after the QuiescentAction
has already been consumed during splice_init/splice_ack handling.

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

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

This commit refactors how an internal transaction-construction object is created in the Lightning Dev Kit. It splits one constructor into two separate ones for the party that starts the process versus the party that responds. The main practical effect is that callers no longer have to handle an error right after they have already committed to starting a splice, which avoids a tricky cleanup situation where they might otherwise have to emit a failure event after consuming internal state. It is a defensive code-quality change rather than a fix for a known active exploit.

Lower-prioritySkip non-key entries in list_paginatedby benthecarman · 1545ad54 · Mar 2, 2026 · 2 filesMessage 78 · AdequateLow 37Details
Commit message · benthecarman

Skip non-key entries in list_paginated

Use dir_entry_is_key in list_paginated_impl to skip .tmp files,
directories, and other non-key entries, to be the same as list_impl.

Claude added a test for this as well.

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

This commit fixes a consistency bug in a file-based storage component used by Lightning Dev Kit. A paginated listing function was including temporary files and stray directories as if they were real data keys, which could confuse callers, leak internal filenames, or cause errors when reading back data. The fix makes the paginated listing skip the same non-key entries that the non-paginated listing already skipped.

Lower-priorityClarify CLTV expiry delta for trampolines furtherby Matt Corallo · 4221afd2 · Feb 26, 2026 · 1 fileMessage 45 · ThinInformational 11Details
Commit message · Matt Corallo

Clarify CLTV expiry delta for trampolines further

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

This commit only updates documentation comments and tightens an internal consistency check for a special routing feature (Trampoline payments). It does not change any security-sensitive behavior or fix a vulnerability. The change makes the code's internal assertion stricter (requiring exact equality rather than 'not greater than') when trampoline hops are present, but this is a correctness/clarity improvement, not a security fix.

Lower-priorityUse the new `total_cltv_expiry_delta()` in place of explicit sumby Matt Corallo · 12eb3b6c · Feb 26, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Matt Corallo

Use the new `total_cltv_expiry_delta()` in place of explicit sum

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

This is a tiny internal code cleanup: it replaces a manual loop that adds up CLTV expiry deltas with a new helper method that does the same thing. There is no functional change and no security relevance visible in the commit.