Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Wallet got corrupted  (Read 3339 times)

0 Members and 1 Guest are viewing this topic.

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Wallet got corrupted
« on: December 21, 2013, 02:03:54 PM »

I really need help now, especially from 3I engineers.

For some reason, my original wallet (wallet1) only shows 2 addresses, but their balance doesn't add up. So I think maybe there are a third 'change address'. And yes, I verified by looking into the transaction information online (btsblock.com). So I decided to aggregate all balance into one of the 2 address shown.

What I did is to quit the client, move my wallet.dat file into another place (wallet1_backup), restart client, copy the new address (Addr1) in the new wallet (wallet2), then switch back to wallet1(by "cp wallet_backup wallet.dat"), transferred all my PTS (~1000) into the new address. Then I probably did something very stupid. I just "mv wallet2_backup wallet.dat" WHILE the client is still open. Then when I quit the client, I got "wallet.dat corrupt, salvage failed", and I got something like wallet.1387632779.bak.

After I restarted the client, I found I have a fresh new address Addr2 which is not the one I sent all my PTS to.

Is there a way I can restore wallet.1387632779.bak somehow? I eagerly wait for help from the community.
« Last Edit: December 21, 2013, 03:15:45 PM by wngdng77 »

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got correpted
« Reply #1 on: December 21, 2013, 02:41:07 PM »
Clone pyWallet
https://github.com/jackjack-jj/pywallet

Run this from /pywallet :

Code: [Select]
python pywallet.py --wallet=wallet.dat --datadir=$HOME/.protoshares/ --otherversion=56 --dumpwallet >> wallet-recovery.txtpyWallet does a better job at recovering wallets than the satoshi client.
Good luck !

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got correpted
« Reply #2 on: December 21, 2013, 03:08:50 PM »


Thanks arubi, but I got error when I run this command
Code: [Select]
python pywallet/pywallet.py --wallet=a/wallet.1387632456.bak --datadir=/Users/dong/.protoshares --otherversion=56 --dumpwallet

I got this error:

Code: [Select]
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.

Maybe I used he wrong 'otherversion' value?

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got correpted
« Reply #3 on: December 21, 2013, 03:10:36 PM »
No the version is fine, I used it on test wallet.

Is your wallet encrypted?
Also, are protosharesd or protoshares-qt running?

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got correpted
« Reply #4 on: December 21, 2013, 03:21:27 PM »
No the version is fine, I used it on test wallet.

Is your wallet encrypted?
Also, are protosharesd or protoshares-qt running?

It's not encrypted and neither protosharesd nor protoshares-qt is running.

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got correpted
« Reply #5 on: December 21, 2013, 03:25:18 PM »
No the version is fine, I used it on test wallet.

Is your wallet encrypted?
Also, are protosharesd or protoshares-qt running?

It's not encrypted and neither protosharesd nor protoshares-qt is running.

It says
Code: [Select]
--wallet=a/wallet.1387632456.bak
That's not right, notice the /a

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got corrupted
« Reply #6 on: December 21, 2013, 03:33:53 PM »
The leading 'a/' is the directory I backuped my wallet files. It's not the problem.

I now successfully dumped a lot of data into a output file using this command:

Code: [Select]
python pywallet/pywallet.py --wallet=/Users/dong/.protoshares/wallet.dat  --datadir=/Users/dong/.protoshares/ --otherversion=56 --dumpwallet >> ~/Desktop/wallet-recovery3.txt

I'm not sure this 'wallet.dat' file has anything to do with the address I sent my PTS to.

In the dump output file, however, I cannot find the address information for the particular address I sent all my PTS to. Is it because I haven't ever used that fresh address to send out PTS? Where does all these address information saved? I noticed there are several db files. What are they?

Code: [Select]
-rw-r-----   1 dong  macports   24576 Dec 21 23:24 __db.001
-rw-r-----   1 dong  macports  237568 Dec 21 23:24 __db.002
-rw-r-----   1 dong  macports  270336 Dec 21 23:24 __db.003
-rw-r-----   1 dong  macports   98304 Dec 21 23:24 __db.004
-rw-r-----   1 dong  macports  729088 Dec 21 23:24 __db.005

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got corrupted
« Reply #7 on: December 21, 2013, 03:43:38 PM »
Isn't this the name of the corrupt wallet?

wallet.1387632456.bak

Why dump the new wallet.dat?

pywallet has more options. Try using --dumpwithbalance instead of --dumpwallet to see the balances.

I don't really know about the __db.00# files

 

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got corrupted
« Reply #8 on: December 21, 2013, 03:52:55 PM »
I tried each and every wallet.xxxxxxxx.bak files, but they all give me this same error:

Code: [Select]
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got corrupted
« Reply #9 on: December 21, 2013, 04:06:02 PM »
Well, this doesn't look good, maybe try a file recovery program like testdisk?

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got corrupted
« Reply #10 on: December 21, 2013, 04:28:53 PM »
I wonder what are the information inside those wallet.xxxxxx.bak files, if non of them can be parsed correctly, then they might just be different than the wallet files. What are these bak file designed for? There must be someway to use them...

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got corrupted
« Reply #11 on: December 21, 2013, 04:31:54 PM »
try using :

Code: [Select]
xxd wallet.xxxxxx.bak wallet.hex
and see if it shows any public keys in that text

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got corrupted
« Reply #12 on: December 21, 2013, 05:01:26 PM »
xxd is just some command I guess, right?

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: Wallet got corrupted
« Reply #13 on: December 21, 2013, 05:33:29 PM »
xxd is used for performing a hex dump of the wallet files
if we can see public keys in there, then we know there are probably private keys too

Offline dacer

  • Full Member
  • ***
  • Posts: 67
    • View Profile
Re: Wallet got corrupted
« Reply #14 on: December 21, 2013, 06:28:44 PM »
I used this command to recover my lost pub/pri keys:
Code: [Select]
python ~/Desktop/pywallet/pywallet.py --recover --recov_device=tmp/wallet.1387632779.bak  --recov_size 2Mo --recov_outputdir=. --otherversion=56
  614 
And I got output like this:
Code: [Select]
Importing key   92/101:
Address (Bitcoin): 1FpiFBir5dWYPs8jgPWPQmL2buVVLpDH
Privkey (Bitcoin): 5KGKxM4w4SkM63YrFswNADT7bmvdf7JotG7sQ2NT2xygk1H
Hexprivkey: bed341dcfd51c3ab55eeece4ad681788b9e6ed276bbcea529e394a01c09909
Hash160: a297bd8b537dab2b82259c94b9f55e7a480260bc
Pubkey: 04cefe4dd00d2b10b5f879b41ec328ab8c3ff800d796d9ca6c9426b32853175ce8b0c835142778c72b2da1b1d6ad7b6fc91ff7d63f9d17ba5332eb66fbcbaed
Address (Bitcoin): 1P1Z999H9D5tqgdCEZ9Kwju9FE67yCZ
Privkey (Bitcoin): L3cefTdaMcCeVdfFaQfpxRnVxG8VHoCqbwFKSd4qwuYvUcX9F
Hexprivkey: bed341dcfd5123ab55eeece4ad681788a9e6ed276bbcea529e394a01c09909
Hash160: f16d98ae3eb037efc32eefcb4cb45f3a75db4f
Pubkey: 03cefe4dd0d2b1c0b5f879b41ec28ab80c3ff800d796d9ca6c9426b32853175c

But I noticed all addresses start with "1" instead of "P" as seen in my protoshares client. Does anyone know how I can right this?

 

Google+