The export-mnemonic command
zallet export-mnemonic enables a BIP 39 mnemonic to be exported from a Zallet wallet.
The command names the mnemonic to export in one of three ways:
- the UUID of an account derived from it, obtainable from a running Zallet wallet with
zallet rpc z_listaccounts; --seedfp, its ZIP 32 seed fingerprint, as printed byzallet generate-mnemonicandzallet import-mnemonic; or- neither, if the wallet holds exactly one mnemonic.
A freshly generated mnemonic has no accounts derived from it yet, so it can only be named by the latter two.
Exporting decrypts the stored phrase in order to re-encrypt it for output, so it needs the wallet’s age encryption identity. If that identity file is passphrase-encrypted, you will be prompted for the passphrase.
The mnemonic is encrypted to the same age identity that the wallet uses to internally
encrypt key material. Decrypting the exported file therefore requires that same identity
file (and its passphrase, if it is passphrase-encrypted): the encrypted mnemonic is not a
self-contained backup, so keep the identity file too. You can then use a tool like
[rage] to decrypt the resulting file.
⚠️ The mnemonic is not always a complete backup
export-mnemonicbacks up only funds derived from this seed. A wallet can also hold spend authority that no mnemonic covers: keys imported withz_importkey, and any other standalone key material (for example, standalone keys brought in byzallet migrate-zcashd-wallet). That material lives only in the Zallet wallet database.To back it up, you must also keep a secure copy of both the
wallet.dbfile and the age encryption identity file (the file named by thekeystore.encryption_identityconfig option). The spending keys inwallet.dbare encrypted to that identity; if you lose it, or forget its passphrase, they cannot be decrypted and those funds are unrecoverable. Note thatwallet.dbitself is not encrypted — it also holds your transaction history and viewing keys in the clear — so keep the backup somewhere secure. There is currently no complete backup RPC or command for this key material.
$ zallet export-mnemonic --armor 514ab5f4-62bd-4d8c-94b5-23fa8d8d38c2 >mnemonic.age
$ echo mnemonic.age
-----BEGIN AGE ENCRYPTED FILE-----
...
-----END AGE ENCRYPTED FILE-----
$ rage -d -i path/to/encrypted-identity.txt mnemonic.age
some seed phrase ...