Skip to content

Make it possible to spend LDK UTXO's in BDK #710

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

Closed
ConorOkus opened this issue Aug 10, 2022 · 10 comments
Closed

Make it possible to spend LDK UTXO's in BDK #710

ConorOkus opened this issue Aug 10, 2022 · 10 comments

Comments

@ConorOkus
Copy link

No description provided.

@afilini
Copy link
Member

afilini commented Aug 12, 2022

That's a bit generic, what do you mean exactly? Which utxos should be spent (normal deposits or channel utxos) and where are those keys stored?

@notmandatory
Copy link
Member

I believe the idea here is that the BDK wallet would be able to sync and spend UTXOs created when a LDK channel is closed. I'd also expect that UTXOs in a BDK wallet could be used to open an LDK channel. This should be enabled with #485 and bitcoindevkit/bdk_wallet#188. We also need to be able to use LDK as a custom signer for spending UTXOs from LN script template "Descriptors". And LDK would have to be able to use BDK as a input signer.

@benthecarman
Copy link
Contributor

This should be doable by just creating a custom KeysInterface where you make get_shutdown_scriptpubkey and get_destination_script get addresses from LDK.

@tnull
Copy link
Contributor

tnull commented Dec 15, 2022

This should be doable by just creating a custom KeysInterface where you make get_shutdown_scriptpubkey and get_destination_script get addresses from LDK.

I can now confirm that by implementing a custom KeysInterface we can override the shutdown/destination scripts coming from a BDK wallet, so that the funds show up in the BDK wallet after closing/claiming on-chain. Will be included in LDKLite (see lightningdevkit/ldk-node#33).

However, it likely still would be nice to allow users the flexibility to go the other way, i.e., allow them to add arbitrary UTXOs to BDK's coin selection.

@ConorOkus ConorOkus moved this to In Progress in BDK-LDK Integration Jan 3, 2023
@ConorOkus
Copy link
Author

Added an issue to improve this at the bindings layer here

@moneyball
Copy link

What's the status/priority/plan for this?

@notmandatory
Copy link
Member

@tnull do we only need to expose the existing rust add_foreign_utxo function in the language bindings? That should allow you to create a transaction in BDK that spends a UTXO owned by LDK, though you'd still need LDK to sign for that input.

Otherwise your KeysInterface approach sounds like it already allows BDK to be used to manage the onchain transactions for LDK.

@ConorOkus
Copy link
Author

I don't think that's needed, we already have the ability to forward any other descriptors to KeysManager::spend_spendable_outputs and provide guidance here in the docs https://lightningdevkit.org/key_management/#spending-on-chain-funds

@tnull
Copy link
Contributor

tnull commented Oct 12, 2023

@tnull do we only need to expose the existing rust add_foreign_utxo function in the language bindings? That should allow you to create a transaction in BDK that spends a UTXO owned by LDK, though you'd still need LDK to sign for that input.

Otherwise your KeysInterface approach sounds like it already allows BDK to be used to manage the onchain transactions for LDK.

Yup, I agree that the KeysInterface approach (by now renamed though) seems to work as expected. I'd say it's fine to close this issue for now until we find a good reason why we'd need to 'go the other way'.

@notmandatory
Copy link
Member

Thanks guys, closing for now. Happy to re-open if needed.

@github-project-automation github-project-automation bot moved this from Todo to Done in BDK Wallet Oct 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in BDK-LDK Integration Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Status: Done
Development

No branches or pull requests

6 participants