Table of Contents
Pywallet is a command-line python tool that Joric made to deal with the Bitcoin wallets and keys.
This article is about jackjack's fork. (Github link).
Just like all the tools that modify your wallet, it may (unlikely because it is heavily tested before being released) corrupt your wallet, so you must be sure that you have a copy of your wallet in a vault to avoid any wallet loss.
Also, you have to close Bitcoin before using Pywallet.
Features
Non-wallet features
Hide Menus
Just click on a feature to hide its menu, it should become red when you hover it.
Auto-update
In the top-right corner there is the auto-update field.
It allows updating just by clicking on a button. Then run Pywallet again, it will be the version that is currently on github.
Passphrases
Because of the way passphrases are supported, Pywallet stores the last passphrase you sent in the “Change passphrase” form.
Dump your wallet: see your pubkeys, privkeys, their labels, etc
- Under “Dump your wallet:”
- Fill version with 0 for bitcoin, 52 for namecoin, 111 for testnets
Dump your transactions to a json file
- Under “Dump your transactions to a file:”
- Fill Output file with the full path to the file where you want the transactions to be written, this file must not exist
Dump all your private keys to csv file (csv)
- Under “Dump your keys:”
- Fill the location of your wallet
- Fill version with 0 for bitcoin, 52 for namecoin, 111 for testnets
- Write the name of the file you want your keys to be written in
- Lastly, in “Data to print”, you have to put what data you want in your file. Those data are what “dump wallets” returns.
For example, in an encrypted wallet with a wrong passphrase you will have those fields:
"addr": "1Lkx4Br2d82472dRAAqkg6pZrKbs7zcxRE", "compressed": true, "encrypted_privkey": "17ba968f61a121123456789054d1e6c4610458574cd23bc4ceaf6c94b12345678904420e75674f388b3e6f324ef9b049", "pubkey": "0204a238000987654321dfe830f294274cc3c4f31b5f3db7e7005b31fd09437b51", "reserve": 1If you want to have a csv file with addr, encrypted_privkey and reserve (which is 1 if it's a pool key), you have to put “addr,encrypted_privkey,reserve”
Import priv keys from file (csv)
- Under “Import keys:”
- Fill the location of your wallet
- Write the path of the CSV file. Note that it doesn't read the column titles, the file must be in the “privkey;label” format.
Merge two wallets
- Fill all the locations
- Fill all the passphrases, and leave blank if none
Import a key/address into your wallet, with a label, or as a reserve key
- Under “Import a key into your wallet:”
- Key is the private key to import, in base58 or in hexadecimal chars
- Label is the name you want to see in the Address Book of the client
- Check Reserve if you want your address NOT to show in the Address Book
- Version = 0 for bitcoin, 52 for namecoin, 111 for testnets
- Format of the private key: Hexadecimal if you see only digits, a, b, c, d, e and f, otherwise chose Regular
Import a transaction into your wallet
- Under “Import a transaction into your wallet:”
- Txk is the tx_k value you see in the wallet dump
- Txv is the tx_v value you see in the wallet dump
Import transactions from a json file
- Under “Import a transaction into your wallet:”
- Txk = “file” (without quotes)
- Txv = full path to the transactions dump file
Delete addresses from your wallet
- Under “Delete a key from your wallet:”
- Key is a Bitcoin address, not a priv key
- Type: Bitcoin Address
Delete transactions from your wallet
- Under “Delete a key from your wallet:”
- Key is the hash of the transaction you want to delete (type “all” to delete them all)
- Type: Transaction
Get info about a privkey, i.e. see address, base58 privkey, hexprivkey, pubkey and hash160, using the network you want
- Under “Get some info about one key[and sign/verify messages]:”
- Key is a private key
- Leave Msg, Sig and Pubkey empty
- Version = 0 for bitcoin, 52 for namecoin, 111 for testnets
- Format of the private key: Hexadecimal if you see only digits, a, b, c, d, e and f, otherwise chose Regular
Sign and verify string, files, and binary string
- Under “Get some info about one key and sign/verify messages:”
If you want to sign/verify:
- Key is the private key you want to sign the message/file with (only for signing)
- Message is the message you want to sign/verify:
- If it is a string, just type it
- If it is a binary string, type “Hex:” just before its hexadecimal representation
- If it is a file, type “File:” just before its full path
Signature is the signature of your message (only for verifying)
- Pubkey is the pubkey used to sign the message (only for verifying)
Read a device to find deleted keys (CLI only)
- Assuming that:
- The device you want to read is /dev/sda3
- The size of /dev/sda3 is 30.1Gio
- You want pywallet to write the new wallet containing the found keys in /home/jackjack/recovered_wallets
- Run “sudo ./pywallet.py –recover –recov_device /dev/sda3 –recov_size 30.1Gio –recov_outputdir /home/jackjack/recovered_wallets”
- Then replace your wallet (back it up before) with the recovered wallet and run “bitcoin -rescan”
Print the balance of a bitcoin address, read from blockexplorer
- Just put the address and hit the button
Installation
Linux/OSX
See README file
Windows
- Download https://github.com/downloads/jackjack-jj/pywallet/PWI_0.0.3.exe (SHA256: 645a4d092733ad6685de730a38b210c6594e44a15690a87a231859477deca316)
- Run it
- Click about a thousand times on Yes/Next/I Agree/OK
- Go to the directory where you extracted it and run pywallet.bat
- Browse http://localhost:8989
How to run it
- Download it there: https://github.com/jackjack-jj/pywallet
- Run './pywallet.py –web' then open 'http://localhost:8989' in your brower
Requirements
- bsddb package: necessary to open wallets
- twisted package: necessary if you want to use the web interface
- ecdsa package: necessary if you want to sign and verify messages
Confirmed to work on
- Ubuntu 32bit(jackjack)
- Windows 32bit(jackjack), 64bit(ctoon6)
- OSX(defxor)
- iPhone 4, iOS 5 (jackjack)
Pywallet can be used to
- Import Vanitygen keys