input-output-hk / daedalus

The open source cryptocurrency wallet for ada, built to grow with the community
https://daedaluswallet.io/
Apache License 2.0
1.24k stars 295 forks source link

How can I restore wallet from secret.key file? #1234

Closed yuelipeng closed 3 years ago

yuelipeng commented 5 years ago

when i heard 0.12 version has low disk usage, i just copy my secret.key out, i thought it is the keystore like ethereum. then i delete the old 0.11.2 version's daedalus folder。 when i finished sync of 0.12, i copy secret.key into Secrets-1.0 folder, it can't identify.

i lost my 12 words phase unfortunately。so how can i restore wallet from secret.key file, please.

nikolaglumac commented 5 years ago

Hi @yuelipeng,

This is going to be a bit tricky but here's what you need to do:

  1. Uninstall your current Daedalus installation and delete your state directory (on Windows this directory is in C:\Users\<username>\AppData\Roaming\Daedalus, while on OSX it is in ~/Library/Application\ Support/Daedalus).
  2. Download and install previous Daedalus version 0.11.2 from one of the following links (depending on your platform):
  3. Run Daedalus and before it syncs go to application menu View > Toggle Developer Tools (like shown on the screenshot below - my screenshot is taken on OSX but this looks almost the same on Windows)
  4. You will then see the developer tools in your Daedalus window and you should click the 2nd tab "Console".
  5. Then type the following command in the Console window: daedalus.api.ada.importWalletFromFile({ filePath: 'path-to-secret-file/secret.key' }); (but be sure to provide the correct path-to-the-secret-file) and simply hit "Enter" key.
  6. Wait for Daedalus to fully sync - upon which you should see your wallet in the wallets menu.
  7. Create a new wallet (and please write down your mnemonic phrase this time 😄) and transfer all your ADA from the salvaged wallet into this one so that you can easily restore it in the future (restoring from secret.key file was never officially supported and it is no longer present in the latest Daedalus version 0.12.0 - which is why you need to use the older Daedalus version to salvage your wallet).
  8. Daedalus will eventually show the update notification and then you will be able to automatically update it to the latest 0.12.0 version.

instructions

Hope this heps! :)

nikolaglumac commented 5 years ago

@yuelipeng I have originally posted wrong links to the previous Daedalus installers - please use the ones from my comment which I have now updated. Thanks!

yuelipeng commented 5 years ago

i'm in mac too. this secret.key is created at early 2018 not 0.11.2. and i have tried 0.11.1, 0.11.2 and 0.9.0 all shows error , but i think my file path is right, because it add a secret.key.lock file automatically.

image

nikolaglumac commented 5 years ago

@yuelipeng did you have a spending-password set for this wallet of yours?

yuelipeng commented 5 years ago

@nikolaglumac yes, password protected.

nikolaglumac commented 5 years ago

@yuelipeng so the problem is your wallet's secret.key file is encrypted and therefore it can not be imported using the steps I have described in my first comment. I'll investigate if there is something else we could try.

nikolaglumac commented 5 years ago

@yuelipeng did you save any other files from the state directory besides the secret.key one?

yuelipeng commented 5 years ago

@nikolaglumac no

nikolaglumac commented 5 years ago

@yuelipeng unfortunately, there is no easy way to extract a wallet.key file out of the secrets.key you have. Still, there is no reason for despair as @cleverca22 is working on a util app which will make this extraction possible. Once this util is ready @cleverca22 will update this thread and you will then be able to use the extracted wallet.key for importing in the latest Daedalus version.

yuelipeng commented 5 years ago

@cleverca22 when will this extraction util app be done, you can just build a command line tool to decode.

webmacho commented 5 years ago

This is what I need because when I instaled the new daedlus instance year after this instance used wallet that I don't have password for it so it never asked me for 12 words phrase to write down, I have sen't funds and downloaded paper wallet instuctions I tought that was it but money is now stuck in old wallet from what I don't have a password or phrase

webmacho commented 5 years ago

@cleverca22 when will this extraction util app be done, you can just build a command line tool to decode.

that is it, with decryption we could see our wallet password and send it to another wallet

webmacho commented 5 years ago

OMG I found my old 12 word phrase now, lucky as hell

nikolaglumac commented 5 years ago

@webmacho writing down your 12 words recovery phrase during wallet creation is the most important step. Having those 12 words protects you from all potential issues - it can save you even if you forget your spending-password. It is very unfortunate that you forgot this phrase...

I have sen't funds and downloaded paper wallet instuctions I tought that was it but money is now stuck in old wallet from what I don't have a password or phrase

I believe you did not understand the paper-wallet feature. The idea behind it is that Daedalus generates a new wallet (which is in no way connected to any of the existing wallets you have in Daedalus) and then you can send ada from your other wallets to the wallet address listed on the paper wallet PDF.

