Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: nosdi26 on May 15, 2022, 04:42:10 PM



Title: wallet.dat corrupt salvage failed
Post by: nosdi26 on May 15, 2022, 04:42:10 PM
Hi to all, i have a wallet.dat file that when i insert it in bitcoin core it sayw wallet.dat corrupt salvage failed. I tried guides from this forum with python, but no private keys.I also tried with blockchain.com with no luck.
Please comment on this as its important to extract the private keys
Thanks in advance


Title: Re: wallet.dat corrupt salvage failed
Post by: BlackHatCoiner on May 15, 2022, 05:54:41 PM
Try running daemon/bitcoin-wallet with the salvage command.
Code:
bitcoin-wallet -wallet=<wallet-name> salvage

It tries to recover the keys from the broken wallet's database. Alternatively, try pywallet (https://github.com/jackjack-jj/pywallet):
Code:
python pywallet.py --dumpwallet --wallet=wallet.dat > wallet.txt


Title: Re: wallet.dat corrupt salvage failed
Post by: nc50lc on May 16, 2022, 04:13:18 AM
Take note that bitcoin-wallet's salvage command above will default to the 'wallets' folder of the data directory if the wallet's absolute path isn't provided.
So if it's in any other folder, provide the full path to the wallet.dat.

e.g.: -wallet="E:\AppData\bitcoin\test_wallet.dat"


Title: Re: wallet.dat corrupt salvage failed
Post by: NotATether on May 16, 2022, 05:00:10 AM
If the wallet is password-protected, and this will not be the case if its from a *very* old Core version before this was implemented, you will need to pass a particular password argument to pywallet so it can decrypt the encrypted private keys.

I swear I saw that option somewhere, but now I can't find it anymore in the README. Else the private keys will all be encrypted with an AES256 intermediate secret contained inside the wallet (also) that can only be decrypted with the wallet.dat password.


Title: Re: wallet.dat corrupt salvage failed
Post by: ABCbits on May 16, 2022, 11:10:15 AM
Alternatively, try pywallet (https://pypi.org/project/pywallet/):
Code:
python pywallet.py --dumpwallet --wallet=wallet.dat > wallet.txt

Did you include wrong link? That link leads to pywallet library which meant to create HD/BIP 32 wallet. Pywallet for wallet recovery is available at https://github.com/jackjack-jj/pywallet (https://github.com/jackjack-jj/pywallet).