bitcoindevkit / bitcoindevkit/bdk-ffi
Add Psbt::sign API to Psbt type
- Dominant language
- Rust
- Stars
- 127
- Forks
- 81
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 5
Description
**Describe the enhancement**
---
Psbt::sign is yet to exposed in our Psbt type. This allows you to sign a Psbt be simply calling the sign method from rust-bitcoin [Psbt::sign](https://docs.rs/bitcoin/latest/bitcoin/psbt/struct.Psbt.html#method.sign) on the psbt you would like to sign.
**Use case**
---
- To sign a psbt
**Additional context**
---
In preparation for bdk-wallet 3.0 migration, Signers will be removed from bdk-wallet as described [here](https://github.com/bitcoindevkit/bdk_wallet/issues/70). Having this feature serves as a replacement and enhancement of how we sign psbt's.
Using the sign method requires as parameters a type that impelements [GetKey ](https://docs.rs/bitcoin/latest/bitcoin/psbt/trait.GetKey.html) and a [Secp256k1](https://docs.rs/bitcoin/latest/bitcoin/key/struct.Secp256k1.html). For GetKey it is important to note that types like `KeyMap` and `DescriptorSecretKey` have implemented GetKey in [rust-miniscript](https://github.com/rust-bitcoin/rust-miniscript/pull/851) and there might be no need to create any extra types here in FFI. `KeyMap` and `DescriptorSecretKey` are existing types in FFI which will have access to implemented GetKey;
- once bdk-wallet updates to rust-miniscript version that has GetKey implementation for those types,
- and then bdk-ffi updates to updated bdk-wallet version.
Once psbt sign method is exposed, and the above conditions fulfilled, using psbt.sign will be as simple as passing the Descriptor's KeyMap as param. Below is the PR to watch/wait for, for this issue to be completed.
- PR: [remove signers](https://github.com/bitcoindevkit/bdk_wallet/pull/235)
Note: In order to see how sign from psbt will work here in FFI even before all above conditions are satisfied, one can use a SignerWrapper from testutils like in PR: [remove signers](https://github.com/bitcoindevkit/bdk_wallet/pull/235)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.