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

lightningd: use a splice's HTLC sigs once we move onto its commitment

Public commit record

What the developer wrote

Authored by jaonoctus

85/100 · Strong
lightningd: use a splice's HTLC sigs once we move onto its commitment

update_channel_from_inflight() moves channel->last_tx onto a splice's
commitment, both when the splice locks and when we adopt a splice which
confirmed before splice_locked because its output got spent. But
channel->last_htlc_sigs stayed the peer's signatures for the pre-splice
commitment until the next commitment update, or a restart, replaced them.

If that commitment is the one we close with first, onchaind gets
signatures which can't spend its HTLC outputs, so our HTLC-timeout
transactions are invalid and we can't get those HTLCs back. That's the
case in a report of a lost balance after a close on an unlocked splice:

the close broadcasts our inflight commitment (it spends the splice
funding output, because the splice had confirmed but never locked
in)
lightningd still treats the pre-splice output as the channel
funding, so onchaind is started with the pre-splice funding,
balance, and commitment

The sigs go with the commitment, so switch them in the same place:
wallet_htlcsigs_confirm_inflight() now returns the sigs it makes current,
and update_channel_from_inflight() calls it for a splice instead of
handle_peer_splice_locked() doing so on the side.

Reported-by: Ken Sedgwick <ken@bonsai.com>
Changelog-Fixed: splicing: closing with a splice's commitment before any later commitment update can now time out or claim the HTLCs on it.
Co-Authored-By: Ken Sedgwick <ken@bonsai.com>

(cherry picked from commit 275086a9b8eb36abe0dbb7499d7e5425a77e32ed)
✓ 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 fix repairs a bug in Core Lightning's splicing feature. When a channel was moved onto a new 'splice' commitment transaction, the old HTLC (multi-hop payment) signatures were still being used. If the channel later closed using that new splice commitment, the stored signatures could not actually spend the HTLC outputs, meaning the node could lose money it was owed. The patch makes sure the correct HTLC signatures are kept and used whenever the channel switches to a splice commitment.

Recommended action

Apply the patch and ensure nodes running splicing are upgraded. Operators who performed splices that confirmed but did not lock, and then closed the channel, should review on-chain history for any HTLC outputs that may have become unclaimable and consider manual recovery if possible.

Security signals we found

01

Loss of funds via invalid HTLC-timeout transactions after a splice close

02

Mismatched commitment transaction and HTLC signature state

03

State inconsistency between channel->last_tx and channel->last_htlc_sigs

04

Fix moves signature activation into the same code path that activates the commitment

Risk score

Why this scored 68/100

Our methodology →
Potential impact 24/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.