Skip to content

Contribute funding inputs on accepting dual-funded channel #3735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dunxen
Copy link
Contributor

@dunxen dunxen commented Apr 15, 2025

Very WIP with upcoming commits.

Based on #3637.

dunxen added 2 commits April 11, 2025 13:09
Instead of having an explicit `ChannelContext::next_funding_txid` to set
and read, we can get this value on the fly when it is appropriate to do
so.
This follows the the specification closely in branching without being
too verbose, so that it should be easy to follow the logic.

See: https://github.com/lightning/bolts/blob/aa5207a/02-peer-protocol.md?plain=1#L2520-L2531
@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

dunxen added 5 commits April 16, 2025 15:17
This intoduces the INTERACTIVE_SIGNING, THEIR_TX_SIGNATURES_SENT, and
OUR_TX_SIGNATURES_SENT funded state flags.

A top-level state flag for INTERACTIVE_SIGNING was avoided so that this
work is compatible with splicing as well as V2 channel establishment
(dual-funding).

This commit also ensures that `ChannelPending` is only emitted after
peers exchange `tx_signatures`.
We fully persist `InteractiveTxSigningSession` as it provides the full
context of the constructed transaction which is still needed for signing.
When this config field is enabled, the dual_fund feature bit will be
set which determines support when receiving `open_channel2` messages.
The `FundingTransactionReadyForSignatures` event requests witnesses
from the client for their contributed inputs to an interactively
constructed transaction.

The client calls `ChannelManager::funding_transaction_signed` to provide
the witnesses to LDK.
@dunxen dunxen force-pushed the 2025-04-contributeinputs branch from e22fa33 to fabbf86 Compare April 25, 2025 18:20
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