Bitcoin Forum
May 25, 2024, 12:09:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Corrupt wallet.dat recovery options  (Read 120 times)
wallet.duh (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
September 10, 2022, 05:51:07 PM
Merited by vapourminer (1)
 #1

Its been recommended to me to start a thread for some help recovering an old wallet.dat file.

I had made a post in the Pywallet 2.2 thread and the farthest I got was this error message,

(22, 'Invalid argument -- C:\\Python27\\wallet.dat: unexpected file type or form
at')
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this
again.

I tried to open this file with Bitcoin core before using pywallet and got a similar "data is not in recognized format" error.

It might be worth mentioning I recovered the file using EaseUS data recovery wizard some time ago.

Thank you for any help.
BitMaxz
Legendary
*
Offline Offline

Activity: 3262
Merit: 2977


:( My PC broke due trying to recover an old wallet


View Profile WWW
September 10, 2022, 11:37:35 PM
 #2

Would you mind to try to salvage the wallet.dat let's see if you can still recover some private keys from the corrupted wallet.dat.

-salvage is now in Bitcoin-wallet.exe you can find this tool under Bitcoin/daemon and you must run the command prompt as administrator and make sure you are in the same folder to run salvage.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5630


Self-proclaimed Genius


View Profile
September 11, 2022, 03:00:24 AM
Merited by ABCbits (3), vapourminer (1)
 #3

I tried to open this file with Bitcoin core before using pywallet and got a similar "data is not in recognized format" error.

It might be worth mentioning I recovered the file using EaseUS data recovery wizard some time ago.
Salvage will likely return with the same error message since the wallet file's header may be corrupted.

Anyways, to correctly use the command, you should use these commands with your Command Prompt or Powershell (prepend with ./ for powershell),
Change directory to bitcoin/daemon (change the dir if Bitcoin Core is installed to another dir):
Code:
cd C:\Program Files\Bitcoin\daemon
Provide the path to the wallet.dat file and the salvage command (without the "-"):
Code:
bitcoin-wallet --wallet="C:\Python27\wallet.dat" salvage


Since you already set-up pywallet, using -recover is worth the try.
It should be able to find if there are recoverable keys from your wallet.dat file.
Follow this guide for the commands:
Here's an example command for recover (tested with python v2.7.17 and latest version of pywallet):
Code:
python pywallet.py --recover --recov_device=D: --recov_size=50Gio --recov_outputdir=C:\pywallet_recov_dir
Then you'll be prompted for the to-be-created wallet's passphrase (where the keys will be imported) and the deleted wallets'/keys' possible passphrases.
(characters wont display as you type the passphrases)

The result will be a wallet.dat named "recovered_wallet_<number>.dat" that you can load to Bitcoin Core.

In your case, just move the corrupted wallet.dat to the root of your other drive, then use its drive letter as the --recov_device,
then fill out the --recov_size which is the drive's size and --recov_outputdir where you want to put the recovered wallet.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!