Skip to content

Add TLVs required for splicing taproot channels#1324

Draft
t-bast wants to merge 3 commits intolightning:masterfrom
t-bast:taproot-splicing
Draft

Add TLVs required for splicing taproot channels#1324
t-bast wants to merge 3 commits intolightning:masterfrom
t-bast:taproot-splicing

Conversation

@t-bast
Copy link
Copy Markdown
Collaborator

@t-bast t-bast commented Mar 5, 2026

We add support for splicing and dual-funding taproot channels. Each commit adds a specific feature that leverages taproot and splicing:

This PR will be moved out of draft after #1160 and #995 are merged.

Splicing allows spending the current funding transaction to replace it
with a new one that changes the capacity of the channel, allowing both
peers to add or remove funds to/from their channel balance.

Splicing takes place while a channel is quiescent, to ensure that both
peers have the same view of the current commitments.

We don't want channels to be unusable while waiting for transactions to
confirm, so channel operation returns to normal once the splice tx has
been signed and we're waiting for it to confirm. The channel can then
be used for payments, as long as those payments are valid for every
pending splice transactions. Splice transactions can be RBF-ed to speed
up confirmation.

Once one of the pending splice transactions confirms and reaches
acceptable depth, peers exchange `splice_locked` to discard the other
pending splice transactions and the previous funding transaction. The
confirmed splice transaction becomes the channel funding transaction.

Nodes then advertize this spliced channel to the network, so that nodes
keep routing payments through it without any downtime.
When sending `tx_add_input`, we previously required transmitting the
entire transaction being spent to prevent malleability issues where
attackers replace a `p2wpkh` input by a `p2pkh` input after signing.

When both participants of the interactive-tx protocol sign a taproot
input, this malleability issue disappears. We thus allow transmitting
only the utxo amount and script in that case. For simplicity, we only
allow this when splicing a taproot channels (where both participants
sign the previous funding output) or when *all* inputs are using
taproot (we could be less strict, but being too smart here may risk
losing funds, so we err on the cautious side).
We add musig2 nonce fields in various `interactive-tx` messages to allow
using taproot channels with dual funding and splicing.
Copy link
Copy Markdown
Collaborator

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have this follow up!

Comment thread 02-peer-protocol.md
transaction
- MUST set `sequence` to be less than or equal to 4294967293 (`0xFFFFFFFD`)
- If the transaction splices an existing taproot channel or only uses taproot inputs:
- MAY omit `prevtx` (and set `prevtx_len` to `0`) and provide the amount and script
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prob too late to also make prevtx a TLV given already deployed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, unfortunately this shipped has sailed, but it's only two bytes wasted so it's probably fine even though it isn't very elegant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants