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

Splicing robustness improvements (#3417)

Public commit record

What the developer wrote

Authored by pm47

88/100 · Strong
Splicing robustness improvements (#3417)

Make splicing more robust when splice transactions don't confirm:

- add `require-confirmed-inputs-for-splicing` (enabled by default): splices only spend confirmed transactions, and we limit the number of inputs and outputs our peer can add
- when force-closing, use a commitment whose funding transaction is known by our bitcoind, and re-evaluate it when blocks are found or splice transactions are published
- when CPFP-ing our commit tx, take its unconfirmed funding transaction into account
- claim the outputs of a previous remote commitment as soon as it confirms
- warn against using `zero_fee_commitments` when splicing with untrusted peers

Note that `require-confirmed-inputs-for-dual-funding` doesn't apply to splices anymore.

* Add tests for splices with unconfirmed parents

We add a `require-confirmed-inputs-for-splicing` setting (not used yet)
and tests showing that we should:
- require our peer's splice inputs to be confirmed
- not splice on top of an unconfirmed splice transaction
- limit the number of inputs and outputs our peer adds to a splice

* Only splice with confirmed parents

When `require-confirmed-inputs-for-splicing` is set (the default), we
now require our peer to only use confirmed inputs in splices, and we
don't initiate a splice on top of an unconfirmed splice transaction (our
peer already cannot). We also limit the number of inputs and outputs our
peer can add to a splice transaction to 10.

Note that `require-confirmed-inputs-for-dual-funding` doesn't apply to
splices anymore, only to channel creation.

* Require confirmed splice inputs in tests

We use the default value of `require-confirmed-inputs-for-splicing` in
tests. Our test wallet now considers the inputs it uses to fund
transactions confirmed (this can be disabled to test unconfirmed inputs),
and shares them with other test wallets so that our peer can verify them.

Tests that splice on top of unconfirmed splices now explicitly disable
it: those scenarios can still happen with zero-conf, so we keep testing
them.

* Add tests for force-close with unconfirmed splices

We add tests for the commitment we use when force-closing while splice
transactions are unconfirmed. Our test wallet now considers the
transactions it has published to be in its mempool.

* Force-close with a commitment whose funding tx can confirm

When force-closing while splice transactions are unconfirmed (without
zero-conf), we now use the most recent commitment whose funding tx is
known by our bitcoind (in its mempool or confirmed), or the most recent
confirmed commitment otherwise. We re-evaluate it at every block and
when a splice transaction spends a funding output, and force-close again
using a different commitment if needed.

* Add test for anchor CPFP with an unconfirmed funding tx

When our commit tx spends an unconfirmed funding transaction, our anchor
tx should also pay for that funding transaction to reach our target
feerate.

* Pay for unconfirmed funding tx when CPFP-ing commit tx

Miners evaluate our anchor tx with all of its unconfirmed ancestors.
When our commit tx spends an unconfirmed funding transaction (with
zero-conf or splices), we now include the fees and weight of its
unconfirmed ancestors when computing the fees our anchor tx must pay.

* Warn against zero_fee_commitments with splicing

With zero_fee_commitments, our commit tx is a v3 transaction, which
cannot spend an unconfirmed v2 transaction such as a splice transaction
(TRUC rules), so we cannot CPFP it. We document that this feature should
not be used when splicing with untrusted peers.

* Add test for claiming htlcs of a previous remote commit

When our peer publishes its commit tx for a previous commitment, we
should claim its outputs as soon as it confirms.

Existing tests that confirm a previous commit tx now use a height that
is deep enough to directly test the min-depth handling.

* Claim previous remote commit outputs as soon as it confirms

When our peer publishes its commit tx for a previous commitment, we
waited for min-depth before claiming its outputs. We now claim them as
soon as it confirms, without forgetting our other commitments, which we
only reset once it is deeply confirmed. We don't do it for revoked
commit txs, whose outputs are delayed.

* Add test for published stale local commit tx

When we switch to a different commitment while force-closing (because
the funding tx of our commit tx left our mempool), the commit tx we
previously published may still confirm, since miners may still have it
along with its parent splice transaction. We must then claim its outputs
instead of treating it as a remote commit tx.

* Handle our stale local commit tx in CLOSING

When force-closing, we may switch to a different commitment if the
funding tx of our commit tx isn't known by our bitcoind anymore. The
commit tx we previously published may still confirm though: we now
recognize it as one of our local commit txs and force-close again with
its commitment, instead of handling it as a remote commit tx, which
would lead to ERR_INFORMATION_LEAK or to a bogus revoked commit.


Reported-by: @erickcestari
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Fabrice Drouin <sstone@users.noreply.github.com>
✓ Descriptive subject✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit hardens Eclair's Lightning channel 'splicing' feature against a malicious peer. Splicing lets users resize a channel by creating a new funding transaction. The patch fixes several ways an attacker could exploit unconfirmed splice transactions: by double-spending inputs to make the splice invalid, by adding so many inputs/outputs that the honest node can't afford to speed it up (CPFP), or by publishing an old commitment while a splice is stuck. The changes add a new default-on setting that requires splice inputs to be confirmed, limit how many inputs/outputs a peer can add, make force-closing pick a commitment whose funding transaction is actually known to the node's own Bitcoin Core, include unconfirmed ancestors when paying to speed up a commitment, and claim outputs from an old remote commitment as soon as it confirms. The commit message explicitly warns that using zero-fee commitments with splicing and untrusted peers can lead to loss of funds.

Recommended action

Review and merge promptly; this is a defensive hardening patch for a known high-risk area. Operators should ensure `require-confirmed-inputs-for-splicing` remains enabled and should avoid enabling `zero_fee_commitments` when splicing with untrusted peers, as documented. After deployment, monitor for any force-close edge cases involving unconfirmed splices.

Security signals we found

01

New default-on configuration `require-confirmed-inputs-for-splicing` to prevent double-spend of unconfirmed splice inputs

02

Limit on remote splice inputs/outputs (10) to bound CPFP cost

03

Force-close now selects a commitment whose funding tx is known to bitcoind, re-evaluated per block and splice spend events

04

CPFP anchor funding now includes unconfirmed ancestor weight/fees

05

Previous remote commitment outputs claimed at depth 1 instead of waiting for min-depth

06

Stale local commit tx recognized as local after commitment switch, avoiding information-leak / revoked-commit misclassification

07

Explicit documentation of fund-loss risk when combining `zero_fee_commitments` with splicing and untrusted peers

Risk score

Why this scored 72/100

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