RPC command to export the master private key from a wallet.
[RPC] dumpmasterprivkey command #9504
pull achow101 wants to merge 1 commits into bitcoin:master from achow101:dumpmasterprivkey changing 3 files +59 −4-
achow101 commented at 7:18 PM on January 10, 2017: member
-
luke-jr commented at 7:46 PM on January 10, 2017: member
dumpwalletalready does this...? -
achow101 commented at 7:49 PM on January 10, 2017: member
dumpwalletrequires 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. - fanquake added the label RPC/REST/ZMQ on Jan 10, 2017
-
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.
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
CKeyIDanyway,... but I guess it would still make sense to useCWallet::IsHDEnabled()jonasschnelli changes_requestedjonasschnelli commented at 7:31 AM on January 11, 2017: contributorNot 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
dumpmasterprivkeyto the UI's sensitiv data filter ... add a test somewhereachow101 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.achow101 force-pushed on Jan 11, 2017achow101 commented at 4:20 PM on January 11, 2017: memberAddressed nits and added a test.
It may need more tests, but I'm not sure what actually needs to be tested.
achow101 force-pushed on Jan 11, 2017jonasschnelli 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.
achow101 force-pushed on Aug 15, 2017achow101 force-pushed on Aug 17, 201707fc81109adumpmasterprivkey command
RPC command to export the master private key from a wallet.
achow101 force-pushed on Aug 17, 2017achow101 commented at 7:13 PM on February 8, 2018: memberClosing this for now
achow101 closed this on Feb 8, 2018DrahtBot locked this on Sep 8, 2021ContributorsLabels
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
More mirrored repositories can be found on mirror.b10c.me