AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 33 Bitcoin

Write SpliceNegotiationFailed contributions for 0.2

Public commit record

What the developer wrote

Authored by Jeffrey Czyz

93/100 · Strong
Write SpliceNegotiationFailed contributions for 0.2

When downgrading to 0.2 with a splice negotiation pending, the
synthesized `Event::DiscardFunding` containing the contribution is
ignored (see previous commit), leaving a 0.2 user without the set of
UTXOs freed by the abandoned negotiation.

0.2 read those UTXOs from the `contributed_inputs` and
`contributed_outputs` fields of `Event::SpliceFailed`, which it wrote
at TLV types 11 and 13 of event type 52. Write the inputs and outputs
released by the failure there too -- excluding any still committed to
an existing splice attempt -- so a downgraded node surfaces the same
event 0.2 would have written itself.

To that end, the event's `contribution` field is now an
`Option<FailedSpliceContribution>`, which holds the released inputs and
outputs alongside the `FundingContribution` available for retry. The
released inputs and outputs are also read back so that they survive
re-serialization.

Note that this makes a `ChannelManager` written with a splice failure
event pending unreadable by v0.3.0-beta1, which used those TLV types
for other fields.

Completes the fix for #4919.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✓ 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
The short version

What changed, and why it matters

This commit fixes a backward-compatibility bug in the Lightning Dev Kit (LDK) when a user downgrades from a newer version to version 0.2 while a splice negotiation is in progress. Without the fix, the newer version would generate an event telling the wallet to discard freed UTXOs, but version 0.2 could not understand that event, so those coins would appear stuck or lost to the downgraded node. The patch makes the newer version also write the freed UTXOs in the older event format that 0.2 understands, so the downgraded node surfaces the same information. It is a compatibility/data-loss fix, not a remote-exploitable vulnerability.

Recommended action

Reviewers should confirm that TLV type reuse (11/13) does not collide dangerously with other pending serialization paths, that the script-pubkey vs TxOut mapping is applied consistently everywhere FundingInfo::Contribution is built, and that the v0.3.0-beta1 forward-compatibility break is acceptable and documented. No immediate security patch is required; this is a compatibility correctness fix.

Security signals we found

01

Backward-compatibility data-loss fix: freed UTXOs from abandoned splice negotiation were not surfaced to downgraded 0.2 nodes

02

Serialization format change for Event::SpliceNegotiationFailed (event type 52) reuses TLV types 11 and 13 that 0.2 expects

03

New FailedSpliceContribution struct separates released UTXOs from retryable FundingContribution

04

FundingContribution::into_unique_contributions now returns Vec<TxOut> instead of Vec<ScriptBuf>, requiring callers to extract script pubkeys

05

ChannelMonitor now maps contributed outputs to script pubkeys when constructing FundingInfo::Contribution

06

Adds downgrade test `downgrade_mid_splice_negotiation_to_0_2` and unit tests for 0.2 deserialization and round-trip

07

Explicitly breaks readability for v0.3.0-beta1 ChannelManagers with pending splice failure events

Risk score

Why this scored 33/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.