Skip to content
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

TxBuilder: Add an option to only use confirmed utxo's #1741

Open
ErikDeSmedt opened this issue Nov 21, 2024 · 0 comments
Open

TxBuilder: Add an option to only use confirmed utxo's #1741

ErikDeSmedt opened this issue Nov 21, 2024 · 0 comments
Labels
module-wallet new feature New feature or request

Comments

@ErikDeSmedt
Copy link

ErikDeSmedt commented Nov 21, 2024

Describe the enhancement

I want to create a transaction and ensure that prevout has been confirmed onchain.

Similar to ChangeSpendPolicy I'd like to introduce a ConfirmationSpendPolicy.
This could be used to spend only Confirmed, Trusted or Any output.

The code to use it could look like the example below

wallet.create_tx()
    .add_recipient(address.script_pubkey(), payment_amount)
    .only_spend_confirmed_utxos()
    .finalize()

Use case

When creating a transaction I want to ensure it cannot be doublespent.
If I use an unconfirmed and untrusted prevout, I cannot guarantee the transaction will not be doublespent

Additional context

@notmandatory notmandatory added this to BDK Nov 21, 2024
@notmandatory notmandatory moved this to Discussion in BDK Nov 21, 2024
@notmandatory notmandatory added the new feature New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module-wallet new feature New feature or request
Projects
Status: Discussion
Development

No branches or pull requests

2 participants