[RPC] dumpmasterprivkey command #9504

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:dumpmasterprivkey changing 3 files +59 −4
  1. achow101 commented at 7:18 PM on January 10, 2017: member

    RPC command to export the master private key from a wallet.

  2. luke-jr commented at 7:46 PM on January 10, 2017: member

    dumpwallet already does this...?

  3. achow101 commented at 7:49 PM on January 10, 2017: member

    dumpwallet requires that you dump to a file then find that file and open it to get the master private key. This just gives it to you with the command.

  4. fanquake added the label RPC/REST/ZMQ on Jan 10, 2017
  5. in src/wallet/rpcwallet.cpp:None in e86eb43a14 outdated
    2602 | @@ -2602,6 +2603,7 @@ static const CRPCCommand commands[] =
    2603 |      { "wallet",             "addwitnessaddress",        &addwitnessaddress,        true,   {"address"} },
    2604 |      { "wallet",             "backupwallet",             &backupwallet,             true,   {"destination"} },
    2605 |      { "wallet",             "dumpprivkey",              &dumpprivkey,              true,   {"address"}  },
    2606 | +    { "wallet",             "dumpmasterprivkey",        &dumpmasterprivkey,         true,   {} },
    


    jonasschnelli commented at 7:26 AM on January 11, 2017:

    nit: column alignment.

  6. in src/wallet/rpcdump.cpp:None in e86eb43a14 outdated
     567 | +
     568 | +    LOCK2(cs_main, pwalletMain->cs_wallet);
     569 | +
     570 | +    EnsureWalletIsUnlocked();
     571 | +
     572 | +    CKeyID masterKeyID = pwalletMain->GetHDChain().masterKeyID;
    


    jonasschnelli commented at 7:27 AM on January 11, 2017:

    Use CWallet::IsHDEnabled()?


    jonasschnelli commented at 7:28 AM on January 11, 2017:

    Well,... you need the masterKeys CKeyID anyway,... but I guess it would still make sense to use CWallet::IsHDEnabled()

  7. jonasschnelli changes_requested
  8. jonasschnelli commented at 7:31 AM on January 11, 2017: contributor

    Not sure if we should add more private key exporting features because it increases the risk of doing something wrong with that.

    If we are going to add this, it would require... ... add dumpmasterprivkey to the UI's sensitiv data filter ... add a test somewhere

  9. achow101 commented at 4:06 PM on January 11, 2017: member

    @jonasschnelli there is no sensitive data filter for the dump* commands. The user is not entering sensitive data, only sensitive data being output.

  10. achow101 force-pushed on Jan 11, 2017
  11. achow101 commented at 4:20 PM on January 11, 2017: member

    Addressed nits and added a test.

    It may need more tests, but I'm not sure what actually needs to be tested.

  12. achow101 force-pushed on Jan 11, 2017
  13. jonasschnelli commented at 5:51 PM on January 11, 2017: contributor

    @jonasschnelli there is no sensitive data filter for the dump* commands. The user is not entering sensitive data, only sensitive data being output.

    Argh. Right. I was confusing the sensitiv history filter with the idea of having a filter that disables certain sensitive commands.

  14. achow101 force-pushed on Aug 15, 2017
  15. achow101 force-pushed on Aug 17, 2017
  16. dumpmasterprivkey command
    RPC command to export the master private key from a wallet.
    07fc81109a
  17. achow101 force-pushed on Aug 17, 2017
  18. achow101 commented at 7:13 PM on February 8, 2018: member

    Closing this for now

  19. achow101 closed this on Feb 8, 2018

  20. DrahtBot 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-13 15:15 UTC

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