0

When I install the Ganache a mnemonic is shown at the user interface.

I think that the mnemonic which is shown in Ganache UI is for first account (account[0]).

As a test I open the MetaMask select restore from seed feature enter above mnemonic and I get the account that its public and private key are same as account[0] which is shown in Ganache

So, is it possible that I can have the mnemonic for other accounts.

A syntax is shown in front of mnemonic that is m/44'/60'/0'/0/account_index, I think there must be a way to change account_index here but no luck

1

The mnemonic you have is for every account.

In regards to the HD path m/44'/60'/0'/0/account_index, account[0] is basically account[account_index] so if you simply just use the "Create Account" function on Metamask, you are increasing the account_index for that account recovered under that mnemonic.

So account[0 - whatever] under your Ganache setup is basically a path with a HDPath base of m/44'/60'/0'/0 that are just children paths using the same recovery mnemonic.

  • I thought that each mnemonic is for one private and public account, which seems to be wrong. As you mentioned The mnemonic you have is for _every account_. – Alireza Fattahi Jul 21 '18 at 4:05
2

I think the ganache has used a single mnemonic for 10 ethereum accounts. because when I was using a random account and logged out, then I used a mnemonic to replace the new password for the meta mask. Read more on:https://truffleframework.com/docs/ganache/using

In docs:

The Accounts & Keys page sets details about the number of accounts created,
and whether to use a specific mnemonic or let Ganache generate its own.
  • When I enter the mnemonic I get the public and private key of first account not all of them ! – Alireza Fattahi Jul 17 '18 at 11:20
  • Yes. Try Create Account to get another account. The accounts will be sorted in order in the ganache. Login first will be always account with index 0. – xPain Jul 18 '18 at 1:26
1

Try adding an account to the MetaMask instance to which you imported the mnemonic. The new account should be account[1]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.