Blockchain Series — How MetaMask Creates Accounts (2024)

Learn how MetaMask uses the Secret Recovery Phrase to create your accounts and how to recover them.

Blockchain Series — How MetaMask Creates Accounts (1)

In my previous article, I showed how you can get started with cryptocurrencies (and in a way Blockchain) by installing a crypto wallet such as MetaMask.

Blockchain Series — How MetaMask Creates Accounts (2)

If you have done that, it is time to understand what happens behind the scene, and in particular, how MetaMask creates your accounts and how you can recover your accounts if you lose your password. For this article, I will try to explain how things work generally without diving into the specific details of cryptography.

I will save the topic of cryptography for another article.

Let’s start with the Secret Recovery Phrase. When you first install MetaMask, you were shown a list of 12 words known as the Secret Recovery Phrase. MetaMask uses a specification known as the BIP39 to generate these 12 words.

BIP stands for Bitcoin Improvement Proposals. BIP39 recommends the use of a mnemonic phrase (a group of easy to remember words) to serve as a mean to recover your accounts in the event your accounts are compromised or lost. MetaMask calls this mnemonic phrase the Secret Recovery Phrase.

These 12 words in the Secret Recovery Phrase are generated from a list of 2048 words. The complete list of 2048 words can be found from here: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt.

BIP39 uses mnemonic phrases of 12 or 24 words, depending on the implementations. Hardware ledgers that uses BIP39 include the Ledger Nano S and the Trezor Model One.

Blockchain Series — How MetaMask Creates Accounts (3)
Blockchain Series — How MetaMask Creates Accounts (4)

The order of the words in the secret recovery phrase is important.

Each word in the secret recovery phrase has a number associated with it. These numbers are used to form a seed integer, which is then used to create a set of public/private keys. The following diagram summarizes this:

Blockchain Series — How MetaMask Creates Accounts (5)

Generating the public/private key pair and the Ethereum address

In the previous section I mentioned that using the seed integer, a public/private key pair is generated. This is how the key-pair is generated:

  • a private key is generated using the seed integer (which is obtained from the secret recovery phrase) using the SHA256 hash function
  • the corresponding public key for the private key is derived from the private key using the ECDSA (Elliptic Curve Signature) algorithm.
  • from the public key derived, compute a keccak256 hash
  • from the keccak256 hash, take the last 20 bytes (which is 40 hexadecimals), prefix it with “0x” and this is your Ethereum address

Check out https://www.royalfork.org/2017/12/10/eth-graphical-address/?ref=hackernoon.com for more details.

With the public/private key pair created from the seed integer, MetaMask will now be able to create your first account (created by default when you install MetaMask). As explained, your first account is generated from the keccak256 hash.

Internally, MetaMask encrypts your private key using the password that you supplied during the installation stage, and stores it in your browser’s data store. It does not store them on the cloud.

The following figure summarizes how MetaMask generates your private key, derives the account address, and stores your private key internally in the browser store.

Blockchain Series — How MetaMask Creates Accounts (6)

Here comes the interesting part. How does MetaMask create additional accounts (after the first default account)? Turns out that MetaMask makes use of the private key of the first account and use it to generate a set of child keys, which are then used to generate their respective public keys, and so on. The following figure summarizes this step:

Blockchain Series — How MetaMask Creates Accounts (7)

This is the reason why your accounts can be recovered as long as you have your secret recovery phrase. And this brings us to this very important point you have to know — protect your secret recovery phrase under lock and key! Once you compromized your secret recovery phrase, your accounts can be accessed by anyone who has them. Needless to say, your cryptocurrencies will be gone in a heartbeat!

Now that you understand how MetaMask creates account, let’s put this knowledge to the test and see what happens if you forgot your password to your MetaMask account and need to restore the accounts from your secret recovery phrase.

In MetaMask, you will be asked to login. Say you forgot your password and need to recover your accounts. To do that, click the “import using Secret Recovery Phrase” link:

Blockchain Series — How MetaMask Creates Accounts (8)

Note: If you did not see the lock screen as shown above, click on the account button (the circle icon) and click Lock to get back to the login screen:

Blockchain Series — How MetaMask Creates Accounts (9)

You will now see the following page where you can enter your 12-word secret recovery phrase. You will also need to enter a new password to secure your account. Once you have entered the information, click Restore:

Blockchain Series — How MetaMask Creates Accounts (10)

That’s it! Your accounts will all be restored.

Note that MetaMask will automatically recover all those accounts with non-zero balance. If you have an account that has 0 balance, MetaMask will not add that account for you automatically. Instead, you need create a new account in MetaMask and the previous account that has 0 balance will now appear. Also, MetaMask can only recover accounts that you have created using MetaMask — if you have imported an account from another source, you have to add the account manually.

Also, be sure to select the correct network (e.g. the Ropsten test network) in order to view the correct balance.

I hope this article has revealed some of the workings of MetaMask behind the scene. Stay tuned for more articles on Ethereum and Smart Contract coming your way!

Blockchain Series — How MetaMask Creates Accounts (2024)

FAQs

How does MetaMask generate wallets? ›

MetaMask uses BIP39 to generate a seed phrase for your wallet. Your seed phrase will cover every token, address, and transaction generated by your wallet. Think of it as your backup master key. You can think of your seed phrase as a master backup of all your cryptocurrency in this wallet.

How does Blockchain connect to MetaMask? ›

There are two ways to link your MetaMask wallet to another blockchain: Using a third party like Chainlist to link the new chain to your wallet automatically. Manually inputting the data to link the desired chain to your wallet.

Why does my MetaMask have 2 accounts? ›

MetaMask will attempt to add your additional accounts where possible (assuming they were not imported) by checking your previous accounts in ascending order (i.e. Account 2, then Account 3, etc.). Accounts are added if they have a non-zero ETH balance.

What Blockchain does MetaMask use? ›

MetaMask supports tokens and NFTs on the main Ethereum blockchain and BNB blockchain (formerly Binance Smart Chain).

How does MetaMask create new accounts? ›

Here comes the interesting part. How does MetaMask create additional accounts (after the first default account)? Turns out that MetaMask makes use of the private key of the first account and use it to generate a set of child keys, which are then used to generate their respective public keys, and so on.

How MetaMask generates a new account? ›

When you create your MetaMask wallet, you will be given a Secret Recovery Phrase, and an account is automatically generated. You'll see that as your Account 1 (default account). If you'd like to create and manage multiple MetaMask accounts, you could do so simply by creating more accounts.

Are MetaMask accounts linked? ›

Conversation. All MetaMask accounts are generated from your same seed phrase, and encrypted with your same password, so if you have it backed up, you will be able to restore all the accounts you create later on. You can create any number of accounts, and switch between them freely.

Can you transfer from blockchain to MetaMask? ›

How do I transfer my existing ETH and tokens to MetaMask? You can send ETH and tokens from another wallet to a new MetaMask account. Simply copy your new MetaMask public address and go to your existing wallet or exchange to send funds to your new wallet address.

How is MetaMask connected? ›

on https://app.1inch.io/ choose 'connect wallet', accept the Terms of Service and select the first connection option - 'MetaMask'. You can now use the MetaMask internal browser for interaction with 1inch. To connect the Metamask app on your mobile phone to a browser on your desktop, use the 'WalletConnect' option.

Is each MetaMask account a wallet? ›

The first thing to understand is that, within MetaMask, each 'wallet' is actually called an 'Account'. But each account acts as a separate wallet and, most importantly, has a separate address.

Is each MetaMask account a different wallet? ›

Yes, you can have two or more Metamask crypto wallets. Within the wallet, you can create multiple addresses that function as a wallet. Each one can be imported to multiple devices as well. So you can use the same address on more than one device.

Can I use same MetaMask on 2 computers? ›

One of the benefits of using MetaMask is that you can use your 12-word Secret Recovery Phrase on multiple computer to access your ETH addresses and tokens.

Where does MetaMask store data? ›

MetaMask funds are stored in hot wallets: In order to make it as easy as possible for users to access, trade, and use their crypto, MetaMask stores all of its users' assets in hot wallets, i.e. digital crypto wallets that are perpetually connected to the blockchain.

What if MetaMask shuts down? ›

You can't get back in. There's nothing you can do. With Ethereum and other blockchains, that's not the case. As long as no one else controls your seed phrase you can always just access Ethereum (and all your digital assets) using a different piece of wallet software.

Who owns MetaMask wallet? ›

A blockchain software business focused on Ethereum-based infrastructure and tools, ConsenSys Software Inc. is the owner of MetaMask. ConsenSys developed MetaMask in 2016. Before 2019, MetaMask was only accessible as a desktop browser extension for Firefox and Google Chrome.