Anyways, in order to recover your wallets from the secret.key file stored on your machine you will have to use a special Daedalus version (which hasn't been released yet) - here are the installers: Linux - https://ci-output-sink.s3.amazonaws.com/csl-daedalus/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-x86_64-linux-5014.bin macOS - https://ci-output-sink.s3.amazonaws.com/csl-daedalus/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-macos-5014.pkg Windows - https://ci.appveyor.com/api/buildjobs/cmr8q837771p8rh4/artifacts/installers/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-windows-12744.exe

...and then follow these steps:

Using Daedalus "Wallet importer" tool

  1. Salvage/save secret.key file from the previously used Daedalus installation by copying it to a safe location. This file can be found in the state directory:

    Windows: C:\Users[your user name]\AppData\Daedalus\Secrets-1.0\secret.key
    macOS: ~/Library/Application Support/Daedalus/Secrets-1.0/secret.key
    Linux: ~/.local/share/Daedalus/mainnet/Secrets/secret.key

  2. Uninstall any existing Daedalus installation and delete the state directory:

    Windows: C:\Users[your user name]\AppData\Daedalus\
    macOS: ~/Library/Application Support/Daedalus/
    Linux: ~/.local/share/Daedalus/mainnet/

  3. Install a special Daedalus edition (links provided above).

  4. Wait until Daedalus is fully synced and the main UI shown.

  5. Once the main UI is shown navigate to the "Wallet Importer" screen using application menu "Daedalus > Wallet Importer".

  6. Use the file-input field shown on the screen to open secret.key file salvaged from the previous Daedalus installation (described in step No. 1).

  7. Daedalus will extract wallets from the submitted secret.key file and show the list of discovered wallets.

  8. For each of the discovered wallets you will be able to see it's balance and whether or not it is protected by a spending password.

  9. All the wallets that haven't been protected by a spending password can be imported right away (note: wallet import process takes between 30 and 120 minutes depending on the machine speed and there can be only one active import process at the time).

  10. Use the "Passwords list" field to enter a list of up to 20 potential spending passwords and then click the "Match passwords" button in order to match them to your wallets.

  11. You can repeat step No. 10 until all the wallet passwords are matched.

  12. All the wallets you import using this tool will no longer be protected by a spending password which will enable you to transfer your ada to another wallet.

This will resolve your issues too @yuelipeng.

Good luck!

yuelipeng commented 5 years ago

@nikolaglumac thanks for the improvement. But after i selected the secret.key, it shows "Wallet could not be imported, please make sure you are providing a correct file". i didn't modified the file.

nikolaglumac commented 5 years ago

@yuelipeng I believe you used the "Import dialog" from the "Add wallet" screen and this is not something you can do with the "secret.key" file. You have to use the new screen - the one you can navigate from the application menu -> "Daedalus > Wallet importer".

yuelipeng commented 5 years ago

@nikolaglumac ok, my fault, restoration is in progress, thanks.

yuelipeng commented 5 years ago

@nikolaglumac thanks, it's already recovered.

nikolaglumac commented 5 years ago

Wonderful news @yuelipeng 🎉

Aleksaleks1970 commented 5 years ago

Thank you guys for your work. You helped me get my money back!

GeekFinity commented 5 years ago

Now a day, Yoroi should be able to restore a wallet from a Daedalus un-encrypted master key. Does anyone know a console command in Daedalus to decrypt the encrypted master key (secret.key)?

Thanks

icyak commented 4 years ago

any possibility how to recover wallet from secret.key ?

sohosynergy commented 4 years ago

nikolaglumac,

I tried to download the app you referenced below but the link is dead and I am trying your solution to recover my wallet.

Windows - https://ci.appveyor.com/api/buildjobs/cmr8q837771p8rh4/artifacts/installers/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-windows-12744.exe

@webmacho writing down your 12 words recovery phrase during wallet creation is the most important step. Having those 12 words protects you from all potential issues - it can save you even if you forget your spending-password. It is very unfortunate that you forgot this phrase...

I have sen't funds and downloaded paper wallet instuctions I tought that was it but money is now stuck in old wallet from what I don't have a password or phrase

I believe you did not understand the paper-wallet feature. The idea behind it is that Daedalus generates a new wallet (which is in no way connected to any of the existing wallets you have in Daedalus) and then you can send ada from your other wallets to the wallet address listed on the paper wallet PDF.

Anyways, in order to recover your wallets from the secret.key file stored on your machine you will have to use a special Daedalus version (which hasn't been released yet) - here are the installers: Linux - https://ci-output-sink.s3.amazonaws.com/csl-daedalus/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-x86_64-linux-5014.bin macOS - https://ci-output-sink.s3.amazonaws.com/csl-daedalus/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-macos-5014.pkg Windows - https://ci.appveyor.com/api/buildjobs/cmr8q837771p8rh4/artifacts/installers/daedalus-0.13.0-cardano-sl-3.0.0-mainnet-windows-12744.exe

...and then follow these steps:

Using Daedalus "Wallet importer" tool

  1. Salvage/save secret.key file from the previously used Daedalus installation by copying it to a safe location. This file can be found in the state directory:

Windows: C:\Users[your user name]\AppData\Daedalus\Secrets-1.0\secret.key macOS: ~/Library/Application Support/Daedalus/Secrets-1.0/secret.key Linux: ~/.local/share/Daedalus/mainnet/Secrets/secret.key

  1. Uninstall any existing Daedalus installation and delete the state directory:

Windows: C:\Users[your user name]\AppData\Daedalus\ macOS: ~/Library/Application Support/Daedalus/ Linux: ~/.local/share/Daedalus/mainnet/

  1. Install a special Daedalus edition (links provided above).
  2. Wait until Daedalus is fully synced and the main UI shown.
  3. Once the main UI is shown navigate to the "Wallet Importer" screen using application menu "Daedalus > Wallet Importer".
  4. Use the file-input field shown on the screen to open secret.key file salvaged from the previous Daedalus installation (described in step No. 1).
  5. Daedalus will extract wallets from the submitted secret.key file and show the list of discovered wallets.
  6. For each of the discovered wallets you will be able to see it's balance and whether or not it is protected by a spending password.
  7. All the wallets that haven't been protected by a spending password can be imported right away (note: wallet import process takes between 30 and 120 minutes depending on the machine speed and there can be only one active import process at the time).
  8. Use the "Passwords list" field to enter a list of up to 20 potential spending passwords and then click the "Match passwords" button in order to match them to your wallets.
  9. You can repeat step No. 10 until all the wallet passwords are matched.
  10. All the wallets you import using this tool will no longer be protected by a spending password which will enable you to transfer your ada to another wallet.

This will resolve your issues too @yuelipeng.

Good luck!

nikolaglumac commented 4 years ago

@sohosynergy the links have probably expired... @disassembler @cleverca22 is there any way for us to restore these installers?

mondonet commented 4 years ago

Links are not working....can you provide us with other working links?

mondonet commented 4 years ago

My story....i upgraded to a bigger hard drive and install new windows operating system on the new hard drive...then i connect the old one to transfer all my files and when i look at the files on my old hard drive i can see all the scrennshot .png files in there but i can't open it. One of those .png files was my 12 seed words to my mainnet Daedalus wallet. However i'm able to restore the incentivized testnet yoroi wallet with the 15 seed words. My only option is to figure out how to restore it with the secret.key file which by the way appears to be encrypted. If anyone knows a solution to this problem please help us and post it here. Thanks in advance.

mondonet commented 4 years ago

The links above not working... there's any way we can restore Daedalus with the secret key file. Any help is highly appreciated.

Ugosha commented 4 years ago

The problem is still actual. Need to recover my secret.key to. Please update links above (Windows version). Thanks a lot!

nikolaglumac commented 4 years ago

Hi @mondonet and @Ugosha, The links are unfortunately expired (the installers were automatically deleted from the S3 bucket after 6 months)... We need to re-create this special build on the CI in order to provide the new links. This is something that requires time and effort as our build setup has changed a lot. Still, we will do our best to get the new links and keep you in the loop. Thank you for your patience and understanding!

Ugosha commented 4 years ago

I tried to set up linux version on mint linux. But wallet can not sync over 98.44%. No further progress. Reboot did not help. There is restart Cardano node option on Network status page. This did not help too.

The wallet importer option is not active.

nikolaglumac commented 4 years ago

@Ugosha unfortunately this build is not able to fully sync as it lacks support for OBFT fork which was recently activated.

Ugosha commented 4 years ago

Is there any build that works correctly?

nikolaglumac commented 4 years ago

Not with this wallet importer feature which was a custom build.

Ugosha commented 4 years ago

I still hope there will be working build. Secret.key file this is all i have. No 12 or 27-words recovery seed.

nikolaglumac commented 4 years ago

Please be patient - we will find a way to resolve this issue and help you get to your ada.

Ugosha commented 4 years ago

Thank you for your help!

Ugosha commented 4 years ago

Any updates about this?

Dave-bit1 commented 4 years ago

I also need to restore from secret.key file. Please help us out!

nikolaglumac commented 4 years ago

Hi @Ugosha and @Dave-bit1 👋 We will release an "Import from secret.key" feature in one of the upcoming Daedalus Flight releases. You will soon be able to restore your wallets. Thank you for your patience!

nikolaglumac commented 4 years ago

Hi @Ugosha @Dave-bit1 @mondonet @icyak! In order to recover your wallets from the secret.key file please download the latest Daedalus Flight from the official Daedalus website: https://daedaluswallet.io/en/flight/

Daedalus Flight is our new community testing program. You can learn more about it here: https://t.co/PfHvSEpgOm?amp=1

This version of Daedalus connects to the mainnet and can be run alongside your existing Daedalus version. It contains a "Wallet import" feature which imports wallets from mainnet Daedalus state directory OR a directory of your choice which contains your secret.key file within a subdirectory named Secrets-1.0 on Windows and macOS or just Secrets on Linux. In order for Daedalus Flight to extract wallet names you should also have a Wallet-1.0-acid folder from your previous Daedalus mainnet state directory.

Directory structure is very important here. Please make sure you select the folder which has:

SELECTED-DIRECTORY
       |
       |
       Secrets-1.0
       |       |       
       |       |       
       |       secret.key
       |
       |
       Wallet-1.0-acid

* Wallet-1.0-acid is not mandatory and the wallet import feature will work without it but it will not be able to detect wallet names!

If you have mainnet Daedalus installed, Daedalus Flight will automatically start the wallet import process on first start. If that doesn't happen (e.g. if you don't have Daedalus installed but you have your secret.key file stored in a different directory) you can use the manual "Wallet import" option which can be found on the "Add wallet" screen:

1

Once you activate the "Wallet import" feature you will see the first import step:

2

Please select the folder which contains your Secrets-1.0/secret.key and/or Wallet-1.0-acid directories and click on "Import wallets" button upon which Daedalus will try to extract wallets and if they are found you will see the following screen:

4

In case you did not have a valid Wallet-1.0-acid directory within the directory you used in the previous step you will not get to see your wallet's names and will need to enter names in this step before you can import these wallets. Select the wallets you wish to import and click on the "Import selected wallets" button. The import process is very fast and after closing this overlay you will have all your wallets in Daedalus Flight 🎉

Good luck!

darko-mijic commented 4 years ago

Thanks @nikolaglumac! @Ugosha and @Dave-bit1, please get back to us and let us know did you manage to do the import successfully. Thanks! :)

Ugosha commented 4 years ago

You guys did a great job!

Fortunately, I was able to find the previous installation. And finally got back my tokens. Is there any way to make donation to your community?

Thanks a lot!

nikolaglumac commented 4 years ago

@sohosynergy FYI this could help you too: https://github.com/input-output-hk/daedalus/issues/1234#issuecomment-615855129

nikolaglumac commented 4 years ago

You guys did a great job!

Fortunately, I was able to find the previous installation. And finally got back my tokens. Is there any way to make donation to your community?

Thanks a lot!

Very glad to hear that @Ugosha 🎉 Knowing we helped you get your ada back is rewarding enough for us :)

dralefoy commented 4 years ago

Can someone please clarify the process if you do not have your spending password or 12 phrase. Is it possible?

jmevel commented 4 years ago

OMG I can't believe it, I finally have access to my Ada again!!! What a great day 😀

Thanks a lot to the developers, you did a great job. This feature was quite awaited I think

nikolaglumac commented 4 years ago

Can someone please clarify the process if you do not have your spending password or 12 phrase. Is it possible?

@dralefoy this feature will help you if you have a Daedalus state directory OR a secret.key file. However, the wallets will still be password protected in case the password was previously set.

dralefoy commented 4 years ago

I have a previous password. Do not know previous password. Should I import or just delete and forget?

nikolaglumac commented 4 years ago

I have a previous password. Do not know previous password. Should I import or just delete and forget?

@dralefoy you can still import your wallet but you won't be able to move the ada without knowing the correct password :( You can "reset" the password only if you know your 12-word recovery phrase.

Hitch33 commented 4 years ago

Good day @nikolaglumac. I see how helpful you have been and wanted to see if you might help me. In the early days of crypto, I purchased ADA and moved it to Daedalus wallet. I created an additional wallet and my 2017/2018 self thought the passphrase was good for both. So I have access to half of my ADA. Thankful for that at least! So I have followed instructions here and downloaded Flight. I set the path to the appropriate state directory and I'm receiving "No wallets found. Make sure you have selected a Daedalus state directory which contans the 'Secrets' or 'Secrets-1.0' folder with a 'secret.key' file inside"
All of the required files are in the appropriate folders, not sure what I'm doing wrong or if maybe my secret key was updated when I accessed the wallet that I have a passphrase for. It looks as though the secret.key was updated on 4/27 when I downloaded Daedalus yesterday before downloading Mainnet. Any help would be appreciated. If not, Rip ADA. By the way, 2020 hitch has several paper copies of all wallets.. 2017 Hitch was a dipshit. : )