Multiple Wallets

Currently I have one address wallet fully synced. I’d like to add another address wallet which i created on another machine, but don’t want to make another user account on my PC and sync up the blockchain again (and take up another 4.5GB) to do so. Is this possible? Thanks

In the CLI wallet which I am using I notice the following options under help:

OPTIONS:
    -a, --account <account>

I think this is what I’m looking for but need some clarification on how to use it

right i made another account using ./grin-wallet account -c newname but would like this new account to be restored from a seed phrase which differs from my default account

Is this possible? Thanks

edit: If all wallet files are generated from the same master.seed then I’m not sure if I can do this

use this
bash- grin-wallet account create new_account_name

or you can use an external wallet or mobile, if you’re only receiving.

1 Like

thanks, i got that far but as you see from the above i’m actually trying to run two accounts wallets created from different master seeds

the newly created account has it’s own new address and did not prompt me for a recovery seed so im guessing it works like a hierarchical wallet, which might mean the only way i can do what i want to do is to create a new linux user account and restore from my seed phrase there

can someone clarify please?

edit: would restoring the second account in a new directory be the solution perhaps?

1 Like

OK i think I found the solution but would like a confirmation before I proceed

  • I create a new directory called Harry and cd into that directory
  • I then run grin-wallet init -h

And this should then prompt me to restore the 2nd account wallet from a seed phrase so that I have two accounts wallets on the same machine derived from different master seeds. ./grin-wallet commands issued from the Harry directory will apply to the 2nd account wallet but if I’m in any other directory it will use the 1st (default) account wallet.

Is this correct, and does this solve the problem of having two accounts wallets from different seeds running on the same PC? Thanks

cc @Anynomous @transatoshi

edit: I would also need to add grin-wallet to my PATH to get this working, assuming all I have already suggested will work fine

I don’t think it’s possible. You can have multiple addresses from the same seed using accounts, but not from multiple seeds.

Are you sure? This reads as if one can A minor issue with using "-h" option to run the wallet in current directory · Issue #728 · mimblewimble/grin-wallet · GitHub

This issue should not block from using multiple wallets.

This dev is using the phrase multiple wallets, rather than multiple accounts.

@gig What you are describing is not having two accounts, but having two wallet on the same machine. And yes, that is very much possible. You can have an infinite amount of walletss on one machine.

What is a grin wallet account

To clarify what an account is, an account is not an user account but an account derived from a seed:

$ grin-wallet account
Password: 

____ Wallet Accounts ____

 Name    | Parent BIP-32 Derivation Path 
---------+-------------------------------
 default | m/0/0  
 alice   | m/1/0 
 bob     | m/2/0 

See the numbers ‘0,1,2’ above, those are part of the hierarchical derived wallet (roughly follows BIP32), with the number in bold representing the account level in derivation. All accounts are derived from the same seed and in grin-wallet they all have the same slatepack address.

Using multiple wallet using the CLI wallet

What you want is to use multiple wallets. You can tell the client which wallet you want to create/load using either there -h (here) or the -t (top-directory) command, see examples below:

You can create a wallet in a specific directory, opposed to the default user folder by running:
grin-wallet init -h (-h stand for here).
As expected a wallet folder will be create in your current directory next to your grin-wallet executable or binary.

If you want multiple wallets, the more logical way is to using the top directory command:
grin-wallet -t wallet1 init -r (I added the -r flag because you want to restore from an existing seed)
grin-wallet -t wallet2 init -r (Another wallet will be created, you can load your second seed.

After you create the wallets, you can specify which wallet you want as follows
grin-wallet -t wallet1 info
grin-wallet -t wallet2 info

Now it is important to know that there is small bug, your wallet does not set the node path correctly in the config file when using -h or -t. This is a bug I am working on fixing in this pull request [Pull 732]:

Until this bug is fixed, you need to manually open the grin-wallet.toml file in your wallet directories, and change the node_api_secret_path line to point to your node API secret to as shown below:
On Windows:

#location of the node
node_api_secret_path = “C:\Users\$USERNAME$\.grin\main\.foreign_api_secret”

On Linux:

#location of the node
/home/$USERNAME$/.grin/main/.foreign_api_secret

2 Likes

Thanks!!