forked from bitcoindevkit/bdk
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for Taproot and tr()
descriptors
#2
Closed
IgboPharaoh
wants to merge
18
commits into
bitcoindevkit-fresheyes-master-593
from
afilini-fresheyes-feature/taproot-593
Closed
Add support for Taproot and tr()
descriptors
#2
IgboPharaoh
wants to merge
18
commits into
bitcoindevkit-fresheyes-master-593
from
afilini-fresheyes-feature/taproot-593
+1,751
−352
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This allows the signer to know the signing context precisely without relying on heuristics on the psbt fields. Due to the context being static, we still have to look at the PSBT when producing taproot signatures to determine the set of leaf hashes that the key can sign for.
For whatever reason we were using a struct as an enum, so we might as well fix it in this PR since we are already breaking the API quite badly.
Also refactor our code to lookup signatures in PSBTs to use the context
We used to only look at `bip32_derivations` which is only used for ECDSA keys.
This is to ensure a Bitcoin node accepts our transactions
Co-authored-by: Daniela Brozzoni <danielabrozzoni@protonmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
tr()
descriptors in thedescriptor!()
macrocontribution
andsatisfaction
of a PSBT inputFixes bitcoindevkit#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 theSigner
trait replaced withTransactionSigner
andInputSigner
. 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
andDescriptorXKey<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 inWallet::new()
, after miniscript parses the descriptor.MSRV Bump
Due to the update of
rust-electrum-client
, which in turn depends on an updatedwebpki
, we will have to bump our MSRV beacuse 1.46 is not supported by the newwebpki
version.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md