Skip to content

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

Draft
jkczyz wants to merge 3 commits intolightningdevkit:mainfrom
jkczyz:2026-02-splicing-api-change
Draft

Update splice_in/splice_out to use new LDK two-phase funding API #794
jkczyz wants to merge 3 commits 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.

jkczyz and others added 3 commits February 17, 2026 22:10
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>
@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!

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?

let txid = self.onchain_payment.send_to_address(&address, amt_sats, None)?;
return Ok(UnifiedPaymentResult::Onchain { txid });
},
PaymentMethod::Cashu(_) => todo!(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Uh, let's not panic if someone includes Cashu instructions in the string above. Could just error and skip if this is hit.

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?

async move { self.get_change_script_inner() }
}

fn get_prevtx<'a>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems this is not used anywhere? Btw, also note related changes we recently landed in 788055f

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.

3 participants