This question is not about how to recover, but how does metamask recover my 2nd account?
my setup:
windows 10
latest chrome browser
latest metamask plugin
goerli testnet
I had set up a metamask wallet with 2 accounts on computer A. I got
paraphrase
Account 1
Account 2
Both accounts had ETH balances.
Now I wanted to make them accessible from computer B.
On computer B,
1. I installed metamask plugin into my browser.
2. I used the paraphrase (got from computer A) to restore my wallet in metamask.
3. this restored my Account 1.
4. To restore "Account 2", I clicked "Create Account", and typed "Account 2" as name.
5. This didn't create a new account,
6. but actually restored my "Account 2" from computer A, and I saw my ETH balance.
How did this work? or where metamask stored or retrieved "Account 2" information?
Best Answer
The mnemonic phrases are specified in bip-39
It means you can generate the accounts
0,1,2,3,...
(the private keys) from the paraphrase always the same.The derivation path is used to generate the private key:
For Ethereum, the values are predefined - except for the
address_index
- which is the account number, and look like this (account 0)So to generate any account
0,1,...
for themnemonic
it would be withethers
library: