Author

Topic: Any way to recover wallet just from electrum.dat? (Read 3503 times)

legendary
Activity: 3472
Merit: 10611
I think the wallet is too old to be open with the latest version... All I have is an "electrum.dat" file dated im 2013...
Electrum shouldn't have any problem with any version of its own wallets because the code hasn't changed, it is just updated and when the wallet detects the old wallet version it simply falls back to the old code to use it to decode the file that it was given.
If you have a problem loading that wallet into Electrum then there is a good chance that it is corrupted.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
I tried with the oldest version of the software found on electrum website... It opens but doesn't connect to the server.

Any idea?
Version 1.8? Try to extract the seed using the menu: "Wallet->Show->Seed", type the password (read the warnings).
Then use that seed phrase to restore your wallet to the latest version.
newbie
Activity: 2
Merit: 0
I think the wallet is too old to be open with the latest version... All I have is an "electrum.dat" file dated im 2013...

If I try to open it with the latest version of electrum, I get this error message:

Code:
Traceback (most recent call last):
  File "electrum\gui\qt\__init__.py", line 245, in wrapper
  File "electrum\gui\qt\__init__.py", line 269, in start_new_window
  File "electrum\gui\qt\__init__.py", line 325, in _start_wizard_to_select_or_create_wallet
  File "electrum\wallet.py", line 2810, in __new__
  File "electrum\wallet.py", line 2654, in __init__
  File "electrum\wallet.py", line 2444, in __init__
  File "electrum\wallet.py", line 273, in __init__
  File "electrum\wallet_db.py", line 1143, in load_addresses
TypeError: list indices must be integers or slices, not str

I tried with the oldest version of the software found on electrum website... It opens but doesn't connect to the server.

Any idea?

Thanks for the help Smiley
legendary
Activity: 3682
Merit: 1580
you should use file menu > open in electrum to open a wallet file and not muck about with the json code.
once the file has been opened you can use wallet > seed to get at the seed
jr. member
Activity: 43
Merit: 7
Hi,

I don't know if you are still around dabura667... If so, quick question for you.

I followed your post herto recover an old 2013 electrum.dat file, but I have a small issue:

I remember the password, but the HEX seeds it gives me is not 32 Hex chars (0-9, A-F), but 32 hex codes like "\xc0\x7fR\...." etc. Do you know any way to convert this to chars? I tried the ascii table, etc. but can't find a way to convert it. If I enter this directly in Electrum, it doesn't work.

Please let me know if you know a way to fix this, I would gladly compensate you for your time!

Thanks,

SK

"\xc0\x7fR\...."   converts to  "c0 7f        "
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
I don't know if you are still around dabura667... If so, quick question for you.
His last login was 2 years ago.

Have you tried to open a copy of it using the latest version? AFAIK, even the latest version 4.0.9 can open old wallets - electrum.dat.
Compatibility issues will arise if it's from very old versions like v0.34 or below.
newbie
Activity: 2
Merit: 0
Hi,

I don't know if you are still around dabura667... If so, quick question for you.

I followed your post herto recover an old 2013 electrum.dat file, but I have a small issue:

I remember the password, but the HEX seeds it gives me is not 32 Hex chars (0-9, A-F), but 32 hex codes like "\xc0\x7fR\...." etc. Do you know any way to convert this to chars? I tried the ascii table, etc. but can't find a way to convert it. If I enter this directly in Electrum, it doesn't work.

Please let me know if you know a way to fix this, I would gladly compensate you for your time!

Thanks,

SK
sr. member
Activity: 475
Merit: 252
Many thanks!
But one last detail: there was a imported address in this wallet, that I would like to recover because it has a few bitcents in it. I would glady send something for you as tip ofc.
I saw that there is a "imported_keys" tag, but I don't really know what to do with it...
Yea, it's the same process except instead of using the seed you have to do it once for each encrypted key and the output is one unencrypted private key each... Its time consuming.
'imported_keys' is where you want to look, and each encrypted private key is surrounded in single quotes separated by commas.

Then you can just re-import the private keys to your new wallet using the normal interface.

Edit:

I just verified with my electrum, I didn't have imported addresses, but I made three on Bitaddress and put them in just to see how it looks in a test wallet. The imported keys should look like this.

Code:
'imported_keys': {'1QGCxG8cLJQCs5pCMotYBz8PQrA3ZoeXLH': 'h2E+Cbmo/X4ejtwk/jV2FEC6Vop2Kwtz64TKqYXtQPyOHeT7MPKWr7aYu0auPoi9Krnd/ol/cyX9cb0WOcHY4dIRRdmMF+MN3IhaXKEhLL4=', '1BjNG9VwiidPbQJtZvWncLJp5wHWbcQKs2': 'ZTMiqxszvGp8Djgr/bj8zOrgrlOM+Fyu5Zeu0tkjqPt/rrLnciu4WMCmlzBAzQKJ3MYQaHlPrSVMKfPsORlNgInBwXkdrIWgZkDGQaQT/K0=', '1K7sXxxirkpASjsVyVQbqDrqDqXQejaEj1': 'PcXtNIXMfQoeJN5Cx5D1xLQUYFi4aVkYDxq56la0Pq5OnUYsC4VaYijSV1PswHNLKm9vmAgWsyiVqbTIwZMYuO6CTJnWgg893S3GIL1vZt0='}

So the format is:

Code:
'imported_keys': {'address#1': '', 'address#2': '', 'address#3': ''}

So you want to do the steps I explained above and then repeat Step #7 where the first value is the encrypted private key for the address of your choice and the 2nd value is the wallet password. (all imported keys and the seed are protected by the same password.)
(Note: after doing #5 and #6 once, as long as you don't close Electrum, you don't need to do them again)
legendary
Activity: 1386
Merit: 1000
English <-> Portuguese translations
Many thanks!
But one last detail: there was a imported address in this wallet, that I would like to recover because it has a few bitcents in it. I would glady send something for you as tip ofc.
I saw that there is a "imported_keys" tag, but I don't really know what to do with it...
sr. member
Activity: 475
Merit: 252
NOTE* : The file I am talking about in step 1# is commonly something like "electrum.dat" or "default_wallet" would be the name of the file. It can usually be found in %APPDATA%/Roaming/Electrum/wallets/ if you're on Windows.

1. open the file using a text editor

2. look for an area (maybe use find function) that says
Code:
'seed': '',

3. take the string of letters and numbers between the '  ' single quotations. and copy it somewhere readily available. (don't worry, those letters are encrypted, so you won't be too compromised)

4. open Electrum 1.9.8 and click on the console tab.

5. in the console type
Code:
import aes
then hit Enter.

6. type in console
Code:
from electrum import wallet
then hit Enter

7. Let's say your encryped seed was abcdefg== and your password was d0gecoin
Then, type in
Code:
wallet.pw_decode('abcdefg==', 'd0gecoin')

8. if the password is correct, the next line will give you a string of 32 HEX characters (0-9, A-F) between single quotes. THIS IS YOUR UNENCRYPTED SEED! BE CAREFUL WITH THIS INFORMATION, IT WILL RESTORE YOUR WALLET FOR ANYONE WHO SEES IT!

Note for 8: If the password is wrong, it will say "Exception Invalid Password"... pressing up arrow key will re-insert the last command so you won't have to re-type too much besides the password. Also, the console won't hide your password and you will be typing it in plaintext onto the console. Be sure to do this in private.

9. Now you have your HEX based seed. Click "New Wallet" in File menu, then choose second option "Restore from seed", then in the seed box paste your 32 characters HEX seed with NO QUOTATIONS. and hit next.

10. You have now restored your bitcoins.

1QCjHCCaifSFDMqR4KWDAfowZJiiqi7m7U

Here's a tip address if this helped.

Edit: btw if it was me, after doing all this stuff I might just make a NEW wallet and send all my bitcoins there and make a different password for the new wallet... your unencrypted seed was just all over your monitor and stuff, so it might be safer to make a new wallet.
legendary
Activity: 1386
Merit: 1000
English <-> Portuguese translations
I lost the only file I had with the seed after formatting my old PC.
The only thing that I could recover is the electrum file itself, and placing it directly to %APPDATA%\Electrum does nothing, I mean, the program simply don't run at all.
Anyway that I still can get access to at least the privkeys inside of it?
Jump to: