Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: morbius55 on August 18, 2017, 07:20:53 PM



Title: corrupt wallet.dat
Post by: morbius55 on August 18, 2017, 07:20:53 PM
How can you tell whether it is encrypted or not?. Thanks.


Title: Re: corrupt wallet.dat
Post by: achow101 on August 19, 2017, 06:24:44 AM
Bitcoin Core encrypts keys individually, i.e. the entire file is not encrypted. Each encrypted key is the roughly the same length, as are most other pieces of data in the wallet. You can tell if it is corrupted by looking at the unencrypted data and seeing if that looks corrupted. If keys themselves are corrupted, then you can't tell until you try decrypting them.


Title: Re: corrupt wallet.dat
Post by: morbius55 on August 19, 2017, 10:50:27 AM
Every so often it will say the word key when looking at it via notepad, is that a good sign?.


Title: Re: corrupt wallet.dat
Post by: achow101 on August 19, 2017, 05:40:23 PM
Every so often it will say the word key when looking at it via notepad, is that a good sign?.
Yes. You should also see the strings version, ckey, mkey, minversion, pool, keymeta, hdchain, etc. These strings mark what type of entry a key-value pair is. You can also use BDB's db_dump utility to see what the key-pairs are.


Title: Re: corrupt wallet.dat
Post by: morbius55 on August 19, 2017, 08:36:02 PM
Every so often it will say the word key when looking at it via notepad, is that a good sign?.
Yes. You should also see the strings version, ckey, mkey, minversion, pool, keymeta, hdchain, etc. These strings mark what type of entry a key-value pair is. You can also use BDB's db_dump utility to see what the key-pairs are.

Am I right in saying that if it just says key then that is a private key. Thanks for taking the time to reply.


Title: Re: corrupt wallet.dat
Post by: achow101 on August 20, 2017, 02:38:57 AM
Am I right in saying that if it just says key then that is a private key. Thanks for taking the time to reply.
Yes, things that contain key at the beginning of the key-value pair are usually followed by the public key as the remainder of the key part of the key-value pair, and the value is usually the private key. However some things do contain the word key but aren't actually keys, like keymeta.

For a bitcoin private key, it will have a string of characters which will either begin with a 5, a K or an L? Is this the case with what comes after the "key" in your .dat file.
No. Please don't post if you don't know what you are talking about.

The Bitcoin Core wallet files do not store keys in Wallet Import Format; WIF is not the only format for private keys. It is far more efficient to store things in binary in a different format that is not human readable.