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

Update next_funding_txid logic for channel_reestablish

Public commit record

What the developer wrote

Authored by Jeffrey Czyz

85/100 · Strong
Update next_funding_txid logic for channel_reestablish

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

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

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

This commit updates FundedChannel::channel_reestablish accordingly.

Co-authored-by: Wilmer Paulino <wilmer@wilmerpaulino.com>
Co-authored-by: Jeffrey Czyz <jkczyz@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

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

Recommended action

Treat as a normal protocol-conformance update. Reviewers should verify that the new `NextFunding` serialization/deserialization is backward-compatible or gated appropriately, that the `retransmit_flags` bitfield cannot be abused to force unwanted retransmissions, and that the moved `AwaitingChannelReady` branch does not bypass any existing commitment-number checks. No emergency action is indicated by the supplied materials.

Security signals we found

01

Protocol state machine change for channel reestablishment during interactive (splicing) funding

02

Replacement of txid-only field with txid + retransmit flag structure

03

New `NextFunding` message type and `NextFundingFlag` enum added

04

Reordering of reestablish response handling to cover `AwaitingChannelReady` state

05

More consistent propagation of `tx_abort` instead of silently dropping mismatched funding state

06

No explicit CVE, security advisory, or bug report referenced in commit or materials

Risk score

Why this scored 43/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/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.