├── reddcovery.py ├── README.md └── LICENSE /reddcovery.py: -------------------------------------------------------------------------------- 1 | import re 2 | import hashlib 3 | import base58 4 | from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent 5 | 6 | def bytetohex(byteStr): 7 | return ''.join( [ "%02X " % ord( x ) for x in byteStr ] ).strip() 8 | 9 | addresstype = [b"\x61", b"\xBD"] 10 | 11 | databaseHandler = open("wallet.dat", "rb") 12 | dbDump = databaseHandler.read() 13 | 14 | privateKeyCollection=set(re.findall(b'\x70\x6F\x6F\x6C(.{52})', dbDump)) 15 | 16 | print("I found %d private keys" % len(privateKeyCollection)) 17 | 18 | for key in privateKeyCollection: 19 | key = key[20:] 20 | bytetohex(key) 21 | key = addresstype[1] + key + b"\x01" 22 | checksum = hashlib.sha256(hashlib.sha256(key).digest()).digest()[:4] 23 | addr = key + checksum 24 | print base58.b58encode(addr) 25 | 26 | databaseHandler.close() 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | reddcovery 2 | ========== 3 | 4 | Recover private keys from a (corrupted) wallet.dat (Reddcoin) 5 | 6 | ### Alternatives 7 | 8 | I usually have more success using https://github.com/lionzeye/reddcointools or https://github.com/lionzeye/pywallet 9 | 10 | ### Prerequisites 11 | - PyCoin https://pypi.python.org/pypi/pycoin/ 12 | - Base58 https://pypi.python.org/pypi/base58/ 13 | 14 | ### Usage 15 | 16 | #### From a Windows executable: 17 | 18 | - https://github.com/lionzeye/reddcovery/releases/ 19 | 20 | #### From scratch: 21 | 22 | - Start your command-prompt. 23 | - Change your working directory to a directory with our 'reddcovery.py' and 'wallet.dat'. 24 | - Start the script by executing: 25 | 26 | python reddcovery.py > keys.txt 27 | 28 | - Find your private keys in "keys.txt" in your working directory. 29 | 30 | # Reddcovery is free, but tips are cool: RiYmvK5XqbxCtmKK8vcFbU5YBWQ9DFq6h2 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Leonard Simonse 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. --------------------------------------------------------------------------------