You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #593: Add support for Taproot and tr() descriptors
20d36c7 Update CHANGELOG.md for Taproot (Alekos Filini)
ef08fbd Update to the newest release of rust-bitcoin (Alekos Filini)
5320c83 taproot-tests: validate `tap_tree` in psbt outputs (Alekos Filini)
c1bfaf9 Add blockchain tests for parsing, signing, finalizing taproot core psbts (Steve Myers)
0643f76 taproot-tests: Add tests for the policy module (Alekos Filini)
89cb425 taproot-tests: Add test coverage for tx signing (Alekos Filini)
461397e taproot-tests: Test taproot key and script spend in the blockchain tests (Alekos Filini)
c67116f policy: Consider `tap_key_origins` when looking for sigs in PSBTs (Alekos Filini)
572c3ee policy: Build `SatisfiableItem::*Signature` based on the context (Alekos Filini)
ff1abc6 policy: Refactor `PkOrF` into an enum (Alekos Filini)
3087089 Fix type inference for the `tr()` descriptor, add basic tests (Alekos Filini)
fe1877f Support `tr()` descriptors in dsl (Alekos Filini)
cdc7057 Add `tr()` descriptors to the `descriptor!()` macro (Alekos Filini)
c121dd0 Use `tap_key_origins` in PSBTs to derive descriptors (Alekos Filini)
8553821 Populate more taproot fields in PSBTs (Alekos Filini)
8a5a87b Populate `tap_key_origin` in PSBT inputs and outputs (Alekos Filini)
1312184 Attach a context to our software signers (Alekos Filini)
906598a Refactor signer traits, add support for taproot signatures (Alekos Filini)
Pull request description:
### Description
This is a work-in-progress PR to update BDK to rust-bitcoin `0.28` which introduces taproot support and a few other improvements. While updating we also introduce taproot support in BDK.
High level list of subtasks for this PR:
- [x] Update rust-bitcoin and rust-miniscript
- [x] Stop using deprecated structs
- [x] Add taproot metadata to psbts
- [x] Produce schnorr signatures
- [x] Finalize taproot txs
- [x] Support `tr()` descriptors in the `descriptor!()` macro
- [x] Write a lot of tests
- [x] Interoperability with other wallets (Core + ?)
- [x] Signing/finalizing a psbt made by core
- [x] Producing a psbt that core can sign and finalize
- [x] Creating psbts
- [x] Verify the metadata are correct
- [x] Verify sighashes are applied correctly
- [x] Create a tx with a foreign taproot and non-taproot utxo
- [x] Signing psbts
- [x] Signing for a key spend
- [x] Signing for a script spend
- [x] Signing with a single (wif) key
- [x] Signing with an xprv (with and without knowing the utxo being spent in the db)
- [x] Signing with weird sighashes
- [x] Policy module
- [x] Simple key spend
- [x] More complex tap tree with a few keys
- [x] Verify both `contribution` and `satisfaction` of a PSBT input
- [x] Wallet module
- [x] Generate addresses
Fixes#63
### Notes to the reviewers
#### Milestone
I'm adding this to the `0.19` milestone because now that rust-bitcoin and rust-miniscript have been released we should not waiting too long to release a version of BDK that supports the new libraries.
#### API Breaks
Since this is an API-break because of the new version of rust-bitcoin and rust-miniscript, I'm also taking the chance to update a few things in our lib that I had been thinking about for a while.
One example is the signer interface, which had that weird `sign_whole_tx()` method. This has now been removed, and the `Signer` trait replaced with `TransactionSigner` and `InputSigner`. I'm also starting to think that the signer should not only look at the psbt to figure out what to do, but ideally it should also receive some information about the descriptor (for example, the type) to simplify the code.
One option is to add an extra parameter, but that would probably only be used by our internal signers and not much else (for example, if you ask an hardware wallet to sign, it will probably already know what kind of wallet you have).
Another option is to wrap `PrivateKey` and `DescriptorXKey<ExtendedPrivKey>` which are the two internal signers we support with a struct that contains metadata about the descriptor, and then implement the signer traits on that struct. We could construct this in `Wallet::new()`, after miniscript parses the descriptor.
#### MSRV Bump
Due to the update of `rust-electrum-client`, which in turn depends on an updated `webpki`, we will have to bump our MSRV beacuse 1.46 is not supported by the new `webpki` version.
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### New Features:
* [x] I've added docs for the new feature
* [ ] I've updated `CHANGELOG.md`
Top commit has no ACKs.
Tree-SHA512: 44ec6c4e7fe0bc87862bb76581ddae7905c8796a4a130c90b48b73b4b7d01ea1a20043b8a0ff449fc2db2f7aecc490def8daee2d420809ded1ece7f085a48f55
0 commit comments