-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Import key origin data through descriptors in importmulti #14021
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
Conversation
|
Nice! strong concept ACK |
631a8b7 to
19bd923
Compare
19bd923 to
11db726
Compare
|
Fixed a bug where the keymetadata wasn't being written to the wallet file. Also added a test for that case. |
16606ee to
8aba59d
Compare
8aba59d to
1c428a6
Compare
|
Rebased and also changed the keymeta stuff to add the hd master key id at key generation and when the wallet is first loaded. |
1c428a6 to
7433952
Compare
1cf56e0 to
8065a31
Compare
src/utilstrencodings.cpp
Outdated
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.
Why?
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.
why not? This is quite standard.
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.
It's fairly standard to use h or H as the indicator, not just '. In fact, the BIP uses H, but as a subscript. ' is not actually used as the indicator for hardened in the BIP even though that is what everyone uses.
The main reason for allowing this is so that you don't have to do any annoying escaping stuff for the ' when entering the keypaths on the command line.
8065a31 to
4a9be42
Compare
|
Rebased |
4a9be42 to
44b1725
Compare
|
Concept ACK, thanks for working on this |
1b1c6aa to
cb3511b
Compare
|
Changes since @sipa's are just nit-fixes, a new test, and a missing brace bugfix 👍 |
cb3511b Add release notes for importing key origin info change (Andrew Chow) 4c75a69 Test importing descriptors with key origin information (Andrew Chow) 02d6586 Import KeyOriginData when importing descriptors (Andrew Chow) 3d235df Implement a function to add KeyOriginInfo to a wallet (Andrew Chow) eab63bc Store key origin info in key metadata (Andrew Chow) 345bff6 Remove hdmasterkeyid (Andrew Chow) bac8c67 Add a method to CWallet to write just CKeyMetadata (Andrew Chow) e7652d3 Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} (Andrew Chow) c45415f Refactor keymetadata writing to a separate method (Andrew Chow) Pull request description: This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using `importmulti`. This allows the `walletprocesspsbt` to include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet. In order to make this easier to use, a new field `hdmasterkeyfingerprint` has been added to `getaddressinfo`. Additionally I have removed `hdmasterkeyid` as was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways. `CKeyMetadata` has also been extended to store key origin info to facilitate this. Tree-SHA512: 9c7794f3c793da57e23c5abbdc3d58779ee9dea3d53168bb86c0643a4ad5a11a446264961e2f772f35eea645048cb60954ed58050002caee4e43cd9f51215097
Summary: Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@c45415f Test Plan: ninja ninja check ninja check-functional Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D6004
Summary: Creates new files util/bip32.h and util/bip32.cpp for containing BIP 32 stuff. Moves FormatKeyPath from descriptor.cpp to util/bip32. Adds a wrapper around it to prepent the 'm' for when just the BIP 32 style keypath is needed. Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@e7652d3 Depends on D6004 Test Plan: ../configure --enable-deprecated-build-system make check ninja ninja check test_runner.py Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D6204
Summary: Deprecated return results that were scheduled to be removed in v0.21 Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@345bff6 Test Plan: ninja ninja check-functional Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5933
Summary: Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@bac8c67 Depends on D6204 Test Plan: ninja Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6227
Summary: Store the master key fingerprint and derivation path in the key metadata. hdKeypath is kept to indicate the seed and for backwards compatibility, but all key derivation path output uses the key origin info instead of hdKeypath. Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@eab63bc Depends on D6227 Test Plan: ninja ninja check Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6228
Summary: Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@3d235df Depends on D6228 Test Plan: ninja Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6229
Summary: Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@02d6586 Depends on D6229 Test Plan: ninja ninja check Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6230
…e notes Summary: Test is separated from the rest of the changes to make review easier. Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@4c75a69 bitcoin/bitcoin@cb3511b Depends on D6230 Test Plan: ninja ninja check ninja check-functional Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6215
Summary: Partial backport of Core [[bitcoin/bitcoin#14021 | PR14021]] bitcoin/bitcoin@c45415f Test Plan: ninja ninja check ninja check-functional Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D6004
…portmulti cb3511b Add release notes for importing key origin info change (Andrew Chow) 4c75a69 Test importing descriptors with key origin information (Andrew Chow) 02d6586 Import KeyOriginData when importing descriptors (Andrew Chow) 3d235df Implement a function to add KeyOriginInfo to a wallet (Andrew Chow) eab63bc Store key origin info in key metadata (Andrew Chow) 345bff6 Remove hdmasterkeyid (Andrew Chow) bac8c67 Add a method to CWallet to write just CKeyMetadata (Andrew Chow) e7652d3 Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} (Andrew Chow) c45415f Refactor keymetadata writing to a separate method (Andrew Chow) Pull request description: This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using `importmulti`. This allows the `walletprocesspsbt` to include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet. In order to make this easier to use, a new field `hdmasterkeyfingerprint` has been added to `getaddressinfo`. Additionally I have removed `hdmasterkeyid` as was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways. `CKeyMetadata` has also been extended to store key origin info to facilitate this. Tree-SHA512: 9c7794f3c793da57e23c5abbdc3d58779ee9dea3d53168bb86c0643a4ad5a11a446264961e2f772f35eea645048cb60954ed58050002caee4e43cd9f51215097
…portmulti (add)
…portmulti (add 1)
This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using
importmulti. This allows thewalletprocesspsbtto include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet.In order to make this easier to use, a new field
hdmasterkeyfingerprinthas been added togetaddressinfo. Additionally I have removedhdmasterkeyidas was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways.CKeyMetadatahas also been extended to store key origin info to facilitate this.