Skip to main content

bip39lib

Pure Python BIP39 mnemonic code library for generating deterministic wallet seeds.

PyPI Python

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 entropy
  • mnemonic_to_seed(mnemonic: str, passphrase: str = "") -> bytes - Convert mnemonic to seed
  • validate_mnemonic(mnemonic: str, wordlist: list[str] | None = None) -> bool - Validate mnemonic checksum
  • entropy_to_mnemonic(entropy: bytes, wordlist: list[str] | None = None) -> str - Convert entropy to mnemonic
  • mnemonic_to_entropy(mnemonic: str, wordlist: list[str] | None = None) -> bytes - Convert mnemonic to entropy
  • get_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)

Source distribution for bip39lib 0.1.0
File Size Uploaded
bip39lib-0.1.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bip39lib 0.1.0
File Interpreter ABI Platform
bip39lib-0.1.0-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page