Bitcoin Forum
November 11, 2024, 04:35:13 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: corrupt wallet.dat  (Read 672 times)
morbius55 (OP)
Full Member
***
Offline Offline

Activity: 217
Merit: 109


View Profile
August 18, 2017, 07:20:53 PM
 #1

How can you tell whether it is encrypted or not?. Thanks.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
August 19, 2017, 06:24:44 AM
 #2

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.

morbius55 (OP)
Full Member
***
Offline Offline

Activity: 217
Merit: 109


View Profile
August 19, 2017, 10:50:27 AM
 #3

Every so often it will say the word key when looking at it via notepad, is that a good sign?.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
August 19, 2017, 05:40:23 PM
 #4

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.

morbius55 (OP)
Full Member
***
Offline Offline

Activity: 217
Merit: 109


View Profile
August 19, 2017, 08:36:02 PM
 #5

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.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
August 20, 2017, 02:38:57 AM
 #6

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.

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!