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
  1. luke-jr commented at 6:27 AM on August 6, 2016: member

    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.

  2. fanquake commented at 2:39 AM on August 8, 2016: member

    This needs a rebase.

  3. 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 ?

  4. jonasschnelli added the label Wallet on Aug 8, 2016
  5. jonasschnelli commented at 8:09 AM on August 8, 2016: contributor

    Needs rebase.

  6. jonasschnelli cross-referenced this on Aug 9, 2016 from issue add key generation type by jonasschnelli
  7. luke-jr force-pushed on Aug 9, 2016
  8. luke-jr commented at 7:20 PM on August 9, 2016: member

    Rebased, and logic re-factored to deal with the optional wallet version bump for HD. Not sure if this is the best approach...

  9. luke-jr force-pushed on Aug 9, 2016
  10. luke-jr force-pushed on Aug 29, 2016
  11. luke-jr cross-referenced this on Sep 10, 2016 from issue wallet: Add key generation type by luke-jr
  12. wallet: 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`
    d2a682e84c
  13. wallet: Key origin refactoring d275b9416c
  14. wallet: Reimplement key origin as a field in a new CKeyMetadata map ff44853752
  15. luke-jr force-pushed on Nov 16, 2016
  16. TheBlueMatt commented at 6:14 PM on July 11, 2017: contributor

    Is this still relevant with the default-added hdKeypath metadata when we generate hd keys now?

  17. luke-jr commented at 5:24 AM on February 22, 2018: member

    I don't see why it wouldn't be - the HD keypath is kinda unrelated to this.

  18. MarcoFalke added the label Needs rebase on Jun 6, 2018
  19. in 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: informations

  20. meshcollider commented at 6:43 PM on November 16, 2018: contributor

    Concept 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

  21. MarcoFalke commented at 7:50 PM on March 5, 2019: member

    There 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.

  22. MarcoFalke closed this on Mar 5, 2019

  23. MarcoFalke added the label Up for grabs on Mar 5, 2019
  24. Sjors commented at 8:31 PM on March 5, 2019: member

    Key origin info has been added in #14021 (which upgrades existing HD wallets to add it).

  25. MarcoFalke removed the label Up for grabs on Mar 5, 2019
  26. laanwj removed the label Needs rebase on Oct 24, 2019
  27. bitcoin locked this on Dec 16, 2021

github-metadata-mirror

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-05-20 06:55 UTC