[Wallet] Move key derivation logic from GenerateNewKey to DeriveNewChildKey #8375

pull pstratem wants to merge 1 commits into bitcoin:master from pstratem:2016-07-19-cwallet-derivenewkey changing 2 files +43 −37
  1. pstratem commented at 11:43 PM on July 19, 2016: contributor

    No description provided.

  2. in src/wallet/wallet.h:None in af5a90e9da outdated
     682 | @@ -683,6 +683,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
     683 |       * Generate a new key
     684 |       */
     685 |      CPubKey GenerateNewKey();
     686 | +    CKey DeriveNewKey(CKeyMetadata &metadata);
    


    instagibbs commented at 1:19 AM on July 20, 2016:

    nit: name is awfully close to GenerateNewKey to me. Perhaps something like "DeriveNewHDKey" or "DeriveNewChildKey".


    pstratem commented at 1:50 AM on July 20, 2016:

    Done

  3. pstratem force-pushed on Jul 20, 2016
  4. pstratem force-pushed on Jul 20, 2016
  5. pstratem force-pushed on Jul 20, 2016
  6. pstratem force-pushed on Jul 20, 2016
  7. pstratem force-pushed on Jul 20, 2016
  8. pstratem force-pushed on Jul 20, 2016
  9. pstratem force-pushed on Jul 20, 2016
  10. pstratem renamed this:
    Move key derivation logic from GenerateNewKey to DeriveNewKey
    [Wallet] Move key derivation logic from GenerateNewKey to DeriveNewKey
    on Jul 20, 2016
  11. pstratem renamed this:
    [Wallet] Move key derivation logic from GenerateNewKey to DeriveNewKey
    [Wallet] Move key derivation logic from GenerateNewKey to DeriveNewChildKey
    on Jul 20, 2016
  12. MarcoFalke added the label Refactoring on Jul 20, 2016
  13. MarcoFalke commented at 8:25 AM on July 20, 2016: member

    Concept ACK 78e3df6

  14. MarcoFalke added the label Wallet on Jul 20, 2016
  15. MarcoFalke added this to the milestone 0.14 on Jul 20, 2016
  16. in src/wallet/wallet.cpp:None in e4469e2382 outdated
     129 | +    CExtKey externalChainChildKey; //key at m/0'/0'
     130 | +    CExtKey childKey;              //key at m/0'/0'/<n>'
     131 | +
     132 | +    // try to get the master key
     133 | +    if (!GetKey(hdChain.masterKeyID, key))
     134 | +        throw std::runtime_error("CWallet::GenerateNewKey(): Master key not found");
    


    jonasschnelli commented at 8:41 AM on July 20, 2016:

    s/CWallet::GenerateNewKey()/CWallet::DeriveNewChildKey :-)


    pstratem commented at 9:31 PM on July 20, 2016:

    Indeed


    sipa commented at 5:02 PM on August 24, 2016:

    Please fix? :)


    MarcoFalke commented at 5:37 PM on August 24, 2016:

    No need to fix this. A rebase will solve it, IIRC. (This should read __func__ in master already)

  17. jonasschnelli commented at 8:45 AM on July 20, 2016: contributor

    Concept ACK. After having done multiple implementation of a subclasses of CKeyStore (CHDKeyStore), I think this "new" function should slowly be moved toward CKeyStore (or a subclass of it). The whole HD stuff could be kept there to not overpolute CWallet (because in general hierarchical key derivation can be wallet neutral).

  18. Move key derivation logic from GenerateNewKey to DeriveNewChildKey 78e3df6fa0
  19. pstratem force-pushed on Jul 20, 2016
  20. jonasschnelli commented at 8:32 AM on August 24, 2016: contributor

    Needs rebase.

  21. sipa commented at 5:19 PM on August 26, 2016: member

    Code review ACK, but needs rebase.

  22. laanwj closed this on Sep 30, 2016

  23. MarcoFalke locked this on Sep 8, 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-04-17 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me