Bitcoin Forum
July 04, 2022, 03:00:32 AM *
News: Latest Bitcoin Core release: 23.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Help] [Bounty] Recovering LTC Wallet using Pywallet  (Read 1501 times)
patrickquinn
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
January 04, 2014, 06:18:07 AM
Last edit: January 04, 2014, 07:23:41 AM by patrickquinn
 #1

 My wallet disappeared over a year ago with 200+ LTC in it, possibly due to me running CCleaner for Mac over my machine (which looks for and deletes .dat files as part of its sweep as far as i can tell). I have made several attempts to locate my wallet including using Photorec and dumping the existing wallet.dat, but to no avail. I am going for one last chance attempt to recover it before giving up and moving on.

I am attempting to use pywallet to recover the wallet from my machine by issuing the following,
Code:
sudo ./pywallet.py --datadir=/Users/patrickquinn/Library/Application\ Support/Litecoin/ --recover --recov_size 121.3Gio --recov_device /dev/disk0 --recov_outputdir /Users/patrickquinn/Desktop/Looking --otherversion=48
which returned

Code:
Read 121.3 Go in 58.5 minutes

Found 0 possible wallets
Found 0 possible encrypted keys
Found 1640 possible unencrypted keys

and left two files, recovered_wallet_1388812907.dat and pywallet_partial_recovery_1388812907.dat in the specified 'Looking' directory.

Can these unencrypted keys be recovered or am i snookered?

Any help  with this would mean the world to me Smiley

The first person to come up with a successful solution to this problem and aid me in restoring my LTC will get 10 of them which is roughly 240 Dollars at current market value.

Thanks guys.
icon
Your favorite trading tools in one place. Lightning fast execution.
Start trading
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1656903632
Hero Member
*
Offline Offline

Posts: 1656903632

View Profile Personal Message (Offline)

Ignore
1656903632
Reply with quote  #2

1656903632
Report to moderator
1656903632
Hero Member
*
Offline Offline

Posts: 1656903632

View Profile Personal Message (Offline)

Ignore
1656903632
Reply with quote  #2

1656903632
Report to moderator
1656903632
Hero Member
*
Offline Offline

Posts: 1656903632

View Profile Personal Message (Offline)

Ignore
1656903632
Reply with quote  #2

1656903632
Report to moderator
patrickquinn
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
January 04, 2014, 07:25:59 AM
 #2

Bounty added.
magnux
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 27, 2014, 06:14:33 AM
Last edit: May 27, 2014, 06:55:43 AM by magnux
 #3

Dood, I feel your pain, I just went through it. I lost my keys, I recovered them from hard drive surface, but I couln't do anything with the recovered wallet, why? well, I detected a bug in pywallet, it is not behaving well for litecoin.

Anyway, I managed after a lot of debugging to sort it out, and fixed it, partially.
Here is my repo on github https://github.com/magnux/pywallet, it is exactly the same as the original, except for the line 1231, where I changed "prefix = chr(128)" for "prefix = chr(176)". This small fix will let you dump your keys correctly.

You're not screwed, if you still have those recovered .dat of course.

So, the recipe:
1) Download MY pywallet https://github.com/magnux/pywallet.

2) Recover it:
If you have already recovered your wallet:, you can use your recovered .dat. It might issue a warning later, in the dumping phase, because of the chr mismatch, ignore it.
If you haven't:
Code:
python pywallet.py --otherversion 48 --recover --recov_size=<yoursize> --recov_outputdir=recovered/ --recov_device=<your device or file>
(I discovered that a .db file recovered by photorec works just as fine as recovering from the surface of the disk directly with pywallet)

3) Dump it(the info):
Code:
python pywallet.py --otherversion 48 --datadir=recovered/ --wallet=recovered_wallet_<yournumber>.dat --dumpwallet --passphrase=<yourpass>  > litewallet.dump

4) Extract it:
Code:
cat litewallet.dump | grep "\"sec\":*" | sed 's/.*: \"//g' | sed 's/\",.*$//g' > liteprivatekeys.txt

This will extract all your keys in lines.

5) Import it:
Using litecoind, you can import it, this process is painstakingly slow, it has to rescan each time imports a key into the wallet.
Run the server and let it sync the block, after that you can use this line:

Code:
while read i; do echo "Importing Key: $i"; /<pathtolitecoind>/litecoind importprivkey $i; done < liteprivatekeys.txt

6) Enjoy:
This process will allow you recover your keys, guaranteed, I just done so with mine.
All your keys will be associated with the "" account, and you'll be able to get your coins out via litecoind sendtoaddress

I hope this helps the mankind. Smiley

tips: LeNXP1KhagNUFfy9XKq1wn5quK6du2LX1R
doncello
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
December 12, 2017, 05:51:41 PM
 #4

Hi,
Ive lost my wallet file as well for litecoin. Can you help me pls to try to recover it on windows? If its successful I can give out 2LTC bounty.
ashraful1980
Newbie
*
Offline Offline

Activity: 24
Merit: 0


View Profile
July 12, 2020, 07:28:09 AM
 #5

Dood, I feel your pain, I just went through it. I lost my keys, I recovered them from hard drive surface, but I couln't do anything with the recovered wallet, why? well, I detected a bug in pywallet, it is not behaving well for litecoin.

Anyway, I managed after a lot of debugging to sort it out, and fixed it, partially.
Here is my repo on github https://github.com/magnux/pywallet, it is exactly the same as the original, except for the line 1231, where I changed "prefix = chr(128)" for "prefix = chr(176)". This small fix will let you dump your keys correctly.

You're not screwed, if you still have those recovered .dat of course.

So, the recipe:
1) Download MY pywallet https://github.com/magnux/pywallet.

2) Recover it:
If you have already recovered your wallet:, you can use your recovered .dat. It might issue a warning later, in the dumping phase, because of the chr mismatch, ignore it.
If you haven't:
Code:
python pywallet.py --otherversion 48 --recover --recov_size=<yoursize> --recov_outputdir=recovered/ --recov_device=<your device or file>
(I discovered that a .db file recovered by photorec works just as fine as recovering from the surface of the disk directly with pywallet)

3) Dump it(the info):
Code:
python pywallet.py --otherversion 48 --datadir=recovered/ --wallet=recovered_wallet_<yournumber>.dat --dumpwallet --passphrase=<yourpass>  > litewallet.dump

4) Extract it:
Code:
cat litewallet.dump | grep "\"sec\":*" | sed 's/.*: \"//g' | sed 's/\",.*$//g' > liteprivatekeys.txt

This will extract all your keys in lines.

5) Import it:
Using litecoind, you can import it, this process is painstakingly slow, it has to rescan each time imports a key into the wallet.
Run the server and let it sync the block, after that you can use this line:

Code:
while read i; do echo "Importing Key: $i"; /<pathtolitecoind>/litecoind importprivkey $i; done < liteprivatekeys.txt

6) Enjoy:
This process will allow you recover your keys, guaranteed, I just done so with mine.
All your keys will be associated with the "" account, and you'll be able to get your coins out via litecoind sendtoaddress

I hope this helps the mankind. Smiley

tips: LeNXP1KhagNUFfy9XKq1wn5quK6du2LX1R



Dear Sir,
I would like to draw your kind attention that i have some error to use to your script. Please suggestion how to solve it:
C:\Users\PC\Downloads\pywallet-master>python pywallet.py --otherversion 48 --datadir=recovered/ --wallet=wallet.dat --dumpwallet --passphrase=./   1>wallet.dump
Traceback (most recent call last):
  File "pywallet.py", line 5008, in <module>
    db_env = create_env(db_dir)
  File "pywallet.py", line 1267, in create_env
    r = db_env.open(db_dir, (DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_THREAD|DB_RECOVER))
bsddb.db.DBNoSuchFileError: (2, 'No such file or directory -- recovered/__db.001: No such file or directory')
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!