-
Notifications
You must be signed in to change notification settings - Fork 162
feat: implement GetKey
for KeyMap
and DescriptorSecretKey
#851
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
base: master
Are you sure you want to change the base?
feat: implement GetKey
for KeyMap
and DescriptorSecretKey
#851
Conversation
Mad, thanks man. I'm off travelling this week but can help review this when I get a chance if needed. I don't do many reviews in |
In 255a61e: You need to update Cargo-minimal.lock and Cargo-recent.lock to require Relatedly, your |
- it's required in order to have all the added variants for `KeyRequest` type.
- creates a new `key_map` module, and `KeyMap` type to replace the existing `BTreeMap` alias. - it's a commit extracted from superseded PR rust-bitcoin#765.
5224964
to
acc2d04
Compare
- add the implementation of GetKey for `KeyMap`, and also implements it for the inner type `DescriptorSecretKey` in order to make the match branching and logic clearer.
acc2d04
to
ab69aac
Compare
Thanks, I've added a new commit 8e05d85 specifically for this version bump. I also updated |
This is not sufficient. The code should not panic on key accesses. |
let path = DerivationPath::from_str("84'/1'/0'/0").unwrap(); | ||
let expected_pk = xpriv.xkey.derive_priv(&secp, &path).unwrap().to_priv(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the path derived from the master key or from the tpriv shown above?
fixes #709
Description
I've built upon Tobin's work in #765 (see #765 (comment)) to implement the
GetKey
trait forKeyMap
, a feature that will enable us to entirely remove the signers API frombdk_wallet
, see: bitcoindevkit/bdk_wallet#70 and bitcoindevkit/bdk_wallet#235.Notes to the reviewers
I followed some of Poelstra's previous comments to reduce the number of required matching branches, and also some VM's suggestions on implementing the main
GetKey
logic forDescriptorSecretKey
instead.Let me know if you have any other suggestions or comments.
Changelog notice