zcash / zcash

Zcash - Internet Money
https://z.cash/
Other
4.94k stars 2.05k forks source link

Add zcashd-wallet-tool #5573

Closed daira closed 2 years ago

daira commented 2 years ago

From the pending release notes:

Mnemonic Recovery Phrases

The zcashd wallet has been modified to support BIP 39, which describes how to derive the wallet's HD seed from a mnemonic phrase. The mnemonic phrase will be generated on load of the wallet, or the first time the wallet is unlocked, and is available via the z_exportwallet RPC call. All new addresses produced by the wallet are now derived from this seed using the HD wallet functionality described in ZIP 32 and ZIP 316. For users upgrading an existing Zcashd wallet, it is recommended that the wallet be backed up prior to upgrading to the 4.5.2 Zcashd release.

Following the upgrade to 4.5.2, Zcashd will require that the user confirm that they have backed up their new emergency recovery phrase, which may be obtained from the output of the z_exportwallet RPC call. This confirmation can be performed manually using the zcashd-wallet-tool utility that is supplied with this release. The wallet will not allow the generation of new addresses until this confirmation has been performed. It is recommended that after this upgrade, that funds tied to preexisting addresses be migrated to newly generated addresses so that all wallet funds are recoverable using the emergency recovery phrase going forward. If you choose not to migrate funds in this fashion, you will continue to need to securely back up the entire wallet.dat file to ensure that you do not lose access to existing funds; EXISTING FUNDS WILL NOT BE RECOVERABLE USING THE EMERGENCY RECOVERY PHRASE UNLESS THEY HAVE BEEN MOVED TO A NEWLY GENERATED ADDRESS FOLLOWING THE 4.5.2 UPGRADE.


This issue is to implement zcashd-wallet-tool.

str4d commented 2 years ago

Here's what I'm thinking for the tool:

We also need to modify zcash-cli to not allow calling the RPC methods required for confirmation (and instead report an error saying "use the wallet tool, oh and you probably also leaked the mnemonic into your environment"), unless it's being called as a subprocess of the wallet tool (and once we migrate to interacting directly with zcashd, that override can also be removed).

str4d commented 2 years ago

@nuttycom, @daira and I talked this over in PR Gardening, and had the following thoughts on UX: