bitcoinaustria/pywallet-agent
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Requirements:
- Python 3 (3.9+ recommended). Python 2 still works but is unsupported.
pywallet is a single self-contained script and runs fully offline.
Key inspection and BIP32/BIP39 derivation need no external packages at all.
Optional extras (see Dependencies below):
- reading/writing a real wallet.dat: a Berkeley DB binding
- recovering keys: scanning runs with no deps, but writing the recovered
wallet.dat needs a Berkeley DB binding (--recover creates a new wallet)
- signing/verifying messages: the 'ecdsa' package
Install (offline & verifiable):
The only file you need is pywallet.py. Tagged releases also ship a
SHA256SUMS file. To verify a download:
sha256sum -c SHA256SUMS # macOS: shasum -a 256 -c SHA256SUMS
The checksum is reproducible from source at the matching tag:
git checkout vX.Y.Z && sha256sum pywallet.py
Usage: pywallet.py [options]
(run `python3 pywallet.py --help` for the complete, up-to-date option list)
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--dumpwallet dump wallet in json format
--importprivkey=KEY import private key from vanitygen
--importhex KEY is in hexadecimal format
--datadir=DATADIR wallet directory (defaults to bitcoin default)
--wallet=WALLETFILE wallet filename (defaults to wallet.dat)
--label=LABEL label shown in the adress book (defaults to '')
--testnet use testnet subdirectory and address type
--namecoin use namecoin address type
--otherversion=OTHERVERSION
use other network address type, whose version is
OTHERVERSION
--info display pubkey, privkey (both depending on the
network) and hexkey
--reserve import as a reserve key, i.e. it won't show in the
adress book
--balance=KEY_BALANCE
prints balance of KEY_BALANCE
--web run pywallet web interface
--port=PORT port of web interface (defaults to 8989)
No-install quick start (fully offline, no dependencies):
python3 pywallet.py --tests # run self-tests
python3 pywallet.py --info --importprivkey 1 # inspect a key
Dependencies:
All optional. The core above needs none. Use a virtualenv so you don't hit
the "externally-managed-environment" (PEP 668) error on Homebrew/Debian:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt # or install just what you need below
Berkeley DB binding (only to read/write a real wallet.dat):
pip install berkeleydb # maintained successor of bsddb3
(the code tries bsddb, then bsddb3, then berkeleydb)
ecdsa (only to sign/verify messages):
pip install ecdsa
The berkeleydb binding needs the Berkeley DB system library:
Debian-based Linux:
sudo apt install python3 python3-venv libdb-dev
Mac OS X (Homebrew, no MacPorts needed):
brew install berkeley-db
# then point the build at it, e.g.:
BERKELEYDB_DIR=$(brew --prefix berkeley-db) pip install berkeleydb
Windows:
Just install Python 3.
License:
MIT. See the LICENSE file.