├── README.md └── pywallet.py /README.md: -------------------------------------------------------------------------------- 1 | ## Pywallet 2.3 - wallet.dat management and key recovery tool forked by Mike Borghi 2 | ###### This documentation is a work in progress and I plan to finish it within a couple days 3 | ___ 4 | ###### Other helpful programs: 5 | * [Bitcoin-tool (cli)](https://github.com/matja/bitcoin-tool) for all things key related (useful for converting hexprivkey to different coins) 6 | * [Wallet-key-tool (GUI)](https://github.com/prof7bit/wallet-key-tool/releases) GUI for importing almost every different wallet file and export to various standard formats 7 | 8 | ---- 9 | ### Main features: 10 | * ##### Dump wallet private keys 11 | * ##### Scan drives for any potential privkey's and store in new .dat 12 | * Will Add More 13 | ##### Based off of [jackjack's](https://github.com/jackjack-jj) fork of Joric's pywallet with some minor bug fixes. Please submit issues and I will attempt to fix them 14 | ###### If you are looking to recover a wallet file that will not open in their respective programs, click [to be finished soon] for a easy to follow guide to recovering your funds 15 | ###### Requirements: 16 | * BSDDB 17 | * Python 2.x 18 | 19 | ------ 20 | #### Notes: 21 | * This version is incompatible with python3 22 | * BSDDB is required --- [Installation instructions using pip](https://stackoverflow.com/questions/16003224/installing-bsddb-package-python) 23 | * The primary usage of this tool at this point in time would be to dump old wallet.dat files because SPV wallets have become the norm. 24 | * The original repo did not have instructions for the recover function despite having the code for doing so 25 | 26 | ##### Known bugs: 27 | * Using othercoinversion still uses the bitcoin WIF prefix 28 | * Dumpwithbalance is barely functional because of blockchain.info's rate limiter that was introduced after the creation of this version of pywallet 29 | 30 | #### To Do: 31 | * Finish this documentation with more example commands 32 | * ``` --dumpwithbalance ``` uses blockchain.info api which implemented a very strict rate limiter so add multiple data sources 33 | * Change french storage size prefixes to English (e.g. Gio to Gb) because Murica 34 | * Add command line options for different popular coin types (like the currently implmented --testnet & --namecoin arguments) 35 | * Add missing features to the web client (web client has limited functionality) 36 | 37 | 38 | ###### While there are many versions of pywallet around, this version has more functionality such as: 39 | * a web interface 40 | * recover function which allows for scanning entire volumes or individual files for anything that resembles a privatekey and creates a .dat with the results. 41 | 42 | 43 | 44 | ------- 45 | #### Examples: 46 | * #### **Show arguments** 47 | ###### Simply navigate to the folder with pywallet.py in it and type the following to view the help text 48 | ```` python pywallet-py```` 49 | * #### Dump a wallet.dat located in the current directory 50 | ``` python pywallet.dat --dumpwallet --datadir=./ --wallet=wallet.dat ``` 51 | * The output of each address in the wallet has the following fields 52 | * 53 | "addr": " ", 54 | "balance": "x", [if --dumpwithbalance is an argument) 55 | "compressed": [true,false], 56 | "hexsec": "[hex priv key]", 57 | "private": "[raw ecdsa privkey]", 58 | "pubkey": " [addr pubkey] ", 59 | "reserve": 1, 60 | "sec": "[base58check privkey]", 61 | 62 | * ### To recover all private keys on a disk 63 | 1. * **OSX** - open terminal and type 64 | ``` diskutil list ``` 65 | * **Unix** - open terminal and type 66 | ``` fdisk -l ``` 67 | 2. * Find the identifier for the volume you would like to recover keys from 68 | 3. * Enter the following into terminal to scan ``` disk12 ``` the second partition ``` s2 ``` that has a size of 291Mb and output the recovered keys into the current directory 69 | ``` python pywallet.py --recover --recov_device=/dev/disk12s2 --recov_size=291Mio --recov_outputdir=. ``` 70 | 71 | * ###### I believe the size acronyms are french. 72 | * Gio = 1024Mb 73 | * Go = 1000Mb 74 | * Mio = 1024Kb 75 | * Mo = 1000Kb 76 | * Etc. See line 94 - 101 77 | ----- 78 | 79 | ### Command Line Arguments 80 | ``` --version show program's version number and exit 81 | -h, --help show this help message and exit 82 | --passphrase=PASSPHRASE 83 | passphrase for the encrypted wallet 84 | --dumpwallet dump wallet in json format 85 | --dumpwithbalance includes balance of each address in the json dump, 86 | takes about 2 minutes per 100 addresses 87 | --importprivkey=KEY import private key from vanitygen 88 | --importhex KEY is in hexadecimal format 89 | --datadir=DATADIR wallet directory (defaults to bitcoin default) 90 | --wallet=WALLETFILE wallet filename (defaults to wallet.dat) 91 | --label=LABEL label shown in the adress book (defaults to '') 92 | --testnet use testnet subdirectory and address type 93 | --namecoin use namecoin address type 94 | --otherversion=OTHERVERSION 95 | use other network address type, whose version is 96 | OTHERVERSION 97 | --info display pubkey, privkey (both depending on the 98 | network) and hexkey 99 | --reserve import as a reserve key, i.e. it won't show in the 100 | adress book 101 | --multidelete=MULTIDELETE 102 | deletes data in your wallet, according to the file 103 | provided 104 | --balance=KEY_BALANCE 105 | prints balance of KEY_BALANCE 106 | --web run pywallet web interface 107 | --port=PORT port of web interface (defaults to 8989) 108 | --recover recover your deleted keys, use with recov_size and 109 | recov_device 110 | --recov_device=RECOV_DEVICE 111 | device to read (e.g. /dev/sda1 or E: or a file) 112 | --recov_size=RECOV_SIZE 113 | number of bytes to read (e.g. 20Mo or 50Gio) 114 | --recov_outputdir=RECOV_OUTPUTDIR 115 | output directory where the recovered wallet will be 116 | put 117 | --clone_watchonly_from=CLONE_WATCHONLY_FROM 118 | path of the original wallet 119 | --clone_watchonly_to=CLONE_WATCHONLY_TO 120 | path of the resulting watch-only wallet 121 | --dont_check_walletversion 122 | don't check if wallet version > 81000 before running 123 | (WARNING: this may break your wallet, be sure you know 124 | what you do) 125 | --wait=NSECONDS wait NSECONDS seconds before launch``` 126 | 127 | ``` 128 | ------ 129 | 130 | ### Original README Taken from [Jackjack's original repo](https://github.com/jackjack-jj/pywallet) 131 | 132 | ``` 133 | Requirements: Python 2.x, with bsddb and twisted packages 134 | 135 | Dependencies: 136 | 137 | Debian-based Linux: 138 | aptitude install build-essential python-dev python-twisted python-bsddb3 139 | 140 | Mac OS X: 141 | 1. Install MacPorts from http://www.macports.org/ 142 | 2. sudo port install python27 py27-twisted py27-pip py-bsddb python_select 143 | 3. sudo port select --set python python27 144 | 4. sudo easy_install ecdsa 145 | 146 | Windows: 147 | 1. Install Python 2.7 148 | 2. Install Twisted 11.0.0 for Py2.7, then Zope.Interface (a .egg file) for Py2.7: http://twistedmatrix.com/trac/wiki/Downloads 149 | 150 | 3. Untested, proposed by TeaRex: install Zope.Interface from http://www.lfd.uci.edu/~gohlke/pythonlibs 151 | 152 | If this doesn't work, you will have to install the egg file: 153 | 154 | 3(32bit). http://pypi.python.org/pypi/setuptools#downloads to install setuptools 155 | 3(64bit). http://pypi.python.org/pypi/setuptools#windows to download, then run ez_setup.py 156 | 157 | 4. Go to C:\Python27\Scripts 158 | 5. Run easy_install.exe zope.interface-3.6.4-py2.7-win-amd64.egg 159 | ``` 160 | ------- 161 | 162 | --------------------------------------------------------------------------------