Add TLVs required for splicing taproot channels#1324
Draft
t-bast wants to merge 3 commits intolightning:masterfrom
Draft
Add TLVs required for splicing taproot channels#1324t-bast wants to merge 3 commits intolightning:masterfrom
t-bast wants to merge 3 commits intolightning:masterfrom
Conversation
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.
Roasbeef
reviewed
Mar 9, 2026
Collaborator
Roasbeef
left a comment
There was a problem hiding this comment.
Nice to have this follow up!
| 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 |
Collaborator
There was a problem hiding this comment.
Prob too late to also make prevtx a TLV given already deployed?
Collaborator
Author
There was a problem hiding this comment.
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...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We add support for splicing and dual-funding taproot channels. Each commit adds a specific feature that leverages taproot and splicing:
prevtxfield when using taproot: there are caveats because of malleability issues (see https://delvingbitcoin.org/t/malleability-issues-when-creating-shared-transactions-with-segwit-v0/497 for more details)This PR will be moved out of draft after #1160 and #995 are merged.