Why do I have so many accounts on MetaMask? ›

Please note that anyone who knows your public key can view the activity in your account. This is one reason why you may want to create multiple accounts in your MetaMask wallet. One account, whose public key you will share with others and another account, whose public key you will never share with anyone.

Are MetaMask accounts independent? ›

Metamask accounts are not compromised by giving permission to a website. The permission only allows the website to see your public address, not your private key or seed phrase.

Do all MetaMask accounts have the same private key? ›

While a Secret Recovery Phrase is used to create and restore your entire MetaMask Wallet, including all accounts created in that wallet, each account has its own private key.

Does it cost money to make a MetaMask account? ›

Known for its fox logo and colorful interface, MetaMask is a free online wallet that allows users to store and manage account keys, broadcast transactions, send and receive Ethereum-based cryptocurrencies and tokens, and securely connect to decentralized applications through a compatible web browser or the mobile app's ...

Is MetaMask tracked by IRS? ›

Metamask does not have to send any information to the IRS because Metamask is an ETH wallet, and the IRS cannot keep track of Metamask.

Can MetaMask be hacked by connecting? ›

It's always important to ensure that the site you have linked your MetaMask extension to is reputable, as accounts can be compromised through phishing if users enter their seed phrase into fake websites. If you connect to scam sites and approve the wrong privileges, they can drain your crypto wallet.

Can anyone access my MetaMask wallet? ›

If the user can get access to your password, your wallet is now available to the scammer and is likely to be drained. Even if the scammer does not use a keylogger to get your password, it is possible for a scammer to get access to the encrypted file where your seed phrase and private key is stored.

How do I avoid gas fees on MetaMask? ›

On Metamask, you can set your gas fee to “Low” before confirming a transaction. If you want to save even more gas, click on Advanced Options.

Why is MetaMask better than Coinbase? ›

Final Verdict

For example, Coinbase allows its users to run dApps via a web-based platform, while MetaMask offers hardware wallet integrations. Even though Coinbase has integrated with multiple blockchains, it cannot compete with MetaMask's ability to connect with every dApp on the Ethereum blockchain.

Can MetaMask transfer to bank? ›

MetaMask users will now be able to fund their crypto wallets via bank transfers instantly, instead of having to wait for traditional fund transfers to clear. In a blog post, ConsenSys argued that instant ACH transfers through Sardine are better than other methods for some users.

Is MetaMask linked to IP address? ›

If you are on Metamask, undoubtedly, you should know that your IP address gets logged with every transaction you make, making it possible to identify who you are and your location.

Can I have the same MetaMask wallet on two devices? ›

Yes, you can import the same MetaMask wallet on different devices. Each wallet instance is device specific, so you will have a unique password for each device and must add any RPC networks or custom tokens you have to each device.

How do I create a new MetaMask wallet with a new seed phrase? ›

The first time you're accessing it you will be asked to Create wallet or import account. You need to select “Create wallet”. Then a new seed phrase will be created, so make sure you store it safely.

Can you have MetaMask on two browsers? ›

Using different browsers

This option is as straightforward as it sounds: if you've only got two or three SRPs, then you can simply install MetaMask in several different browsers, and use a different browser for each one.

Where is my MetaMask private key? ›

Click on the account button. Go to 'Settings'. Select 'Security & Privacy'. Scroll down and then click on 'Show private key'.

Does MetaMask track your location? ›

In particular, services like MetaMask or Etherscan can read your IP address, which means linking your IP address to your wallet address. And IP addresses reveal location data.

Is MetaMask a database? ›

What is MetaMask? Public blockchains like Ethereum are the next evolution of Internet databases, and MetaMask is the next evolution of the browser. MetaMask is a web browser extension and mobile app that allows you to manage your Ethereum private keys.

Is it safe to store on MetaMask? ›

Metamask is a safe crypto storage option that stores and encrypts private keys on users' devices. Metamask allows crypto swapping within the application and offers access to the world of dApps, DeFi, and NFTs.

Why is MetaMask risky? ›

Being an online wallet, your browser will collect information about how and when you use MetaMask. This can be a potential privacy concern for cryptocurrency users. MetaMask also holds private keys in your browser. While this makes the app easier to use, it presents serious risks if your browser is hacked.

Can MetaMask freeze your wallet? ›

MetaMask will never hand over your wallet to a government entity nor will it ever freeze your wallet like Robinhood did this past spring by restricting users' GameStop equity.

Can MetaMask recover lost funds? ›

If you've been a victim of these malicious attacks, there may be a way to recover your funds. MetaMask has partnered with Asset Reality to enhance customer support by providing direct access to a third-party who can investigate, track, trace, and potentially attempt to recover funds.

Where is MetaMask banned? ›

In a statement to CoinDesk, MetaMask's parent company, ConsenSys said that it observes US. sanctions on “Iran, North Korea, Cuba, Syria, and the Crimea, Donetsk, and Luhansk regions of Ukraine.”

How many people own a MetaMask? ›

New York, NY, August 31st, 2021 — ConsenSys announced today that MetaMask now has more than 10 million monthly active users. This represents a 19x growth compared to July 2020, and positions MetaMask as the leading non-custodial wallet by users globally.

How anonymous is MetaMask? ›

MetaMask's approach to security is based on user anonymity rather than standard security measures in many aspects. MetaMask does not store any user data because the software is non-custodial. The platform does not manage private keys.

How does MetaMask generate seed? ›

In simple terms, a series of words are selected with a high level of randomness from a specific list of words. In MetaMask and many other Ethereum-compatible technologies, there are 12 words in a seed phrase. Some older seeds generated by the Brave browser, and some hardware wallets, use 24-word phrases.

How does MetaMask generate revenue? ›

MetaMask makes money from swap fees, management fees, as well as by selling merchandise via its online store. Launched in 2016, MetaMask has risen to become the world's leading Ethereum wallet. It is used by more than 21 million people across the world.

How does MetaMask work technically? ›

The MetaMask browser extension is a browser extension that can act as your Ethereum wallet. Unlike traditional wallets, MetaMask requires no additional plug-ins, so you're free to use it in any browser. Once installed, you can view your Ethereum address and send or receive coins to any Ethereum address in turn.

How does MetaMask generate public key? ›

Step 1: Log into your MetaMask account. Step 2: On your Main Ethereum Network page, click the Details button. Step 3: Click the Export Private Key button. Step 4: Enter your MetaMask password and then click Confirm.

Does each MetaMask account have its own seed? ›

Conversation. All MetaMask accounts are generated from your same seed phrase, and encrypted with your same password, so if you have it backed up, you will be able to restore all the accounts you create later on. You can create any number of accounts, and switch between them freely.

How are wallet seeds generated? ›

This means even if access to your wallet is somehow interrupted, the data representing your funds are still securely recorded on the digital ledger of the blockchain. Seed phrases are generated whenever a new crypto wallet is created, whether it's a hardware wallet, a software wallet or a web wallet.

Where does MetaMask store the wallet seed? ›

MetaMask funds are stored in hot wallets: In order to make it as easy as possible for users to access, trade, and use their crypto, MetaMask stores all of its users' assets in hot wallets, i.e. digital crypto wallets that are perpetually connected to the blockchain.

How does the IRS track MetaMask? ›

Metamask does not have to send any information to the IRS because Metamask is an ETH wallet, and the IRS cannot keep track of Metamask.

Do you have to pay taxes on MetaMask? ›

Just like these other forms of property, cryptocurrencies are subject to capital gains and losses rules, and you need to report your gains, losses, and income generated from your crypto investments on your taxes.

Does MetaMask track for taxes? ›

Does MetaMask provide a tax report? No, MetaMask doesn't provide a tax report. But you can use your MetaMask transaction history to calculate your crypto taxes and create a crypto tax report.

Is MetaMask centralized or decentralized? ›

As a decentralized wallet, MetaMask has no central authority to which you can appeal for help. It is a non-custodial wallet: you own your funds as long as you have access to them with your Secret Recovery Phrase.

Does MetaMask own your keys? ›

The difference between a custodial wallet like Coinbase and a self-custodial wallet like MetaMask is that custodial wallets have access to and take care of your private key, while with self-custodial wallets, you're responsible for them yourself.

How is a Blockchain private key generated? ›

Mnemonic codes are the most commonly used technique to generate and recover a private key in the blockchain wallet. The mnemonic code technique used in blockchain uses the word list in BIP-0039. A private key is generated by combining 12 to 24 words out of 2048 words of the BIP-0039 list as a seed.

How does MetaMask store passwords? ›

MetaMask stores the Secret Recovery Phrase, passwords, and private keys in an encrypted format locally on the device where it's installed.

Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 6285

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.