Skip to content

Update splice_in/splice_out to use new LDK two-phase funding API #794

Open
jkczyz wants to merge 1 commit intolightningdevkit:mainfrom
jkczyz:2026-02-splicing-api-change
Open

Update splice_in/splice_out to use new LDK two-phase funding API #794
jkczyz wants to merge 1 commit intolightningdevkit:mainfrom
jkczyz:2026-02-splicing-api-change

Conversation

@jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Feb 18, 2026

The LDK dependency bump introduced a new splicing API that separates negotiation from coin selection, letting LDK handle transaction construction internally rather than requiring manual UTXO selection and change address management.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 18, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Ok(txid)
}

pub(crate) fn select_confirmed_utxos(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tnull I'm wondering if we should implement CoinSelectionSource and use this rather than using LdkWallet for UTXO selection. It would prevent double persistence when we need a change output and the need for an explicit persist method after selection.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that seems preferable, if we have everything we need in the API by now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I think the question may be whether we use our own CoinSelectionSource for anchor bumping, too. It depends on how UTXO locking will work. LdkWallet manages whether or not to try to double-spend based on the claim id, whereas for splicing we may accidentally double spend one of those if using our own CoinSelectionSource. Pushed a fixup commit implementing CoinSelectionSource for splicing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh, well the branch shows the fixup. Not sure why the PR hasn't updated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, I think the question may be whether we use our own CoinSelectionSource for anchor bumping, too.

It would be great to reuse the same codepaths, IMO. That is, if the API now permits for it.

It depends on how UTXO locking will work. LdkWallet manages whether or not to try to double-spend based on the claim id, whereas for splicing we may accidentally double spend one of those if using our own CoinSelectionSource.

Right, we're still waiting on bitcoindevkit/bdk_wallet#259 to ship with BDK 3.0. For now I'm not sure if we'd then need to also do some tracking based on ClaimId.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline. We'll use the current approach and then once BDK ships a new release we can revisit coin selection for anchor bumping.

Alternatives would be to either (1) drop the fixup such that we use LdkWallet for both coin selections or (2) maintain a locked UTXO list for splice coin selection and filter WalletSource::list_confirmed_utxos so that anchor bumping doesn't double spend splicing.

Ok(txid)
}

pub(crate) fn select_confirmed_utxos(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that seems preferable, if we have everything we need in the API by now?

Update splice_in/splice_out to use new LDK two-phase funding API

The LDK dependency bump introduced a new splicing API that separates
negotiation from coin selection, letting LDK handle transaction
construction internally rather than requiring manual UTXO selection
and change address management.

Generated with the assistance of AI (Claude Code).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

f - use select_confirmed_utxos
@jkczyz jkczyz force-pushed the 2026-02-splicing-api-change branch from 7ccaa2a to 01102e6 Compare February 20, 2026 06:03
@jkczyz jkczyz marked this pull request as ready for review February 20, 2026 06:03
@jkczyz jkczyz requested a review from tnull February 20, 2026 06:13
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Seems this should be based on lightningdevkit/rust-lightning#4382 as it now has landed, as is the next related breaking change?

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants

Comments