Bitcoin Forum
August 14, 2018, 07:46:24 AM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Corrupted old wallet help!!  (Read 89 times)
Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 10:10:35 AM
 #1

Hello mates,

I need some help to recover my bitcoin wallet. I have read several posts here about that and made some research on google, but I couldn't find how to recover it easily using only windows 10/7 because I've never used linux before...

The wallet is from around 2012 and don't know if password protected, think not. File sizes less than 1 mb.

I have tried to install bitcoin core and put the file on directory, but the message shown is the following:
"wallet.dat corrupt, salvage failed"

What do you recommend me to do?

P.D: I don't offer initially any reward for helping, but if finally I achieve to recover the lost funds, for sure I will be grateful with the person who helped me.
1534232784
Hero Member
*
Offline Offline

Posts: 1534232784

View Profile Personal Message (Offline)

Ignore
1534232784
Reply with quote  #2

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

Activity: 644
Merit: 514



View Profile WWW
December 20, 2017, 12:02:06 PM
 #2

What do you recommend me to do?

The first thing you should do is to create several backups.
Do not try any recovery on the original file. Use copies for that.

You can try to extract your private keys out of your wallet.dat using any recovery tool.
You can use pywallet (https://github.com/jackjack-jj/pywallet) for example.
The command needed to be run is ./pywallet --wallet=wallet.dat --datadir=/path/to/folder_with_wallet.dat --dumpwallet
For more detailed instructions visit the github repository (link posted above).


Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 12:21:17 PM
 #3

What do you recommend me to do?

The first thing you should do is to create several backups.
Do not try any recovery on the original file. Use copies for that.

You can try to extract your private keys out of your wallet.dat using any recovery tool.
You can use pywallet (https://github.com/jackjack-jj/pywallet) for example.
The command needed to be run is ./pywallet --wallet=wallet.dat --datadir=/path/to/folder_with_wallet.dat --dumpwallet
For more detailed instructions visit the github repository (link posted above).




thanks but where should I run this? opening command prompt? or how?

I've read github and installed python 2.7 and installed twisted but dont know how to apply step 3:


"3. Untested, proposed by TeaRex: install Zope.Interface from: http://www.lfd.uci.edu/~gohlke/pythonlibs"

I've navigated there but don't know now which of these files should I download and then how to install that :S

zope.interface‑4.4.3‑cp27‑cp27m‑win32.whl
zope.interface‑4.4.3‑cp27‑cp27m‑win_amd64.whl

racquemis
Full Member
***
Offline Offline

Activity: 171
Merit: 100


View Profile
December 20, 2017, 12:29:24 PM
 #4

Did you install python?
Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 12:36:15 PM
 #5

Did you install python?

I said that on previous post. I've installed python 2.7.
racquemis
Full Member
***
Offline Offline

Activity: 171
Merit: 100


View Profile
December 20, 2017, 12:38:34 PM
 #6

Did you install python?

I said that on previous post. I've installed python 2.7.

Ok do these steps:

Download the egg files:

(32bit). http://pypi.python.org/pypi/setuptools#downloads to install setuptools
(64bit). http://pypi.python.org/pypi/setuptools#windows to download, then run ez_setup.py

 4. Go to C:\Python27\Scripts
 5. Run easy_install.exe zope.interface-3.6.4-py2.7-win-amd64.egg
SopaXT
Full Member
***
Offline Offline

Activity: 162
Merit: 109


View Profile
December 20, 2017, 12:46:46 PM
 #7

You can also try using my Python 2 script for dumping the wallet (it's loosely based on pywallet, and might work better with some corrupted wallets)

Code:
import sys
import struct
from bsddb.db import *
from hashlib import sha256

# Dumps the private keys from a wallet.dat file.
# Inspired by pywallet.

B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

if not len(sys.argv) == 2:
    print("Usage: %s <wallet_file>" % sys.argv[2])
    sys.exit(1)

def read_size(buffer, offset):
    size = ord(buffer[offset])
    offset += 1

    if size == 0xfd:
        size = struct.unpack_from("<H", buffer, offset)[0]
        offset += 2
    if size == 0xfe:
        size = struct.unpack_from("<I", buffer, offset)[0]
        offset += 4
    if size == 0xff:
        size = struct.unpack_from("<Q", buffer, offset)[0]
        offset += 8

    return offset, size

def read_string(buffer, offset):
    offset, string_len = read_size(buffer, offset)
    return offset + string_len, buffer[offset: offset + string_len]

def b58_encode(d):
    out = ""
    p = 0
    x = 0

    while ord(d[0]) == 0:
        out += "1"
        d = d[1:]

    for i, v in enumerate(d[::-1]):
        x += ord(v)*(256**i)

    while x > 58**(p+1):
        p += 1

    while p >= 0:
        a, x = divmod(x, 58**p)
        out += B58[a]
        p -= 1

    return out

def b58check_encode(d):
    checksum = sha256(sha256(d).digest()).digest()[:4]
    return b58_encode(d + checksum)


db = DB()
db.open(sys.argv[1], "main", DB_BTREE, DB_RDONLY)

items = db.items()

for item in items:
    k, v = item
    koff, voff = 0, 0
    koff, item_type = read_string(k, koff)

    if item_type == "key":
        koff, pubkey = read_string(k, koff)
        voff, privkey = read_string(v, voff)

        if len(privkey) == 279:
            secret = privkey[9:9+32]
        else:
            secret = privkey[8:8+32]

        if pubkey[0] != "\x04":
            secret += "\x01"

        print(b58check_encode("\x80" + secret))
        print(secret.encode("hex"))
db.close()

Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 12:59:25 PM
 #8

thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"

Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 01:01:54 PM
 #9

Thanks for your help but I don't understand nothing of these commands and don't know even how to rule python

I'm not a computer engineer nor a programmer :S
racquemis
Full Member
***
Offline Offline

Activity: 171
Merit: 100


View Profile
December 20, 2017, 01:03:29 PM
 #10

Thanks for your help but I don't understand nothing of these commands and don't know even how to rule python

I'm not a computer engineer nor a programmer :S

Well you will quickly have to learn because as far as i know trying to recover the private key with pywallet is the only option you have so far :-)
SopaXT
Full Member
***
Offline Offline

Activity: 162
Merit: 109


View Profile
December 20, 2017, 01:05:41 PM
 #11

thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"


Do you have easy_install.exe in the C:\Python27\Scripts folder?

Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 02:01:39 PM
 #12

thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"


Do you have easy_install.exe in the C:\Python27\Scripts folder?


yes!!
SopaXT
Full Member
***
Offline Offline

Activity: 162
Merit: 109


View Profile
December 20, 2017, 03:37:59 PM
 #13

And the zope.interface-3.6.4-py2.7-win-amd64.egg?

Chipychop
Member
**
Offline Offline

Activity: 91
Merit: 10


View Profile
December 20, 2017, 04:55:18 PM
 #14

And the zope.interface-3.6.4-py2.7-win-amd64.egg?

nope Sad
SopaXT
Full Member
***
Offline Offline

Activity: 162
Merit: 109


View Profile
December 21, 2017, 04:26:55 PM
 #15

And the zope.interface-3.6.4-py2.7-win-amd64.egg?

nope Sad

Anyway, that was racquemis' method.
Mine is a little bit different.

Did you see the Python script I posted above?
Copy it into Notepad and save it in C:\Python27 as dumpwallet.py (make sure it's not .txt!), and then open the command prompt.

Enter the following:
Code:
cd C:\Python27
python.exe dumpwallet.py %AppData%\Bitcoin\wallet.dat > private_keys.txt

The private_keys.txt file in C:\Python27 will contain a list of WIF private keys extracted from your wallet.
You can import them into Electrum later, if you succeed.

Make sure that your PC is not connected to the internet while running the commands for extra security.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!