MetaMask provides you with a unique 12-word Secret Recovery Phrase on the very first launch. If you did not write it down, or you lost it, you can unlock MetaMask and reveal your Secret Recovery Phrase.
OK, we've all been there; you write down your Secret Recovery Phrase, you're double, triple sure that it's the right one, and then your cat pushes your laptop off the table and the screen cracks, so you get a new laptop and go to install MetaMask and re-import your wallet... and you realize that's your old Secret Recovery Phrase, that you migrated off of last year.
So... Your SRP, and all your tokens, and all your stuff, is gone. Right? Maybe not. If you can plug that old hard drive into your computer and access it, by following the instructions below you may be able to recover it.
Maybe it wasn't a cat. If, for whatever reason, you cannot unlock MetaMask using your password, there may still be a possibility of recovering your Secret Recovery Phrase. Follow these instructions, and if you get stuck, start a conversation with our Support agents.
This article is to be used under the following circumstances:
- You do not know your Secret Recovery Phrase
- You know your password
- For some reason you are unable to unlock MetaMask with your password
This article provides instructions for Secret Recovery Phrase recovery on the desktop (MetaMask Browser Extension) and MetaMask Mobile on iOS.
Note: Vault recovery on Android mobile devices is not currently possible; additionally, if you have uninstalled the MetaMask extension, your data has likely been deleted. However, you may attempt the method below, under the heading "What if you no longer have access to the browser...?," especially if you have a backup of your computer's data.
A few things before we begin...
- We know that potentially losing access to MetaMask and your assets is stressful — that's why we've put this content together, so that you might be able to resolve that stress. We wish we could do more, but MetaMask is self-custodial by design. We're rooting for you though!
- We do our best to keep these instructions up to date, but since they depend in part on the back end of third-party platforms (the browsers), sometimes things may have changed relative to what we describe below. If so, please let us know by getting in touch with Support.
- This is not a simple process, so make sure you set aside roughly 30 minutes and that you're in a location where you can focus. If you get stuck, get in touch.
- The final step of the process, once you've recovered your SRP, will be to restore your wallet. Keep in mind that MetaMask stores only one SRP per browser profile at a time, and importing an SRP into an existing MetaMask installation wipes any SRP data already present in that profile's vault.
- If you're only managing one SRP, then this isn't really an issue; if you're managing multiple SRPs, however, we strongly recommend you follow our best practices outlined here.
Vault Extraction Instructions
Chrome-based browsers:
(includes Chrome, Brave, Edge, and Opera)
- Right-click on the MetaMask Extension window (or, if you have MetaMask open in expanded view in a tab, right-click anywhere on the page: chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html). Click on 'Inspect' to open the Web Inspector.
- Go to the Console tab to type this command, and press enter or return (you can copy+paste the command below):
chrome.storage.local.get('data', result => {
var vault = result.data.KeyringController.vault
console.log(vault)
})
- This should return a result that begins " {"data": ". This is the vault data (which is in JSON format).
- Copy it to your clipboard.
- Proceed to the Vault Decryptor that you can find in the link below and also see the open-source code at GitHub:
https://metamask.github.io/vault-decryptor/
This Vault Decryptor tool can also be used offline, you just need to use your browser's tool bar > File > Save page as... > MetaMask Decryptor.htm. Then open the MetaMask Decryptor.htm file in your browser with your computer disconnected from the Internet.
- On the Vault Decryptor page, paste the {"data":} part of the vault data and use the password you set for your wallet in the MetaMask Extension and click the "Decrypt" button.
- If successful, you'll see the result below the Decrypt button showing the "mnemonic" 12 Word English Secret Recovery Phrase, along with any other imported "Simple Key Pair" (private key).
You can now use the Secret Recovery Phrase (and private keys) to restore your MetaMask wallet.
We urge you strongly to make sure that you always back up your Secret Recovery Phrase, and any manually imported private keys, so this never happens again.
Firefox:
In Firefox you may need to have the MetaMask extension opened in 'Expanded view' to be able to open the 'Inspect Element' or Web Inspector. Check out this video and follow the instructions below:
Open a new tab in Firefox and enter the following in order to find the extension's UUID (Universally Unique Identifier):
about:debugging#addons
You should be able to see the UUID of the MetaMask extension. Copy it to add it to the following URL (without the spaces):
moz-extension://<your-UUID-here>/home.html
This will open the MetaMask wallet in a browser tab in Firefox.
- Right-click on the MetaMask wallet that's opened in the full-view tab to see the options
- Click the 'Inspect Element' option
- In the opened window, go to the Console tab
- Enter this command in the Console and click enter or return (you can copy+paste the following command):
chrome.storage.local.get('data', result => {
var vault = result.data.KeyringController.vault
console.log(vault)
})
- This should return a result that begins " {"data": ". This is the vault data (which is in JSON format).
- Copy it to your clipboard.
- Proceed to the Vault Decryptor that you can find in the link below and also see the open-source code at GitHub:
https://metamask.github.io/vault-decryptor/
This Vault Decryptor tool can also be used offline, you just need to use your browser's tool bar > File > Save page as... > MetaMask Decryptor.htm. Then open the MetaMask Decryptor.htm file in your browser with your computer disconnected from the Internet.
- On the Vault Decryptor page, paste the {"data":} part of the vault data and use the password you set for your wallet in the MetaMask Extension and click the "Decrypt" button.
- If successful, you'll see the result below the Decrypt button showing the "mnemonic" 12 Word English Secret Recovery Phrase, along with any other imported "Simple Key Pair" (private key).
You can now use the Secret Recovery Phrase (and private keys) to restore your MetaMask wallet.
We urge you strongly to make sure that you always backup your Secret Recovery Phrase, and any manually imported private keys, so this never happens again.
What if you no longer have access to the browser but still have access to the computer's files? (Chrome-based browser and Windows or Mac)
If your computer has crashed and you no longer are able to use Chrome browser or if you've been able to recover your computer files using some backup software, you may still be able to get the encrypted Vault from that backup.
In Windows 10, you should be able to find the location of the Vault by going to this folder location (you need to be able to see the hidden files):
C:\Users\USER_NAME\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\nkbihfbeogaeaoehlefnkodbefgpgknn
On a Mac, the location of the folder should be:
Library>Application Support>Google>Chrome>Default>Local Extension Settings>nkbihfbeogaeaoehlefnkodbefgpgknn
- If you're having trouble finding this location, try the following:
- Open a Finder window.
- Select Go -> Go to Folder... in the menu bar.
- Type ~/Library in the input field and click Go.
In that folder you'll see a file called 000003.ldb or something similar--the number doesn't matter, you're looking for .ldb files. Open that file with a text editor or code editor software like Atom (https://atom.io/) or sublimetext. Note: The screenshot below says file type 'text document' because it was already opened with a text editor.
Once you've opened the file, search for the word "keyring". There will be a dense block of text following it (if using SublimeText, it might be easier to view it by clicking on "View" and "Enter Distraction-Free Mode"), which looks like this:
This is your vault data; however, we will need to re-format certain parts of it in order to be able to decrypt it: We'll need to make sure you have the "data", "iv", and "salt" sections properly labelled.
In order to do this, we'll need to copy-paste your vault data to a new text editor file. Look at the section following "Keyring" in the text. There's a section that reads {\"???'<0x04>\". That's the beginning of your vault data. Now look for the word "salt". Following "salt" there's a long string of alphanumeric characters in quotation marks, and that section ends with =\"} . That's the end of your vault data, so copy from the opening curly bracket following "Keyring" to the closing curly bracket following the alphanumeric characters after "salt", and paste into a new text editor document.
Whew! Now's the easy part. I promise.
"data":
You already saw this part of the text: {\"???'<0x04>\" Keep in mind that yours might look a little different; it might be a different code between the triangle brackets, for example. In any case, make this part of the text look like: {"data"
"iv":
This isn't always changed; in the screenshot above, for example, they're functional as-is. If your code looks like that, you're good to go!
"salt":
Like with "iv", look to make sure "salt" looks like it does in the screenshot above. Additionally, make sure that the entire text block ends like this: ="} not like this: =\"}"}
remove slashes:
Use the Search and Replace feature of the editor to change all the \" to " (removing them):
You would now have something like this:
{"data":"wwpXXtFCqZkYsWfeEwItZjJ0Cc7mRVjG47Dqh+ztL1PiCG6Izhg+zG0mM+H2ykyjz3X0RNhAE6IVsWFZamcZ47B4sVi4SvUxrMhARm5L3yHPxr3UsyGrOXmthyVMgEGmjwlmnFCNd2nMZ2o8/sRMra8FupurqevnBv57FiYpEEs7gPpFHv6587aL44MmKD8Snv4JLFqiqmlK82Waq5F+Iv9mw2sFVAL9mgZBSgFgbWdB3TsKVB2k","iv":"rkUQlNcGTxBE0My7a/bCXw==","salt":"HcKyNfGzaRALRQ0DlKgcIe5Uk30iI/M//oG6w8vX8Nk="}
- Note: upon opening the .ldb file in sublimetext, you may get thousands of lines of something that looks like the following:
If this is the case, click on File>Reopen with Encoding>UTF-8. At this point, you can search for "vault" and find the data you need.
OK! That's it! You're ready to decrypt!
You can now go to the Vault Decryptor (https://metamask.github.io/vault-decryptor/) and paste the vault data there, then enter the password you set for the extension when you created your MetaMask wallet. You should be able to see your secret Seed Phrase / Secret Recovery Phrase and any manually imported private key below if you click the Decrypt button.
In order to recover your vault data, you will need:
- You must have had iCloud backup enabled in your iCloud settings while the app was being used.
- The password that was used on MetaMask Mobile when the vault was created (or restored on that device)
- MacOS running on a separate computer or laptop, other than the mobile device in question
- An app capable of displaying JSON data in a readable fashion. You may need to download one, for example: https://imazing.com/download/macos
- A WiFi connection or the appropriate cable to sync your phone and your computer
Procedure
- Connect the mobile device to the computer, either via wifi or a physical cable, so that the mobile device appears in your Finder.
- Search for the word "KeyringController"
- Copy and paste that JSON object into a new document. It will look something like this:
- {\\\\\\\\\\\\"cipher\\\\\\\\\\\\":\\\\\\\\\\\\"JaX8Z80QMzzqA4XMgPsUuleNLIuxvchXZ5q1SO9GO1kuNUmokUke06op9EF0ZU4WXsILfUZ0yKI5kjzYY9H12t5aGb43BOAWJwlKuC8neXWeL5enoD/L05eDC9tzZEBupLwF7cGG6JdPHHQKdRDWWbQM+TUo6EvZv7LClPZQVJ17uowGvPMPB0UwfPea7DP/dE5DYleHmX1rhxAJr1YN4HUPAYpCCReU4W4/2QsaM+E=\\\\\\\\\\\\",\\\\\\\\\\\\"iv\\\\\\\\\\\\":\\\\\\\\\\\\"dcabe6ed590ae3ee8e056c7844c58047\\\\\\\\\\\\",\\\\\\\\\\\\"salt\\\\\\\\\\\\":\\\\\\\\\\\\"h6IkHlWjloB9c9+KiGgYvQ==\\\\\\\\\\\\",\\\\\\\\\\\\"lib\\\\\\\\\\\\":\\\\\\\\\\\\"original\\\\\\\\\\\\"}
- Back up the mobile device as per the instructions here under 'Backup your iPhone using your Mac'. We recommend using the encrypted option, and making a note of the password for later.
- Select Manage Backups
- Show in Finder
- Drag the backup folder into the iMazing app, or whichever app you're using to read the backup. This is the point at which you'll need your password if you encrypted the backup.
- In the backup tool, navigate to Apps->MetaMask->Documents->persistStore->persist-root
- Open the persist-root file. It will be a lengthy file in JSON format.
- Modify the object to reflect the example below (manually remove all \\\ and ensure there are no white spaces):
- {"cipher":"JaX8Z80QMzzqA4XMgPsUuleNLIuxvchXZ5q1SO9GO1kuNUmokUke06op9EF0ZU4WssILfUZ0yKI5kjzYY9H12t5aGb43BOAWJwlKuC8neXWeL5enoD/L05eDC9tzZEBupLwF7cGG6JdPHHQKdRDWWbQM+TUo6EvZv7LClPZQVJ17uowGvPMPB0UwXPea7DP/dE5DYleHmX1rhxAJr1YN4HUPAYpCCReU4W4/2QsaM+E=","iv":"dcabe6ed590ae3ee8e056c7844c583d7","salt":"h6IkHlWjloBgc9+KiGTYvQ==","lib":"original"}
- Now you can copy the vault payload into the mobile app.
- Start up the MetaMask app on your iPhone and go to the Wallet Setup screen select “Import using Secret Recovery Phrase”
- In the Import using Secret Recovery Phrase screen, you can paste the vault into the seed phrase text box and then the password you want to try to unlock the vault in the password text boxes (passwords have to be the same). This is the password that was used when this vault was created or restored on this device. If the vault can be decrypted by the password, your wallet will be successfully set up.
- Import using Secret Recovery Phrase (example image):
- On successful setup of your wallet you should REMEMBER to back up your seed phrase after your wallet is set up.