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.23k stars 296 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 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. : )

@Hitch33 please make sure to download the Daedalus 1.0.0 mainnet version: https://daedaluswallet.io/en/download/ and then point the "Wallet import" to the old Daedalus state directory OR point it to the secret.key file. Please let me know if that worked!

Hitch33 commented 4 years ago

@nikolaglumac Unfortunately no. Tried the Daedalus state directory approach and received: No wallets found. Make sure you have selected a Daedalus state directory which contains the 'Secrets' or 'Secrets-1.0' folder with the 'secret.key' file inside. (The Daedalus directory has both folders.) also tried secret.key file approach and received: No wallets found. Make sure you have selected a valid secret.key file.

Thanks for the help.

nikolaglumac commented 4 years ago

@Hitch33 are you running Daedalus Mainnet 1.0.0. on the same machine where you had the old Daedalus 0.15.1? I didn't get if you managed to successfully import wallets from this old Daedalus state directory / secret.key in Daedalus Flight earlier?

nikolaglumac commented 4 years ago

Closing this issue since Daedalus Mainnet 1.0.0 includes wallet import feature.

kevinyuenhk commented 4 years ago

My case was a complete careless mistake, I format my disk and reinstalled MacOS, and after 1 month I noticed that my Daedalus didn't do the backup and I removed the entire time machine backup in my backup disk as well....

At the end I paid for EaseUS (I used it to recover my time machine backup) and I found my entire Daedalus directory, but after I followed the step and import my secret.key, I also get "No wallets found. Make sure you have select....", I am not sure if the file was broken during recovery or I did anything wrong...

nikolaglumac commented 4 years ago

My case was a complete careless mistake, I format my disk and reinstalled MacOS, and after 1 month I noticed that my Daedalus didn't do the backup and I removed the entire time machine backup in my backup disk as well....

At the end I paid for EaseUS (I used it to recover my time machine backup) and I found my entire Daedalus directory, but after I followed the step and import my secret.key, I also get "No wallets found. Make sure you have select....", I am not sure if the file was broken during recovery or I did anything wrong...

@kevinyuenhk there are only 3 potential reasons for such results:

  1. The secret.key file within the Secrets-1.0 folder is corrupted
  2. The secret.key file is missing
  3. The backup you got contains the version of the secret.key file before you created your wallet and thus it is indeed empty.
Scripted20 commented 4 years ago

Any idea why the import button is grayed out for me? https://i.imgur.com/gbfn9cq.png

Pjanssen commented 4 years ago

@Scripted20 I've got the same issue. Trying to import my old wallet which used a Ledger from the previous version. Button is greyed out and I can't seem to get it to work... I'm using OSX by the way.

nikolaglumac commented 4 years ago

@Scripted20 @Pjanssen the import feature has been temporarily disabled since Daedalus 2.0.0 and will be re-enabled once the import tool is updated by the cardano-wallet team. I don't have any ETA for that but I suggest you safely store the complete old Daedalus state directory (including the secret.key file) so that you can use it once the feature is made available again.

Thanks!

wladjka commented 4 years ago

Does the method still work with the new Mainnet? I lost my recovery phrase, but found the secret.key file and a secret.key.lock

i followed the steps, unfortunately it didn't work. Did I do something wrong or is it no longer working?

wladjka commented 4 years ago

Ok I just read it in the other forum "Lost Passwords to my Wallet (PLEASE HELP) #2123" means if I have the secret.key and the password then it will be possible to enter deadalus mainnet in the future?!

wladjka commented 4 years ago

is there a program I can use to open the file secret.key? I tried a few but unfortunately none worked.

nikolaglumac commented 4 years ago

Ok I just read it in the other forum "Lost Passwords to my Wallet (PLEASE HELP) #2123" means if I have the secret.key and the password then it will be possible to enter deadalus mainnet in the future?!

Correct.

wladjka commented 4 years ago

Ok I just read it in the other forum "Lost Passwords to my Wallet (PLEASE HELP) #2123" means if I have the secret.key and the password then it will be possible to enter deadalus mainnet in the future?!

Correct

Thank you. How do I know when I can import the file?

nikolaglumac commented 4 years ago

Ok I just read it in the other forum "Lost Passwords to my Wallet (PLEASE HELP) #2123" means if I have the secret.key and the password then it will be possible to enter deadalus mainnet in the future?!

Correct

Thank you. How do I know when I can import the file?

We will announce this in Daedalus release notes of the version that will have this feature re-enabled.

srdjan commented 3 years ago

any updates on scheduling for this feature ?

nikolaglumac commented 3 years ago

any updates on scheduling for this feature ?

Unfortunately, not yet 😞

Vladimirmaslo90 commented 3 years ago

Hi @nikolaglumac

Thanks a lot for helping all those people who were able to restore their wallets when it was possible :) Yesterday I faced the same situation when I opened my very old Daedalus wallet (v. 1.0.3619) and 'Connecting to network' just never ends. So I guess based on all the read thread above I'm waiting for enabling again 'Import feature' for recent Daedalus Mainnet, correct? Any predictions when it would be possible to get? Really important for me

One more time thanks for helping the community with our problems :)

Kind Regards, Volodymyr

nikolaglumac commented 3 years ago

Hi @Vladimirmaslo90! Sorry to hear you are facing the same issues... The import feature we had was working only for importing Daedalus 0.15 and earlier versions to Daedalus Mainnet (1.0.0 and newer). The cardano-wallet team is working on adding the import feature for both importing:

skazichris commented 3 years ago

Hello,

I saw the article about ending support for 0.15.1 on windows 7. https://iohk.zendesk.com/hc/en-us/articles/900001248006-Discontinuing-Daedalus-Mainnet-0-15-1-ending-support-for-Windows-7-and-8-0

I upgraded to windows 10 and I still see a red screen saying that I should upgrade my wallet. I downloaded newest version of daedalus wallet (2.4.1), installed it, but I do not have my recovery phrase from old wallet - never needed to provide it. The wallet was simply working, and I was checking it from time to time (rarely).

Few months ago, 0.15.1 was opening just fine and showing my ADA in the wallet. Since few days, not working -> red screen saying upgrade...

You should first provide means for transferring from old wallets before you cut out users of the older software, don't you think?

How do I recover my funds now from 0.15.1?

I still have this: Preferences Secrets-1.0 Wallet-1.0-acid Wallet-1.0-backup-2019-04-02T19_42_59 Wallet-1.0-sqlite.sqlite3 config.json public.key public.key.lock

What I've tried so far:

  1. Installed 0.15.1 on macbook -> no luck, red screen.

  2. I downloaded all old tar.gz wallet versions from github (1.0.0, 1.1.0, 2.0.0, 2.1.0) and I compiled the installers, then opened release->darwin-x64->Daedalus Nightly*. None of them work. All have the message to download newest version.

  3. In all wallets that I've tried, I went to Developer mode, and I removed the red "incident" div, to see what is below it. No luck either :( The node does not connect.

  4. I downloaded version 0.13.0 hoping for wallet import feature, but no luck, this functionality does not open from the menu.

  5. I tried the console way import in all versions mentioned above: daedalus.api.ada.importWalletFromFile({ filePath: '/tmp/secret.key' }); Promise {<pending>} renderer.js:34 [2020-11-26T17:55:26.073Z] [daedalus.*itn_rewards_v1*:error:ipcRenderer] { "msg": "AdaApi::importWalletFromFile error", "data": { "error": {} } } asyncToGenerator.js:6 Uncaught (in promise) ApiError {isFinalError: false, id: "api.errors.WalletFileImportError", defaultMessage: "!!!Wallet could not be imported, please make sure you are providing a correct file.", values: {…}, code: "wallet_file_import_error", …}

  6. Then I investigated the api.js functions, and apparently it won't work unless it is enabled on the server side?

What is left to try:

There must be a way to recover my funds.

Any help would be much appreciated!

skazichris commented 3 years ago

I tried another thing.

From Daedalus 1.0.0, I started the selfnode: Run yarn nix:selfnode from daedalus. Run yarn dev from the subsequent nix-shell

Then, Daedalus opened, and IMPORT button was present. I used it and selected my secret.key file. Daedalus has discovered 1 wallet called "Tygrys", and noted that it is password protected. I imported the wallet without issues, but it says it has 0 ADA in it -> probably because this is a selfnode, and not synced with mainnet. But at least I know that the secret.key is not damaged.

Now the question is... how to get it into 2.4.1 wallet...

srdjan commented 3 years ago

@skazichris interesting, thank you... will try this path myself.

maybe it is just a few of us in this situation at this time... and it may seem less important. but, I still think it would be great for all if the team can put some priority on restoring the 'import' feature.

nikolaglumac commented 3 years ago

Hi @srdjan @skazichris! I am really sorry you can not get to your ada 😞 Having your wallet’s recovery phrase written down and stored in a secure place was important from day one and we have always tried to highlight this in Daedalus - this is why you have to confirm your wallet recovery phrase during wallet creation process...

Running selfnode won’t help you and neither will any of the other actions you tried. Daedalus 0.15.1 is discontinued because it simply doesn’t work since Shelley hard-fork. The only thing you can do at this moment is to safely store your old Daedalus’ state directory (with Secrets-1.0 and Wallet-db-1.0 subfolders) from which you will later on restore your wallets in a future Daedalus version that will have the import feature enabled.

Please understand that we do take this situation seriously and we care for every single Daedalus user - unfortunately, there is little we (Daedalus Team) can do here as the import support is missing on the cardano-wallet side: https://github.com/input-output-hk/cardano-wallet. Adrestia Team is aware of this and we can only rely on their help.

Thank you for your patience! 🙏

mprymek commented 3 years ago

@nikolaglumac If I understand the situation correctly, the secret.key file contains a password-encrypted master key and the other files contain the master-key-encrypted private keys for the wallets. The only thing we need to solve is to read the files and decrypt the keys. Ideally also to generate the recovery phrase from the keys. Once we have the key(s) or phrase, we can restore the wallets or import them e.g. into Yoroi (https://emurgo.io/en/blog/master-key-import-in-yoroi).

It seems to me that it's all just about knowing the files' format and writing a few-lines python script to retrieve the keys? No real need to wait for the full-blown import feature in Daedalus(?)

Could you please give us any clue about the files' formats, encryption used etc.?

nikolaglumac commented 3 years ago

@nikolaglumac If I understand the situation correctly, the secret.key file contains a password-encrypted master key and the other files contain the master-key-encrypted private keys for the wallets. The only thing we need to solve is to read the files and decrypt the keys. Ideally also to generate the recovery phrase from the keys. Once we have the key(s) or phrase, we can restore the wallets or import them e.g. into Yoroi (https://emurgo.io/en/blog/master-key-import-in-yoroi).

It seems to me that it's all just about knowing the files' format and writing a few-lines python script to retrieve the keys? No real need to wait for the full-blown import feature in Daedalus(?)

Could you please give us any clue about the files' formats, encryption used etc.?

It is a bit more complicated than that. I am afraid I can not help you here - but @KtorZ could share more details 🙏

SebastienGllmt commented 3 years ago

We don't support importing secret.key files into Yoroi precisely because it's unfortunately more complicated :(

skazichris commented 3 years ago

Gents,

Is there any contact to their team? Perhaps we need to raise an issue at their end?

I mean... I don't wanna wait forever for this import feature :)

pt., 27 lis 2020, 12:59 użytkownik Sebastien Guillemot < notifications@github.com> napisał:

We don't support importing secret.key files into Yoroi precisely because it's unfortunately more complicated :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/input-output-hk/daedalus/issues/1234#issuecomment-734800857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFK2W2VJR2IKJCZ6F3YFABTSR6IBNANCNFSM4GLRZXHQ .

nikolaglumac commented 3 years ago

Hi, Not sure which team you refer to, but I will give it a try:

bravo3453 commented 3 years ago

Is there any time frame on this? I am still unable to access my coins. Do we know what the delay is in being able to import?

nikolaglumac commented 3 years ago

@bravo3453 we are still blocked by not having this feature ready on the cardano-wallet side. @skazichris opened this issue on the cardano-wallet GitHub - perhaps it can be helpful to you too.

bravo3453 commented 3 years ago

when you say blocked? can you elaborate please? is the delay from Cardano not allowing you to import wallets? IM not understanding. I didn't use this wallet for a few years when crypto went into a crash period then I've noticed I can't use my old wallet so I upgraded but cannot transfer my old wallet?

nikolaglumac commented 3 years ago

A lot of things changed in 2020 alone, not to mention in the last few years... Old Daedalus you were using has been replaced by Daedalus Mainnet and there is no wallet migration option besides using your 12-word recovery phrase. We will be adding an “import” feature which will enable you to restore your wallets from the state directory of the old Daedalus installation. This, however, has to be first developed by the Adrestia team on the cardano-wallet side in order for us (Daedalus team) to be able to add it into Daedalus.

You can always restore your wallet from the 12-word recovery phrase. This has always been the case.

clovehitch commented 3 years ago

@nikolaglumac

I have ADA that I'm unable to access since I created the wallet with Daedalus 0.13.1. I have the secret.key file (along with the rest of the files). It seems that as of right now, there is no way to gain access to those funds (I do not have the 12-word recovery phrase).

Is this correct?

nikolaglumac commented 3 years ago

@clovehitch yes, unfortunately that is the case. Please securely store your secret.key file (and preferably the complete state directory) so that you can use it to recover your wallet once this feature becomes available again. Once again, sorry for the inconvenience and thanks for the patience 🙏

MichalPietrzok commented 3 years ago

I lost my seed to my old Daedalus wallet (I think it was 0.13). After app update I don't see my assets anymore and my wallet gone. Good thing is that I used Daedalus Reward testnet and I have seed words to this wallet and there I see my ADA. Can I transfer my ADA from testnet wallet to mainet or should I wait for your feature ? I have also secret.key to old wallet

testbookbear commented 3 years ago

Here is my situation like many others.

Have Daedalus 0.13 wallet with the directories on my mac intact. I do have the secret-1.0 dir with secret.key file in it. I do not have the 12 word recovery phase.

Please let me know my only option is to wait for a new version of the Daedalus wallet that can import secret.key file. (The Daedalus 3.1 wallet I have - this option to import secret.key is disabled)

Thanks

nikolaglumac commented 3 years ago

I lost my seed to my old Daedalus wallet (I think it was 0.13). After app update I don't see my assets anymore and my wallet gone. Good thing is that I used Daedalus Reward testnet and I have seed words to this wallet and there I see my ADA. Can I transfer my ADA from testnet wallet to mainet or should I wait for your feature ? I have also secret.key to old wallet

You can use the "ITN redemption" feature in Daedalus Mainnet to redeem your ITN wallet funds:

1

2
nikolaglumac commented 3 years ago

Here is my situation like many others.

Have Daedalus 0.13 wallet with the directories on my mac intact. I do have the secret-1.0 dir with secret.key file in it. I do not have the 12 word recovery phase.

Please let me know my only option is to wait for a new version of the Daedalus wallet that can import secret.key file. (The Daedalus 3.1 wallet I have - this option to import secret.key is disabled)

Thanks

@testbookbear unfortunately, you need to wait. Thanks for the patience!

MichalPietrzok commented 3 years ago

I think I need to wait too for this feature. When will you be ready to release it ?

nikolaglumac commented 3 years ago

I think I need to wait too for this feature. When will you be ready to release it ?

Unfortunately, I can not give you an ETA as we depend on this feature first being implemented by cardano-wallet team: https://github.com/input-output-hk/cardano-wallet/issues/2395

aleksmart commented 3 years ago

@nikolaglumac, please help. why is Import Feature is disabled in latest Daedalus version? i can't import from the old wallet.

no1ninja1973 commented 3 years ago

I need this so bad!! I have all my files the secret,key and same issue... the old deadalus just tries to connect and does not connect, i wish i could just get into it to get the seed. I have the program files as well fi those are needed as well as the user/roaming files.

I have over 40,000K in ADA in the account, this is substantial for me, so please team develop this addition to the program and I promise to donate 10% of my funds.

It's been so long and nothing yet... I keep checking, I tried every single thing, from loading old versions replacing directories, nothing has worked. Hope you guys can get this done soon.

Cardano FAN, Ontario, Canada

nikolaglumac commented 3 years ago

@aleksmart @no1ninja1973 I am very sorry to hear about your troubles :-( This feature has been disabled because it is missing on the cardano-wallet side ever since the Byron Reboot launch.

Unfortunately, I can not give you an ETA as we depend on this feature first being implemented by cardano-wallet team: input-output-hk/cardano-wallet#2395

Please securely store your secret.key file (and preferably the complete state directory) so that you can use it to recover your wallet once this feature becomes available again. Once again, sorry for the inconvenience and thanks for the patience 🙏

clovehitch commented 3 years ago

@aleksmart @no1ninja1973 I was able to restore my old wallet by piecing together the instructions throughout https://github.com/input-output-hk/cardano-wallet/issues/2395

srdjan commented 3 years ago

@clovehitch, there is a lot going on it that issue... would you publishing how you did it?

clovehitch commented 3 years ago

@srdjan It looks like all that is holding this up from being implemented is that one more person needs to review https://github.com/input-output-hk/cardano-sl/pull/4278 I could be missing something with that though? I'm not sure of etiquette here, but would it be okay to reach out to the people who are required to approve?

srdjan commented 3 years ago

off course! I just don't think that all of us should go through trial and error by following the issue discussion

clovehitch commented 3 years ago

@srdjan sorry I don't think I got my point across correctly. Instead of writing up these steps that would need to be tweaked for each person's setup, it might be best to figure out how to get the feature added back to Daedalus. It looks like all that is needed is for one of two people to approve of the change.

I did the following:

  1. download Ubuntu 18.04 for WSL2
  2. backed up my old wallet directory
  3. downloaded https://github.com/input-output-hk/cardano-sl/files/4348470/export-wallets-qa.tar.gz
  4. run "apt get install librocksdb-dev" in ubuntu
  5. I used "export-wallets" to extract the keys (https://github.com/input-output-hk/cardano-wallet/issues/2395#issuecomment-757901705)
  6. Then I followed these instructions (https://github.com/input-output-hk/cardano-wallet/issues/2395#issuecomment-758784374)
rdlrt commented 3 years ago

@srdjan It looks like all that is holding this up from being implemented is that one more person needs to review https://github.com/input-output-hk/cardano-sl/pull/4278 I could be missing something with that though? I'm not sure of etiquette here, but would it be okay to reach out to the people who are required to approve?

Not exactly, cardano-sl repository is archived and no longer used by Daedalus (UI that now interfaces with cardano-wallet instead). So it's not just approve and merge.

KtorZ commented 3 years ago

Not exactly, cardano-sl repository is archived and no longer used by Daedalus (UI that now interfaces with cardano-wallet instead). So it's not just approve and merge.

Indeed. Nothing will change in cardano-sl anymore. The repository is archived and, this pull request was never intended to be merged. It simply facilitates reviewing and give the underlying branch some exposure.

We are working on putting together a summary from input-output-hk/cardano-wallet#2395 including the few pitfalls people ran into. (Thanks @clovehitch's for already putting one up).