Getting private keys from zcashd

So I’ve got the blockchain fully downloaded and I’m validating transactions. I’ve generated a z-addr. Now I’m wondering how to get my private keys/ recovery phrase in case my laptop fails. Is there a command for this?

https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_backup.html

1 Like

so i ran exportdir=pathtomyexportdir, got no message, then ran
zcash-cli backupwallet backupname
and got this error
error code: -4
error message:
Cannot backup wallet until the -exportdir option has been set

You did not do this step first – include an export directory setting in your config file (zcash.conflocated in the data directory which is ~/.zcash/ unless it’s been overridden with datadir= setting):

1 Like

i thought i did that. what is the command?

It’s not a command it a file you need to manually edit located in the data directory

1 Like

so how do i navigate there from the /zcash directory

where ever the file is installed on your computer is where the config file is.

I do not have it installed so I can’t give you an exact location

1 Like

zcash.conf is in the following location (unless you specifically pass the -conf flag to zcashd)

Windows: %HOMEPATH%\AppData\Roaming\Zcash\zcash.conf
macOS: ~/Library/Application Support/Zcash/zcash.conf
Linux: ~/.zcash/zcash.conf

You can either add exportdir=pathtomyexportdir to that zcash.conf or add as an option when starting zcashd i.e. zcashd -exportdir=pathtomyexportdir plus whatever other options you may have. Either way you will need to restart zcashd so maybe that’s the issue? Stop with zcash-cli stop and then restart with that line in your zcash.conf.

1 Like

I exported it successfully, but the folder doesn’t appear where it should be… I’ve tried in terminal

> ls -a

also show hidden folders in the folder options. (ubuntu)
Any ideas,why?