Repository navigation
Dual-funded channels and Splicing Project Tracking #1621
Description
Activity
Thinking through LSP onboarding strategies having the ability to start with a balanced channel is a really nice option. Definitely watching this one 👀
Reacted by dunxen, Max Fang and tonelocI think one of the first step could be to make
OnchainTxHandlerits own interface that way the reorg/fee-bumping/rebroadcast logic could be shared between ourChannelMonitorandMultipartyConstructionstuff. See : #606 (comment) for ideas.There is also an open question on how much code for doing that is already available in BDK.
Reacted by dunxenI think one of the first step could be to make
OnchainTxHandlerits own interface that way the reorg/fee-bumping/rebroadcast logic could be shared between ourChannelMonitorandMultipartyConstructionstuff. See : #606 (comment) for ideas.There is also an open question on how much code for doing that is already available in BDK.
Thanks for the comment link! I'll sync up with the BDK peeps on that open question too.
Available to review advances in dual-funded implementation, even if it's early refactor for now. I've reviewed back recently the state of the BOLT proposal and it's sounds to be mature enough to solidify around a v0.1.
Reacted by dunxenAvailable to review advances in dual-funded implementation, even if it's early refactor for now. I've reviewed back recently the state of the BOLT proposal and it's sounds to be mature enough to solidify around a v0.1.
Great, picking up refactor next! 🙏
Available to review advances in dual-funded implementation, even if it's early refactor for now. I've reviewed back recently the state of the BOLT proposal and it's sounds to be mature enough to solidify around a v0.1.
Great, picking up refactor next! pray
Next is now. So picking up from now :)
- changed the title
[-]Support dual-funded channels[/-][+]Dual-funded channels and Splicing Project Tracking[/+]on May 4, 2023 Good to have this, don’t hesitate to “review pin” like glozow doing for package relay: bitcoin/bitcoin#27463 (comment) good practice imho to allocate review bandwidth accordingly.
Reacted by Steve LeeFYI, current version of nversion=3 and package RBF sounds working well for both dual-funding and splicing: bitcoin/bitcoin#25038 (comment)
There is one caveat where the first splicing transaction transitioning from nversion=2 to nversion=3 might have to be signed with a compelling feerate to be able to replace a pinning nversion=2 commitment state. If correct, I think it can be documented when nversion=3 is specified on the bolt-side.
All reserves kept as both package relay / nversion=3 / dual-funding and splicing are still work in progress and non-final.
Hi, what is the status here?
Does LDK support dual-funding, and if it does, how? Thanks.
6 remaining items
Updated splice tasks (in earlier comment)
Reacted by dunxenUpdated splice tasks (in earlier comment)
Thanks! Updated!
I updated the quiescence section based on a discussion with @wpaulino.
Reacted by dunxenUpdated description for Splicing, added table with draft PRs / use case phases, updated PR numbers
Reacted by dunxenUpdate on splicing progress covering work this year. Everything but RBF is needed for the initial release. ETA Q3.
- Quiescence
- Funding negotiation
- Refactoring
- Combine
InboundV2ChannelandOutboundV2Channel#3498 - Refactor
ChannelPhasevariants fromChannelManager#3513 - Encapsulate
Channelenum variants inside a struct #3550 - Refactor
ChannelContextvalue fields intoFundingScope#3592 - Refactor
ChannelTransactionParametersintoFundingScope#3604 - Add missing pending
FundingScopechecks #3811 - Refactor
PendingSplice#3911 - Refactor
ConstructedTransactionto containTransaction#4097
- Combine
- Initiation
- Tx construction
- Dual funding extension: begin_interactive_funding_tx_construction #3443
- Switch PersistenceNotifierGuard persist closure to FnOnce #3835
- Support scalar tweak to rotate holder funding key during splicing #3624
- [Splicing] Tx negotiation during splicing #3736
- Add Shared Input support in interactive TX construction #3842
- Fix initial
commitment_signedfor splicing #4014 - Follow-ups for #4014 #4023
- Support splice shared input signing #4024
- Splice channel state rework #4061
- Refactoring
- Shutdown
- Batched
commitment_signed- Split
commitment_signedhandling by check-accept #3633 - Batch
commitment_signedmessages for splicing #3651 - Remove redundant
ChannelContext::channel_type#3678 - Implement
start_batchmessage batching #3793 - Check if a batch is expected for
commitment_signed#3852 - Ignore
start_batchfor missing or unexpectedmessage_type#3874
- Split
- Funding locking
- On-chain monitoring
- Start tracking ChannelMonitors by channel ID in ChainMonitor and ChannelManager #3554
- Support persisting
ChannelMonitors after splicing #3569 - Require counterparty_node_id TLV for ChannelMonitor #3638
- Introduce FundingScope abstraction to ChannelMonitor #3663
- Replace use of HolderSignedTx with HolderCommitment #3664
- Remove data dependency on OnchainTxHandler from onchain claims #3690
- Separate auxiliary HTLC data from holder commitment transaction #3774
- Introduce splice-compatible commitment update monitor variants #3855
- Introduce RenegotiatedFunding monitor update variant #3822
- Introduce RenegotiatedFundingLocked monitor update variant #3894
- Account for splices in claimable balances #4029
- Broadcast holder commitment for currently confirmed funding #3939
- Closed channel balance API Refactor
ChannelContextvalue fields intoFundingScope#3592 (comment) - Emit DiscardFunding events for double spent splice transactions #4030
- Functional testing
- RBF
- Cap number of RBFs (
commitment_signedbatch only allows for 20 anyway) Introduce FundingScope abstraction to ChannelMonitor #3663 (comment) - Filter out contributed inputs that also exist in previous negotiated-but-not-yet-locked splice attempts (dd2e394#r2370654851)
- Cap number of RBFs (
Misc follow-ups from PR review:
Do we have any tests of initiating a splice while a peer is disconnected, also even better both peers initiating a splice while disconnected? Also I think we never added the logic to initiate a splice/post-quiescent action when we finish the current splice/quiescent action. We should add that.
Hi, is this the correct place to track dual-funding? What is timeline / priority for it with LDK team? Thank you.
Hi, is this the correct place to track dual-funding? What is timeline / priority for it with LDK team? Thank you.
Hi @toneloc,
We should probably make a separate tracker for dual funding. Some of the work overlaps with splicing (#4284). That issue needs to be updated as most work is done. For dual funding, however, there is a partial implementation merged. Currently finishing it is not a high priority, but we'll re-evaluate priorities for the 0.4 release. Are you looking to use it? If so, do you mind sharing your use case?
Last we chatted about this, batching channels open support (available for v1 channel opens) may not be compatible with the dual-funding (v2 channel opens) protocol in its current form. So there may need be some spec work to resolve that.
Reacted by tonelocThanks @jkczyz for the update.
The use-case I have is to open up a balanced channel for Stable Channels in one on-chain transaction. Stable Channels are basically LN channels that can be used for trading use-cases, so money needs to flow both ways based on updated prices.
Currently, the user can onboard to the Stable Channels wallet over Lightning with JIT channels; this is nice because we open a balanced channel from the get-go.
We want the user to also be able to onboard from on-chain. Some users don't have Lightning funds yet. The way we would make this work currently is that the user would send themselves on-chain BTC to the wallet, then open a single-side-funded channel to the LSP, then the LSP would splice in funds to make it balanced.
Not the worst flow, but extra logic and an extra transaction. Dual-funded channels would simplify this flow into one on-chain transaction.
Thanks @jkczyz for the update.
The use-case I have is to open up a balanced channel for Stable Channels in one on-chain transaction. Stable Channels are basically LN channels that can be used for trading use-cases, so money needs to flow both ways based on updated prices.
Currently, the user can onboard to the Stable Channels wallet over Lightning with JIT channels; this is nice because we open a balanced channel from the get-go.
We want the user to also be able to onboard from on-chain. Some users don't have Lightning funds yet. The way we would make this work currently is that the user would send themselves on-chain BTC to the wallet, then open a single-side-funded channel to the LSP, then the LSP would splice in funds to make it balanced.
Not the worst flow, but extra logic and an extra transaction. Dual-funded channels would simplify this flow into one on-chain transaction.
For the dual-funding case, I take it the user would still initiated the channel open, not the LSP?
For the dual-funding case, I take it the user would still initiated the channel open, not the LSP?
Sorry @jkczyz I missed this message. Yes, in this case the user would initiate the dual-fund channel open.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Overview
Project tracking and implementation status of interactive transaction construction, dual-funding (V2 channel establishment), channel quiescence, and splicing.
Specifications:
Wire messages
OptionalFieldand makeDataLossProtectfields mandatory #2253Interactive Transaction Construction
Dual-funding (V2 channel establishment)
0. Refactoring
ChannelintoInbound/Outboundchannels #20771. Accept dual-funded channels
2. Accept dual-funded channels with contributions
3. Create & accept dual-funded channels
4. RBF support
Dual-funding implementation phase feature table
🟢 = supported
🔴 = unsupported
Channel quiescence
Splicing
Draft/Prototype PRs
ChannelContextvia cloning (not for merging). Currently splicing use case works up to exchange oftx_complete's, but notcommitment_signed.ChannelContextduplication. Currently splicing use case works up to the firsttx_complete.Use case phases status
splice_init,splice_acktx_add_input,tx_add_outputtx_complete'stx_signaturesexchange, funding tx broadcastsplice_lockedexchange, after confirmation0. Preparations
splicingcompile feature flag #3294 )funding_transactionfor the later lifecycle of the channel #3317) ([Splicing] Make funding transaction available in funded channel #3300 )1. Basic implementation
2. Additional features