Author

Topic: Wallet.dat corrupt (Read 2135 times)

HCP
legendary
Activity: 2086
Merit: 4361
September 23, 2020, 01:20:28 AM
#20
Was your wallet.dat encrypted? Did it have a password? If it did, then this method of scanning for hex bytes "0201010420" and then taking the next 32 bytes will not work.

That method only works if the keys in the wallet.dat are not encrypted with a password.
newbie
Activity: 20
Merit: 0
September 23, 2020, 01:04:02 AM
#19
Hi HI-TEC 99
Can you tell me more about the 32 bytes to take from the hexadecimal editor software.
On this topic
https://bitcointalksearch.org/topic/walletdat-corrupt-2012533

how to choose the first 32 bytes please
legendary
Activity: 1512
Merit: 1124
Invest in your knowledge
December 31, 2017, 03:11:11 PM
#18
I had a coldstorage machine with over 50 altcoins that was heavily encrypted (3 encryptions: Window's Bitlocker (I had the file key), Bitdefender, and the Wallet.dat passphrase) (the mindset of 2013-2014 was much different now). I recovered all the formatted harddrive's data using a data recovery software, found all 50 wallets and then recovered them.

So now time to actually use these old 2014 wallet.dat files, and unfortunately every time i tried each wallet, i got "wallet.dat is corrupted can't be salvaged", i tried pywallet, hexeditors and etc, i'm a novice when it comes to computer coding.

I finally resolved the issue by first trying -salvagewallet command in the exe wallet file, and the wallet would close immediately. I tried then downloading the older versions (2014) files of the wallets, those still woulden't work.

The last thing i tried was -upgradewallet command, and executed the file. And behold, it worked (i think). I posted this being very ampped up and excited, but i see the QT wallet opened and i see 1 transaction in the history. I'll keep you guys updated when i actually make a transaction.

I've started with Vertcoin (the newest wallet available).


Step-by-step for beginners:

1) Download the latest QT wallet.
2) Don't start it, if you've already downloaded blocks, then delete the entire roaming folder (except wallet.dat)
3) Place your wallet.dat file in the roaming folder
4) Create a shortcut of the QT file, and add -upgradewallet in the executable line.
5) Open the wallet


After reading and reviewing several articles on Bitcointalk and spending 2-3 hours trying to recover old coins, i found this to work.

Edit: Yeah, this worked for me most of the time. I unlocked the wallet with my old passphrase list, and dumped the private keys, and imported them to electrum. Got my final balance and everything! Keep hunting and you'll find a solution that works to open your corrupted wallet.

Edit 2: After trying other wallets, i realized that if a coin had a fork in the chain, you will need to use older wallet versions, specifically the version of the wallet you first made the wallet.dat on. I also had noticed that my restore backup made sometimes 3 different versions of my wallet.dat files, and one would work only. I used EaseUS data recovery fyi.
newbie
Activity: 9
Merit: 0
August 24, 2017, 09:50:04 AM
#17
Greatings!
Can you guys help me pls?
How can i reset the password of my corrupted wallet.dat so i can find privkey in hex editor?
I know the password.
sr. member
Activity: 392
Merit: 268
Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ
July 29, 2017, 02:18:02 PM
#16
Finally I got it working and got my bitcoin address as well. I really am an idiot..... the reason I couldn't get pywallet to work was because I had to write D: but I wrote D:\ by mistake.
Thank you to everyone who helped me out. Wink
Any chance you could list the steps you took to actually set up pywallet,  for a novice computer user to understand?. I am in the same situation you were in, with potentially 32 BTC at stake. I will understand if you don't have the time or inclination to help. Cheers.

Might be a really late reply.

First of all, stop using the computer/hard disk that the wallet was on immediately. Every time you write to that disk, you lower your chances of recovery.

Using another computer, create a live DVD or live USB for Ubuntu Linux by downloading the Ubuntu install disk file and using a disk burning tool (for DVD) or Unetbootin (for flash drive). Insert that drive into the computer with the lost wallet, and boot using that live CD. Pick "try Ubuntu".

Once it's booted up, download pywallet and put it in the Downloads folder. Open a terminal, use the cd command to change directory (if it's in Downloads, cd Downloads will do the trick).
Open up the Disks tool and identify the ID and size of the partition that the wallet was on. The ID is something like /dev/sda3.
Back in the terminal, run the following command:

Code:
python pywallet--recover --recov_size 30.1Gio --recov_device /dev/sda3 --recov_outputdir ~/Desktop/recov

Replace /dev/sda3 with the ID of the partition you found in the Disks tool.
Replace 30.1Gio with the size of the partition that you also found in the Disks tool. (note that pywallet uses Gio instead of GB to mean Gigabytes).
If you need more details or live assistance, just PM me or email me at my username at gmail dot com and I'll try to help.
legendary
Activity: 1372
Merit: 1252
July 11, 2017, 11:31:39 AM
#15
Finally I got it working and got my bitcoin address as well. I really am an idiot..... the reason I couldn't get pywallet to work was because I had to write D: but I wrote D:\ by mistake.
Thank you to everyone who helped me out. Wink

Im glad that you are able to enjoy your BTC after this scare. I know the stress of potentially losing your wallet.dat myself, it is the worst feeling ever.

Generally if Recuva shows you a green, then it's good to go, the file should be intact.

In fact right now im going to do my weekly backup and put my wallet into every usb pendrive I can find.
newbie
Activity: 6
Merit: 0
July 10, 2017, 07:24:35 PM
#14
Finally I got it working and got my bitcoin address as well. I really am an idiot..... the reason I couldn't get pywallet to work was because I had to write D: but I wrote D:\ by mistake.
Thank you to everyone who helped me out. Wink
legendary
Activity: 2772
Merit: 2846
July 10, 2017, 03:18:56 PM
#13
Sadly my wallet had a password


You could continue trying to use pywallet. However it's very old software and difficult to use (as you found out).

What operating system did you install pywallet onto?

I had it working on windows, but I can't remember all the steps I made to install it. This is a screenshot showing the windows command that got it working for me. That command scans a whole drive rather than just one file.

newbie
Activity: 6
Merit: 0
July 10, 2017, 02:53:48 PM
#12
Sadly my wallet had a password
legendary
Activity: 2772
Merit: 2846
July 10, 2017, 02:31:45 PM
#11
Did your wallet.dat have a password? If it didn't try opening the wallet.dat in a hex editor and searching for this string of bytes 0201010420. The next the thirty-two bytes after that string might be a private key.

This is a hex editor I use but any other should work.

https://sourceforge.net/projects/wxhexeditor/

In the hex editor's menu click file, then open, then navigate to the folder containing your wallet.dat6 and open it.



Afterwards click "edit", then "find".



This window should open. Paste the hex string into the the text box labelled "search", then click the button labelled "find all" and wait for it to search the wallet.dat file.



Make sure you run all software offline inside a virtualbox or vmware virtual machine. Don't risk viewing private keys on any computer that connects to the internet.

If you get any results from your search the following 32 bytes could be a private key.

Copy them into notepad and remove any spaces. This is an example of a private key copied from a hex editor into notepad with the spaces removed.



That can then be copied into an offline copy of this website, which will convert it into a format that Bitcoin wallets like electrum can import.

https://www.bitaddress.org/


This is the private key copied from notepad into an offline copy of the bitaddress website. Clicking the view details button converts the private key into normal formats.



full member
Activity: 217
Merit: 109
July 10, 2017, 02:04:33 PM
#10
I'm getting a similar result when trying my wallet dat, but using the latest Bitcoin core. I get Failed to rename wallet.dat to wallet.1499712863.bak.
newbie
Activity: 6
Merit: 0
July 10, 2017, 01:57:20 PM
#9
I tried to run it as admin but the same thing happened, it started up for a second and then closed itself.
legendary
Activity: 2772
Merit: 2846
July 10, 2017, 01:52:51 PM
#8
Did you try right clicking the shortcut and selecting "run as administrator"? It seems Bitcoin core can't rename the wallet.dat. Maybe it's a permissions error.

Quote
Failed to rename wallet.dat to wallet.1499700079.bak
newbie
Activity: 6
Merit: 0
July 10, 2017, 01:34:36 PM
#7
I still can't figure out how to use pywallet
how do i find out what device i want to read from, I have a raid0 drive (As C:) and the drive i want to recover from (As D:).

With the -salvagewallet line im getting this:

2017-07-10 15:21:19 Bitcoin version v0.14.2
2017-07-10 15:21:19 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2017-07-10 15:21:19 Assuming ancestors of block 00000000000000000013176bf8d7dfeab4e1db31dc93bc311b436e82ab226b90 have valid signatures.
2017-07-10 15:21:19 ParameterInteraction: parameter interaction: -salvagewallet=1 -> setting -rescan=1
2017-07-10 15:21:19 GUI: "registerShutdownBlockReason: Successfully registered: Bitcoin Core didn't yet exit safely..."
2017-07-10 15:21:19 Default data directory C:\Users\Aleks\AppData\Roaming\Bitcoin
2017-07-10 15:21:19 Using data directory C:\Users\Aleks\AppData\Roaming\Bitcoin
2017-07-10 15:21:19 Using config file C:\Users\Aleks\AppData\Roaming\Bitcoin\bitcoin.conf
2017-07-10 15:21:19 Using at most 125 automatic connections (2048 file descriptors available)
2017-07-10 15:21:19 Using 32 MiB out of 32 requested for signature cache, able to store 1048576 elements
2017-07-10 15:21:19 Using 4 threads for script verification
2017-07-10 15:21:19 Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2017-07-10 15:21:19 Using wallet wallet.dat
2017-07-10 15:21:19 scheduler thread start
2017-07-10 15:21:19 init message: Verifying wallet...
2017-07-10 15:21:19 CDBEnv::Open: LogDir=C:\Users\Aleks\AppData\Roaming\Bitcoin\database ErrorFile=C:\Users\Aleks\AppData\Roaming\Bitcoin\db.log
2017-07-10 15:21:19 Failed to rename wallet.dat to wallet.1499700079.bak
2017-07-10 15:21:19 scheduler thread interrupt
2017-07-10 15:21:19 Shutdown: In progress...
2017-07-10 15:21:19 Shutdown: done

And it was green in recuva Wink
As I said I'm new to this XD
legendary
Activity: 1372
Merit: 1252
July 10, 2017, 01:19:11 PM
#6
Hey guys, so I kinda formated my drive and lost my wallet.dat. I was kinda able to get it back via recuva. But when i launch the wallet program it was corrupt. Im new to bitcoin and honestly i have no clue what to do, could someone help me. Wink

I have used recuva in the past too to get a wallet file that i mistakingly deleted, but the deletion was very recent so recuva shown a green light for the deleted wallet.dat file.

Was your wallet.dat file shown as green or orange?

If it's not was green... then maybe it's too damaged.
legendary
Activity: 2772
Merit: 2846
July 10, 2017, 12:37:26 PM
#5
You could try making a backup of your wallet.dat, then starting Bitcoin core with the -salvagewallet option.

To do that right click bitcoin-qt.exe and select "create shortcut" from the menu that appears. Afterwards right click the shortcut and select properties from the menu that appears. A new window should open. Add a space, then the text in the line below to the end of whatever is already in the textbox named target

 -salvagewallet

This is an example of what the textbox should look like afterwards.



Click the apply button, then the OK button to close the window.

Double click the new shortcut to start Bitcoin core with the -salvagewallet option enabled.
sr. member
Activity: 392
Merit: 268
Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ
July 10, 2017, 11:54:23 AM
#4
You have to change the command line parameters to match those of your system and situation. /dev/sda3 should be the block device where the wallet was, recov_size should be the size of that block device, and output directory should be your actual home directory.
newbie
Activity: 6
Merit: 0
July 10, 2017, 10:56:48 AM
#3
I'm trying to use it by the command

pywallet.py --recover --recov_size 30.1Gio --recov_device /dev/sda3 --recov_outputdir /home/jackjack/recovered_wallets

but all I'm getting is

Starting recovery.
Can't open /dev/sda3, check the path or try as root
  Error: (2, 'No such file or directory')

I'm a dunce xd
sr. member
Activity: 392
Merit: 268
Tips welcomed: 1CF4GhXX1RhCaGzWztgE1YZZUcSpoqTbsJ
July 10, 2017, 10:08:09 AM
#2
You may be able to salvage at least some keys using pywallet's recovery tool: https://bitcointalksearch.org/topic/guide-recover-your-deleted-keys-38004

It normally scans a block device, but it may be possible to scan the partially recovered file directly.
newbie
Activity: 6
Merit: 0
July 10, 2017, 09:43:00 AM
#1
Hey guys, so I kinda formated my drive and lost my wallet.dat. I was kinda able to get it back via recuva. But when i launch the wallet program it was corrupt. Im new to bitcoin and honestly i have no clue what to do, could someone help me. Wink
Jump to: