This upgrades #5916/#8132 to support HD wallets by adding a map<string,string> at the end of CKeyMetadata which can be used to store future-proof data, similar to CWalletTx's mapValue.
Key origin metadata, with HD wallet support #8471
pull luke-jr wants to merge 3 commits into bitcoin:master from luke-jr:keyorigin_hd changing 5 files +91 −3-
luke-jr commented at 6:27 AM on August 6, 2016: member
-
fanquake commented at 2:39 AM on August 8, 2016: member
This needs a rebase.
-
in src/wallet/walletdb.h:None in 5e3d172615 outdated
111 | READWRITE(this->nVersion); 112 | nVersion = this->nVersion; 113 | READWRITE(nCreateTime); 114 | if (this->nVersion >= VERSION_WITH_HDDATA) 115 | { 116 | + // Core/Knots 0.13+
fanquake commented at 2:40 AM on August 8, 2016:Knots ?
jonasschnelli added the label Wallet on Aug 8, 2016jonasschnelli commented at 8:09 AM on August 8, 2016: contributorNeeds rebase.
luke-jr force-pushed on Aug 9, 2016luke-jr commented at 7:20 PM on August 9, 2016: memberRebased, and logic re-factored to deal with the optional wallet version bump for HD. Not sure if this is the best approach...
luke-jr force-pushed on Aug 9, 2016luke-jr force-pushed on Aug 29, 2016d2a682e84cwallet: Add key origin flags
An encrypted wallet can still hold keys which where created when the wallet was unencrypted. This PR will add a 8bit-flags-int to the CKeyMetadata class. `listreceivedbyaddress` will report whether the key was generated within a enctypted wallet or if it was imported throught `importprivkey`
wallet: Key origin refactoring d275b9416cwallet: Reimplement key origin as a field in a new CKeyMetadata map ff44853752luke-jr force-pushed on Nov 16, 2016TheBlueMatt commented at 6:14 PM on July 11, 2017: memberIs this still relevant with the default-added hdKeypath metadata when we generate hd keys now?
luke-jr commented at 5:24 AM on February 22, 2018: memberI don't see why it wouldn't be - the HD keypath is kinda unrelated to this.
MarcoFalke added the label Needs rebase on Jun 6, 2018in src/wallet/wallet.h:84 in ff44853752
80 | @@ -81,9 +81,12 @@ enum WalletFeature 81 | 82 | FEATURE_WALLETCRYPT = 40000, // wallet encryption 83 | FEATURE_COMPRPUBKEY = 60000, // compressed public keys 84 | + FEATURE_KEYFLAGS = 70000, // key metadata flags for storing informations like key origin
practicalswift commented at 6:36 PM on September 2, 2018:Typo found by
codespell: informationsmeshcollider commented at 6:43 PM on November 16, 2018: contributorConcept ACK but I'm not convinced about this approach. Seems like the keyflags and the origin metadata are a bit mixed here, my impression of the flags is that they were a more general thing (although perhaps unnecessary with the metadata map now). Why not just store origin in the metadata without using the flags (more than one origin isn't output by the RPC here anyway). IMO this also makes the wallet features messy, I really don't see by we need flags, meta, and hdmeta
MarcoFalke commented at 7:50 PM on March 5, 2019: memberThere hasn't been much activity lately and the patch still needs rebase, so I am closing this for now. Please let me know when you want to continue working on this, so the pull request can be re-opened.
MarcoFalke closed this on Mar 5, 2019MarcoFalke added the label Up for grabs on Mar 5, 2019MarcoFalke removed the label Up for grabs on Mar 5, 2019laanwj removed the label Needs rebase on Oct 24, 2019DrahtBot locked this on Dec 16, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:15 UTC
More mirrored repositories can be found on mirror.b10c.me