bip39lib
Pure Python BIP39 mnemonic code library for generating deterministic wallet seeds.
Install
pip install bip39lib
Usage
from bip39lib import generate_mnemonic, mnemonic_to_seed, validate_mnemonic
# Generate a 12-word mnemonic (128 bits of entropy)
mnemonic = generate_mnemonic()
print(mnemonic) # abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
# Validate the mnemonic
is_valid = validate_mnemonic(mnemonic)
print(is_valid) # True
# Convert mnemonic to seed (for HD wallet derivation)
seed = mnemonic_to_seed(mnemonic, passphrase="")
print(seed.hex()) # 64-byte seed
API
generate_mnemonic(entropy_bits: int = 128, wordlist: list[str] | None = None) -> str- Generate mnemonic from entropymnemonic_to_seed(mnemonic: str, passphrase: str = "") -> bytes- Convert mnemonic to seedvalidate_mnemonic(mnemonic: str, wordlist: list[str] | None = None) -> bool- Validate mnemonic checksumentropy_to_mnemonic(entropy: bytes, wordlist: list[str] | None = None) -> str- Convert entropy to mnemonicmnemonic_to_entropy(mnemonic: str, wordlist: list[str] | None = None) -> bytes- Convert mnemonic to entropyget_wordlist(lang: str = "en") -> list[str]- Get BIP39 wordlist by language
Development
git clone https://github.com/daedalus/bip39lib.git
cd bip39lib
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
Metadata
Release files for bip39lib 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bip39lib-0.1.0.tar.gz | 4.1 kB | With provenance | Details for bip39lib-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bip39lib-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for bip39lib-0.1.0-py3-none-any.whl |
Total release size: 8.7 kB
Release files / bip39lib-0.1.0.tar.gz
| Download URL | bip39lib-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47352ad962f42fd7587bc357fe1a98989748dd0e88652c74e3e78c8c5ace0eaf
|
|
BLAKE2b-256 checksum How to use checksums |
56d3c7baf0152ab921c0be644498456099b0eb14bc4e612a768435b46d1c13aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logRelease files / bip39lib-0.1.0-py3-none-any.whl
| Download URL | bip39lib-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c002cea3f6d452637b29ce76ff5145a1860304f5bee8569456cf4e48c10fd25
|
|
BLAKE2b-256 checksum How to use checksums |
10d1851c78480c3cf9cbb490fb184f0878b5d3fc33b9045400e024497b9d8bea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logSecurity for bip39lib 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bip39lib-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.