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

Enable signing taproot transactions with only non_witness_utxos #757

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

afilini
Copy link
Member

@afilini afilini commented Sep 19, 2022

Description

Some wallets may only specify the non_witness_utxo for a PSBT input. If that's the case, BDK should still be able to sign.

This was pointed out in the discussion of #734

Changelog notice

  • Enable signing taproot transactions that only specify the non_witness_utxo

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Some wallets may only specify the `non_witness_utxo` for a PSBT input.
If that's the case, BDK should still be able to sign.

This was pointed out in the discussion of bitcoindevkit#734
@afilini afilini added the bug Something isn't working label Sep 19, 2022
@afilini afilini added this to the Release 0.23.0 Feature Freeze milestone Sep 19, 2022
@cryptoquick
Copy link

Just tried your branch, works great! PSBT got signed and submitted:
https://mempool.space/testnet/tx/a3baffe1ca14ce357b5fb4caa1b753795e65f4ee330f677044bc17ad387775f8
There's definitely a lot more work to do, but it unblocks me for now. Rust won't let me compile using both 0.19 for WASM and your branch since it's from a different source, though.

@danielabrozzoni
Copy link
Member

@cryptoquick can you try including these lines in the Cargo.toml, and then updating to the latest bdk:

[target.'cfg(target_arch = "wasm32")'.dependencies]
rand = { version = "^0.6", features = ["wasm-bindgen"] }

I used this workaround in bitcoindevkit/bdk-cli#117 and it seems to work

Copy link
Member

@danielabrozzoni danielabrozzoni left a comment

Choose a reason for hiding this comment

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

tACK 5e9965f - the code looks good to me, I played around with the test you provided (inspecting the PSBT, adding/removing the witness and non-witness utxos, etc) and everything works as expected.

@cryptoquick
Copy link

@cryptoquick can you try including these lines in the Cargo.toml, and then updating to the latest bdk:

[target.'cfg(target_arch = "wasm32")'.dependencies]
rand = { version = "^0.6", features = ["wasm-bindgen"] }

I used this workaround in bitcoindevkit/bdk-cli#117 and it seems to work

Works great, I can use 0.22 in wasm now, thanks!

@afilini afilini merged commit aad5461 into bitcoindevkit:master Sep 23, 2022
@afilini afilini deleted the fix/taproot-non-witness-utxo branch September 23, 2022 10:39
This was referenced Sep 26, 2022
@afilini afilini mentioned this pull request Oct 7, 2022
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants