2

First of all .. yes im stupid. Now .. I had some BTC a few years ago. Thought I had kept it safe, now I seem to have reinstalled the OS on that PC and wiped profile folder. I looked around for a wallet.dat file and found one, but it could also be a file of another crypto currency .. not sure, it's so long ago I'm not sure what I did anymore but the date on the file seems on the old side (december 2013). I installed Bitcoin Core (I used what existed before CORE came out .. just bitcoin afaik ?), I let it sync for a day and am now caught up. I replaced the wallet.dat file and started the client again. First it took a few minutes rescanning, then crashed at 100% (???). I restarted client again, now it said it had to update the blockchain a bit more, it was at 99.9% and quickly finished. Now it shows my wallet is empty, but it also tells me it is encrypted and locked. I tried unlocking from the debug console, but it tells me the pw is incorrect. This is weird because the only thing I'm sure of is that this is the correct password. Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something ? Even without unlocking should I be able to see the balance at least ? I know its also possible to have the private key saved somewhere (thats what I should have done, but what I have saved looks short to me, I assume its the password.) Looking at the balance of 0 BTC i have a feeling this jsut means I'm screwed. I only have myself to blame. I'm still going to attempt to find another backup file, or attempt to restore deleted files from that disk, maybe there's still something there.

2
  • 1
    Maybe you should try again with the final version of bitcoin-qt... bitcoin-0.8.6-win32-setup.exe. It is available at compzets.com and has the right sha256
    – Mark Ch
    Commented May 27, 2017 at 9:19
  • Even without the password you'd still be able to see a transaction history. So likely this wallet.dat is for an altcoin if you're sure you had activity on it
    – hydrabeast
    Commented Apr 16, 2021 at 22:49

1 Answer 1

0

Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something?

According to https://en.bitcoin.it/wiki/Wallet_encryption

This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.

Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change)


According to https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README

Bitcoin 0.4.1 BETA

Technical details of wallet encryption

Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change).


The current version's C++ code at https://github.com/bitcoin/bitcoin/blob/master/src/wallet/crypter.cpp mentions the same algorithms but I haven't tried to work out if the encryption is in fact identical to the early versions or if this is even the relevant source file (though it's name and location suggests so).


It seems likely the encryption method is compatible between current and older versions.

I would hope that any competent software developer, when changing the encryption method, would implement a wallet version number or other indicator that would allow new software to detect older wallet.dat files and either upgrade them silently or provide an appropriate message to the user.

I may be wrong though.

1
  • 1
    The encryption algorithm has never been changed (as of april 2021). Wallet files created by older versions should be compatible with all new releases afterwards. Commented Apr 16, 2021 at 15:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.