Bitcoin Forum
May 09, 2024, 12:13:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does salvagewallet work?  (Read 939 times)
qasimilyas99 (OP)
Newbie
*
Offline Offline

Activity: 55
Merit: 0


View Profile
July 03, 2017, 02:54:22 PM
 #1

How does salvagewallet work?
What is salvagewallet?
What it's benefits of salvagewallet?
Thank You.
1715213586
Hero Member
*
Offline Offline

Posts: 1715213586

View Profile Personal Message (Offline)

Ignore
1715213586
Reply with quote  #2

1715213586
Report to moderator
1715213586
Hero Member
*
Offline Offline

Posts: 1715213586

View Profile Personal Message (Offline)

Ignore
1715213586
Reply with quote  #2

1715213586
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715213586
Hero Member
*
Offline Offline

Posts: 1715213586

View Profile Personal Message (Offline)

Ignore
1715213586
Reply with quote  #2

1715213586
Report to moderator
1715213586
Hero Member
*
Offline Offline

Posts: 1715213586

View Profile Personal Message (Offline)

Ignore
1715213586
Reply with quote  #2

1715213586
Report to moderator
1715213586
Hero Member
*
Offline Offline

Posts: 1715213586

View Profile Personal Message (Offline)

Ignore
1715213586
Reply with quote  #2

1715213586
Report to moderator
SopaXT
Full Member
***
Offline Offline

Activity: 158
Merit: 113


View Profile
July 03, 2017, 03:14:21 PM
 #2

Please learn to use Google.
There you go - https://bitcoin.stackexchange.com/questions/52367/how-does-salvagewallet-work/52374.

l008com
Member
**
Offline Offline

Activity: 77
Merit: 10


View Profile
August 10, 2017, 09:37:50 AM
 #3

I am not @OP, but I used google and found the suggested link BEFORE I found this thread, and many many others. And I have yet to find anything that really explains in detail what salvagewallet does, and how you actually get old coins out of a corrupt wallet with it, and into a fresh wallet. I'll keep searching but most of what you get with a google search is "i tried salvagewallet and it didn't work, now what?"

BTC: 1B5ahrgQa2UpTFukjjacAWqFPShHyAStpZ
GRC: S942CyMgHz42EosvT9L1dKCwB1HVM2TDZk
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
August 10, 2017, 10:33:18 AM
 #4

It makes a copy of a wallet.dat (typically one that has been corrupted) and then crawls through your wallet.dat, which is essentially a "database" file... and attempts to find private keys. I suspect by looking for particular byte sequences, but I'm not 100% sure on that.

I believe it just dumps any "detected" private keys into a a text file... detected does not necessarily mean your actual private keys... just sequences of bytes that match the length and format of a private key.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 10, 2017, 05:50:31 PM
 #5

The Bitcoin Core wallet is a Berkeley DB database. It consists of key-value pairs.

Salvage wallet calls BDB DB->verify() function with the DB_AGGRESSIVE flag which will result in it outputting any and all key-value pairs that it can find, even ones that were deleted or corrupted. This means that -salvagewallet can find key-value pairs that normally wouldn't be in your wallet.

These key value pairs are then scanned. Anything that has a key that begins with the strings key, ckey, wkey, or mkey will be pulled out and written to a new database file. It is important to note that those records are not checked for consistency. They are simply passed through. If the rest of the key (which usually contains a public key) or the value of the pair (which may contain the private key) is corrupted, salvagewallet will not detect it and will not be able to do anything to fix it. salvagewallet is only for recovering key type key-value pairs from a badly corrupted wallet. It cannot help you if the public or private keys themselves are corrupted. Lastly, using savagewallet on an non-corrupted wallet may result in that wallet becoming corrupted.

morbius55
Full Member
***
Offline Offline

Activity: 217
Merit: 109


View Profile
August 12, 2017, 07:43:43 PM
 #6

At what stage does de encryption take place and what is usually left in a wallet. bak file when salvage has failed. Thanks.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 12, 2017, 10:22:01 PM
 #7

At what stage does de encryption take place
None. Wallets are not decrypted or encrypted during the salvage wallet process; there is no need to do that.

and what is usually left in a wallet. bak file when salvage has failed. Thanks.
The .bak files are backup files that are produced before salvagewallet begins the actual salvage. The .bak files are a copy of the original wallet file.

morbius55
Full Member
***
Offline Offline

Activity: 217
Merit: 109


View Profile
August 13, 2017, 09:00:53 AM
 #8

How does it find private keys if the wallet.dat is encrypted?.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
August 13, 2017, 05:57:58 PM
 #9

How does it find private keys if the wallet.dat is encrypted?.
The encryption used in Bitcoin Core is not a wallet file encryption. It does not encrypt the whole file. Rather it encrypts individual keys and stores those encrypted keys. So only the keys are encrypted, and they have a record type of ckey. This individual key encryption is what allows you to get new addresses and see your transactions and wallet balance even when your wallet is not unlocked.

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!