Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: heruspex on December 29, 2011, 09:49:00 AM



Title: help, recovering from wallet.dat
Post by: heruspex on December 29, 2011, 09:49:00 AM
hi,

i ahve a wallet.dat file (unencrypted)  from my mac client that crashed. i cant get the bitcoin client to load. however i had 30 bitcoins being sent to one of my addresses, and they havent been received.

Looking for someone to take my wallet.dat file and recover. Will "tip".



Title: Re: help, recovering from wallet.dat
Post by: Mushoz on December 29, 2011, 10:09:29 AM
Do you know if the wallet.dat is usable on Windows clients as well? I could help out in that case, I'm familiar with switching out wallets and using the rescan option to retrieve transactions from the blockchain.


Title: Re: help, recovering from wallet.dat
Post by: CIYAM on December 29, 2011, 11:05:49 AM
Hi,


Looking for someone to take my wallet.dat file and recover. Will "tip".


I would be a little cautious about giving out your "wallet.dat" file to anyone you don't know or whose reputation on this forum (or elsewhere) is not well known.

It might be time to read up a bit on wallet recovery steps - one first thing to note is that if you have even a fairly old wallet backup it might well have the private key(s) required to recover your BTC as a key pool of usually 100 are created when your wallet is created (the rescan option might be required if starting the client up with an older backup).

Also whatever you do make sure you keep a copy of the current wallet.dat (if you do end up still deciding to give it to someone else).


Cheers,

Ian.



Title: Re: help, recovering from wallet.dat
Post by: mcorlett on December 29, 2011, 11:11:10 AM
Hi,


Looking for someone to take my wallet.dat file and recover. Will "tip".


I would be a little cautious about giving out your "wallet.dat" file to anyone you don't know or whose reputation on this forum (or elsewhere) is not well known.

It might be time to read up a bit on wallet recovery steps - one first thing to note is that if you have even a fairly old wallet backup it might well have the private key(s) required to recover your BTC as a key pool of usually 100 are created when your wallet is created (the rescan option might be required if starting the client up with an older backup).

Also whatever you do make sure you keep a copy of the current wallet.dat (if you do end up still deciding to give it to someone else).


Cheers,

Ian.


His wallet is in safe hands!

I've recovered the private key and imported it into a new wallet, and am currently waiting for an address to return the coins to (minus whatever tip he decides on giving me).


Title: Re: help, recovering from wallet.dat
Post by: chunglam on December 29, 2011, 12:23:43 PM
Hi, I also have a corrupted wallet.dat with arround 100 BTCs inside. It was encrypted using bitcoin-qt client 5.0, crashed when starting up. I have tried removing all files except wallet.dat in %appdata%\bitcoin folder and still fail. Does anyone know any good tools for recovering encrypted wallet.dat? Thanks.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on December 29, 2011, 12:54:58 PM
I do have backup wallet.dat(around month old), some coins recovered. But since I have generated new receiving address and also upgraded the client from v4 to v5, transactions to new generated address missing from the backup wallet.dat


Title: Re: help, recovering from wallet.dat
Post by: CIYAM on December 29, 2011, 01:09:34 PM
I do have backup wallet.dat(around month old), some coins recovered. But since I have generated new receiving address and also upgraded the client from v4 to v5, transactions to new generated address missing from the backup wallet.dat

Understand - seems that the conversion from unencrypted to encrypted is something one needs to pay very close attention to (on my system my wallet is kept encrypted by an external encryption tool and is only unencrypted when I run the client which I only do for a brief time per day and every day after running I take a backup of the encrypted wallet and keep several such backups at several different places).

It will all depend upon exactly what has gone wrong with the encrypted wallet - not sure if the debug.log file will provide any clue as to what exactly it is finding wrong with the file.


Cheers,

Ian.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on December 29, 2011, 01:21:25 PM
The worst part is I have to reuse the backup wallet file because I used some address in this old wallet as my mining pool payout address and permanent locked for security reason. So I can't email this corrupted wallet file to others for recovering because it contains my missing address and pool payout address. I would appreciated someone can help me recovering it and I will pay 40 BTC if success.


Title: Re: help, recovering from wallet.dat
Post by: DeathAndTaxes on December 29, 2011, 03:38:49 PM
Hi, I also have a corrupted wallet.dat with arround 100 BTCs inside. It was encrypted using bitcoin-qt client 5.0, crashed when starting up. I have tried removing all files except wallet.dat in %appdata%\bitcoin folder and still fail. Does anyone know any good tools for recovering encrypted wallet.dat? Thanks.

What happens?  How does it fail?

A longshot but
try reinstalling the client (it will install new wallet.dat).  Download entire block chain.  Ensure wallet is functioning properly (use bitfaucet to send token amount to new wallet).

Once verified client is working properly close client, delete ONLY wallet.dat file.  Copy your wallet.dat to same location and attempt to restart.

If that doesn't work I don't believe there are any tools which decrypt a wallet and dump a plain text copy of the contents.  It shouldn't be too hard to create a tool that does this using the client source code as a blueprint.  You may want to try offering a small bounty for a tool which can take encrypted wallet and given passphrase will dump a plain text copy of all private keys. 


Sorry for your plight.  To anyone reading this is why backups are essential.  Make a backup at least once a month.  If you do more than 100 transactions per month then make backups more often.  Always backup before encrypting a wallet or changing passphrase.  Always backup before upgrading the client.


Title: Re: help, recovering from wallet.dat
Post by: gnar1ta$ on December 29, 2011, 04:30:03 PM
Is there a way to get paper copy of your private keys from the client?  I always keep a paper copy of my savings wallet, which I can't seem to do from the stock client.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on December 29, 2011, 07:45:06 PM
A longshot but
try reinstalling the client (it will install new wallet.dat).  Download entire block chain.  Ensure wallet is functioning properly (use bitfaucet to send token amount to new wallet).

Once verified client is working properly close client, delete ONLY wallet.dat file.  Copy your wallet.dat to same location and attempt to restart.


Already tried this, the client still crash.

If that doesn't work I don't believe there are any tools which decrypt a wallet and dump a plain text copy of the contents.  It shouldn't be too hard to create a tool that does this using the client source code as a blueprint.  You may want to try offering a small bounty for a tool which can take encrypted wallet and given passphrase will dump a plain text copy of all private keys. 

I will pay 40 BTC to anyone help me recover coins from this wallet.

What happens?  How does it fail?

Sorry for your plight.  To anyone reading this is why backups are essential.  Make a backup at least once a month.  If you do more than 100 transactions per month then make backups more often.  Always backup before encrypting a wallet or changing passphrase.  Always backup before upgrading the client.

I do have backup copy of this wallet.dat which is about one month old. I made a wrong assumption that when generating new receiving address, the client should pick unused key pair from pre-generated key pool. Normally this should be the case. But since I also upgraded client from v4 to v5 at the same time, the client generated new key pairs. All transactions to new generated address missing from the backup copy of this wallet.dat.

What happens?  How does it fail?


Long story in short: The Windows VM running Bitcoin client crashed, Windows restarted, Bitcoin client crashed when starting up.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on December 31, 2011, 11:24:49 PM
What happens?  How does it fail?


Long story in short: The Windows VM running Bitcoin client crashed, Windows restarted, Bitcoin client crashed when starting up.

[/quote]

Details of crash: All my wallets running  inside Windows 7 VM on top of two hosts VMware ESXi cluster and the OS data stores are protected by two RAID5 array mirrored using DRBD with Ubuntu and Linux-HA for fail over. Since this setup has been running for a while, I didn't notice the primary storage array already failed when I tried to do some maintenance work for the standby server and reboot. So all my VMs lost data store connection and crashed.


Title: Re: help, recovering from wallet.dat
Post by: Maged on January 01, 2012, 12:45:05 AM
If that doesn't work I don't believe there are any tools which decrypt a wallet and dump a plain text copy of the contents.  It shouldn't be too hard to create a tool that does this using the client source code as a blueprint.
Especially since the majority of what is needed to recover keys already exists.

You may want to try offering a small bounty for a tool which can take encrypted wallet and given passphrase will dump a plain text copy of all private keys.
I suggest letting jackjack know of the bounty you put out, since it might encourage him to find time to finish his update to pywallet:
https://bitcointalk.org/index.php?topic=34028.msg661194#msg661194


Title: Re: help, recovering from wallet.dat
Post by: casascius on January 01, 2012, 12:54:21 AM
I can extract private keys from a wallet.dat regardless of Berkeley DB structure damage as long as they are not encrypted, by sniffing for the bytes I would expect to surround them in the file.  I have not studied how the encryption works in order to be able to decrypt an encrypted wallet.


Title: Re: help, recovering from wallet.dat
Post by: trentzb on January 01, 2012, 02:02:50 AM
Geez, what's up with everyone losing their wallets lately. :) I am counting at least 4 in last couple days.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on January 01, 2012, 02:46:48 AM
Hi Mike, I can email the corrupted wallet file to you but the wallet file was encrypted so I don't know if that really help. In fact, I already sent the wallet file to mcorlett without pass-phrase for analyst. Hope to hear good new from him soon. I already assume those coins may lost forever but a bit disappointed with the client handling of wallet file, it seems very easy to get corrupted. I thought I have make all precautions to protect my wallet but this kind of accident still happen.


Title: Re: help, recovering from wallet.dat
Post by: casascius on January 01, 2012, 04:30:16 AM
I think the wallet encryption is a waste.  Part of why I know nothing about it is I have no plans to use it.  If my computer is owned, the wallet encryption isn't going to help much.  In fact I'd almost rather have my BTC stolen off my computer sooner so I'd know it was owned.  (I don't ever keep much online)


Title: Re: help, recovering from wallet.dat
Post by: DeathAndTaxes on January 01, 2012, 03:20:47 PM
I think the wallet encryption is a waste.  Part of why I know nothing about it is I have no plans to use it.  If my computer is owned, the wallet encryption isn't going to help much.  In fact I'd almost rather have my BTC stolen off my computer sooner so I'd know it was owned.  (I don't ever keep much online)

I got no problem w/ encrypted wallets but I do think wallets must be deterministic.  As the user base grows and becomes less tech savy the ability to delete, corrupt, lose a wallet is a critical "flaw".  A deterministic wallet can simply be recreated.  If you delete it, just recreate it.  If you lose it just recreate it.  If you corrupt it just recreate it.


Title: Re: help, recovering from wallet.dat
Post by: mcorlett on January 01, 2012, 03:34:00 PM
Hope to hear good new from him soon.
Good news:
The file structure isn't completely botched. There are still (encrypted) private keys in there.

Bad news:
I'm still working on recovering a wallet I've intentionally corrupted in a sandbox to try to get the lay of the land. I don't have nearly the time I'd like to, but I keep working on it a little bit here, and a little bit there.


Title: Re: help, recovering from wallet.dat
Post by: chunglam on January 01, 2012, 04:08:45 PM
Hope to hear good new from him soon.
Good news:
The file structure isn't completely botched. There are still (encrypted) private keys in there.

Bad news:
I'm still working on recovering a wallet I've intentionally corrupted in a sandbox to try to get the lay of the land. I don't have nearly the time I'd like to, but I keep working on it a little bit here, and a little bit there.

Thank you for your help and effort. Glad to hear the good news. No need to rush, I can wait :D


Title: Re: help, recovering from wallet.dat
Post by: etotheipi on January 01, 2012, 04:25:40 PM
I might take a shot at this, since I have a very similar encryption scheme in the client I'm about to release.  It's a pretty healthy bounty, too :)

The only thing I don't know for sure, is where to find the nDeriveIterations value.  I'm sure it's stored in the wallet file somewhere...





Title: Re: help, recovering from wallet.dat
Post by: mcorlett on January 01, 2012, 04:54:50 PM
The only thing I don't know for sure, is where to find the nDeriveIterations value.  I'm sure it's stored in the wallet file somewhere...
That's right. It defaults to 25000, if I'm not mistaken.

Good luck!


Title: Re: help, recovering from wallet.dat
Post by: etotheipi on January 01, 2012, 05:43:22 PM
25,000 is the minimum.  The client tests the speed of your system and determines how much computation can be done in ... 0.1s?  If it's 40,000 SHA512 hashes, it uses that.  If it's 10,000, it uses 25,000.  i.e.  max(computeSysSpeed(), 25,000)

So that value must be stored in the wallet file somewhere, I just don't know where...

mcorlett... if you figure this out, I think I have all the other pieces it would take me a couple hours to put together a script that would take nDeriveIter and the passphrase, and spit out a list of pub/priv keypairs... maybe we could negotiate a splitting of the bounty for this?  :)


Title: Re: help, recovering from wallet.dat
Post by: tlhonmey on January 19, 2012, 07:28:52 PM
When and if you get your coins back, the first thing to do with the new wallet file is to run the client with the parameter -keypool=10000.  This will change the number of pre-generated addresses from the pitifully small 100 that it is by default, to a large enough quantity that your backup copy should be good for at least a year or two.  10k addresses puts the wallet size at about 70Mb, which is large, but not unbearably so, and the inconvenience is far less than that of losing coins.  It may take a half hour or so to generate them, depending on how fast your machine is, but after that it will run as normal.