New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC] dumpmasterprivkey command #9504

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@achow101
Member

achow101 commented Jan 10, 2017

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

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Jan 10, 2017

Member

dumpwallet already does this...?

Member

luke-jr commented Jan 10, 2017

dumpwallet already does this...?

@achow101

This comment has been minimized.

Show comment
Hide comment
@achow101

achow101 Jan 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.

Member

achow101 commented Jan 10, 2017

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.

@jonasschnelli

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

Show outdated Hide outdated src/wallet/rpcwallet.cpp
@@ -2602,6 +2603,7 @@ static const CRPCCommand commands[] =
{ "wallet", "addwitnessaddress", &addwitnessaddress, true, {"address"} },
{ "wallet", "backupwallet", &backupwallet, true, {"destination"} },
{ "wallet", "dumpprivkey", &dumpprivkey, true, {"address"} },
{ "wallet", "dumpmasterprivkey", &dumpmasterprivkey, true, {} },

This comment has been minimized.

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

nit: column alignment.

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

nit: column alignment.

Show outdated Hide outdated src/wallet/rpcdump.cpp
EnsureWalletIsUnlocked();
CKeyID masterKeyID = pwalletMain->GetHDChain().masterKeyID;

This comment has been minimized.

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

Use CWallet::IsHDEnabled()?

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

Use CWallet::IsHDEnabled()?

This comment has been minimized.

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

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

@jonasschnelli

jonasschnelli Jan 11, 2017

Member

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

@achow101

This comment has been minimized.

Show comment
Hide comment
@achow101

achow101 Jan 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.

Member

achow101 commented Jan 11, 2017

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

@achow101

This comment has been minimized.

Show comment
Hide comment
@achow101

achow101 Jan 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.

Member

achow101 commented Jan 11, 2017

Addressed nits and added a test.

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

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Jan 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.

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

Member

jonasschnelli commented Jan 11, 2017

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

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

This comment has been minimized.

Show comment
Hide comment
@achow101

achow101 Feb 8, 2018

Member

Closing this for now

Member

achow101 commented Feb 8, 2018

Closing this for now

@achow101 achow101 closed this Feb 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment