Skip to content

Conversation

@remyers
Copy link
Contributor

@remyers remyers commented Oct 9, 2024

This is an alternative to PR #2903 which does not assume modifying bitcoind to add excess to a selected output during coin selection (see PR 30080).

When funds are added to a dual funded channel, or spliced into an existing channel, our channel should be credited in their channel balance any excess that is added to the channel over what the user requests. Currently if a changeless solution is found for funding, excess value over what was requested will be treated as waste and used as extra fees.

We introduce a new optional funding contributions parameter to InteractiveTxBuilder. When set, we will start by processing the passed in funding inputs/outputs instead of using InteractiveTxFunder to fund the transaction. The call to InteractiveTxFunder is now made before sending open_channel2 or splice_init and the results are then passed to InteractiveTxBuilder.

This PR builds on PR #2887 - Use final spec values for splicing and should be rebased once the final official splicing code is merged.

@remyers
Copy link
Contributor Author

remyers commented Oct 9, 2024

To compute the excess from a changeless set of funding inputs, InteractiveTxFunder currently assumes all inputs are p2wpkh in order to compute their weight for the purpose of computing the actual feerate of the funded transaction. We should computer the exact weight of each input, but I couldn't figure out how that can be done. Any suggestions?

remyers added 2 commits April 7, 2025 11:29
If a changeless set of inputs is found, excess funding (if any) will be added to the proposed `fundingAmount`/`fundingContribution` before sending `open_channel2`/`splice_init` respectively.

InteractiveTxFunder sets `excess_opt` with the input value in excess of what is needed to achieve the requested target feerate.

We assume our peer requires confirmed inputs. In the future we could add a heuristic for this, but it's safer to assume they want confirmed inputs.
Added the `SpliceStatus.SpliceInitiated` state for when `SpliceInit` is received with a valid liquidity request, but the wallet has yet returned funding inputs.
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.

1 participant