How to recover your Secret Recovery Phrase

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. Plug in the old laptop's hard drive to a USB adaptor and...

...it's time to become what you've always wanted to become:
hackerman.gif
(or hackerperson, I guess, they really need to update that meme)

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:
1. You do not know your Secret Recovery Phrase
2. You know your password
3. 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.

 

Extension iOS Android

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.

Chrome popup logs.png

  • 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).

Recover vault data Chrome

  • 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).

Vault decryptor tool

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.

screenshot_vault_location.PNG

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:


mceclip0.png

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):

 

mceclip2.png

 

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:

    mceclip0.png

    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.

 

 

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.

Articles in this section