How to have multiple wallets in grin-wallet?

Does grin-wallet support multiple wallets (multiple private keys)? If so, how would I accomplish this?

2 Likes

The official CLI wallet supports multiple sub-accounts in one main wallet.
e.g.
Wallet1 (one private key)

  • Sub1 (can be restored by above private key)
    -> Sub2 …

I am personally using this script here https://github.com/hendi/grin-multi-wallet-scripts to generate multiple wallets with its own private keys.

Once created you can distribute your GRINS accordingly.

Can you explain how to do this without using that script?

I understand that there is an account system in the official grin-wallet CLI. What exactly are accounts; are they separate private keys with they’re own backup phrases, or are they derived keys in a hierarchical deterministic kind of way?

Accounts are just derived keys from a single HD seed. There’s really not an easy way to do what you want. You’ll either have to use accounts, switch to Grin++, or create several directories with different wallets and keep changing the config to point to the one you want.

So if I understand correctly: grin-wallet supports multiple wallets by creating a wallet directory using the following command:

grin-wallet -d directoryname init

This will create a directory named directoryname in the current working directory. The official wallet CLI will recognize when it’s in this directory during execution of commands like grin-wallet info.

So, if I wish to create a wallet for purpose of offline storage, I can simply delete this directory after funds have been transferred (of course the seed phrase would be backed-up somewhere)?

Is there anything else I should know about? What are “accounts” when it comes to the official wallet CLI?

It looks like grin-wallet will use the current working directory as the wallet if it contains the wallet files generated from grin-wallet -d [directory-name] init. So, I wouldn’t need to change the my main config it seems.

1 Like