libcrypto Documentation¶
libcrypto is a lightweight, dependency-free Python library for
deterministic cryptocurrency key and address generation, signing, and
validation. Every cryptographic primitive it needs — secp256k1, Keccak-256,
RIPEMD-160, HMAC/PBKDF2, Base58, Bech32/Bech32m, CashAddr — is implemented
either in pure Python inside the package or through the Python standard library.
There are no third-party runtime dependencies.
- Requires Python 3.8 or newer.
- MIT licensed.
- Installable from PyPI:
pip install libcrypto.
Documentation map¶
| Section | Description |
|---|---|
| Installation | Install from PyPI or source. |
| Quickstart | Generate wallets and addresses in minutes. |
| Supported Coins & Networks | All 43 networks, address types, and version bytes. |
| Command Line Interface | Use the bundled libcrypto command. |
| Security Model | What the library guarantees and what it does not. |
| Releasing & Packaging | Automated GitLab CI/CD publishing to PyPI. |
Guides¶
| Guide | Description |
|---|---|
| HD Wallets & Mnemonics | BIP39 mnemonics and BIP32 xprv/xpub derivation. |
| Signing & Verification | ECDSA and Ethereum/Bitcoin message signing. |
| Address Validation | Verify and decode addresses safely. |
API reference¶
| Module | Description |
|---|---|
wallet |
High-level Wallet facade. |
keys |
PrivateKey and PublicKey. |
addresses |
Multi-chain address generation. |
bip32 |
HD wallet, xprv/xpub, CKDpriv/CKDpub. |
mnemonic |
BIP39 mnemonic utilities. |
formats |
Base58, Base58Check, WIF, hex conversions. |
hash |
SHA-256/512, RIPEMD-160, Keccak-256, HMAC, PBKDF2. |
secp256k1 |
Elliptic-curve public key derivation. |
signing |
Deterministic ECDSA (RFC 6979). |
messages |
Ethereum (EIP-191) and Bitcoin message signing. |
validation |
Address validation and decoding. |
Correctness¶
Every feature is validated against published standard test vectors:
- secp256k1 generator multiples and known public keys.
- BIP32 test vector 1 (xprv, xpub, and CKDpub equivalence).
- BIP39 mnemonic-to-seed (Trezor
TREZORpassphrase vector). - RFC 6979 deterministic ECDSA (secp256k1 / SHA-256).
- EIP-55 checksummed Ethereum addresses and EIP-191 message hashes.
- Bitcoin Base58Check, Bech32, Bech32m, and CashAddr encodings.
Run the suite with:
Building this documentation¶
The documentation is written in Markdown and rendered with MkDocs (Material theme). It is hosted on Read the Docs.
Build it locally:
pip install -r docs/requirements.txt
mkdocs serve # live preview at http://127.0.0.1:8000
mkdocs build # static site in ./site
Configuration lives in mkdocs.yml (site and navigation) and
.readthedocs.yaml (the Read the Docs build). These documentation tools run
only in the build environment — the libcrypto library itself remains
dependency-free at runtime.