Skip to main content

btclib-wallet

From a seed to a signed, broadcast bitcoin transaction, on top of the btclib library.

PyPI version GitHub release development status license downloads supported Python versions implementation wheel

pre-commit.ci status lint workflow status test workflow status docs workflow status documentation build vendored-vectors workflow status mutation workflow status fuzz workflow status integration-bitcoind workflow status integration-hwi workflow status deps-latest workflow status pypi-install workflow status deps-oldest workflow status os-macos workflow status os-ubuntu workflow status os-windows workflow status links workflow status sdist-rebuild workflow status codeql workflow status

OpenSSF Scorecard OpenSSF Best Practices OpenSSF Baseline

btclib is the protocol: the encodings, the scripts, the transactions and the signature schemes, what a node consumes. This package is what a wallet does with them, and every module with a counterparty outside the process — a device, a node, a server, a file from another wallet. It depends on btclib and on bitcoin-core-rpc, and re-exports nothing of btclib's: a name btclib defines is imported from btclib.

It is fully annotated and ships py.typed, and the test suite answers to vectors their authors publish: the BIPs' and the SLIPs' own, HWI's, and trezor's for BIP39 and SLIP39. tests/_data/README.md pins each vendored file to the upstream commit it was copied from, and says whether the two still match.

Installing

python -m pip install --upgrade btclib-wallet

Signing and verifying run where btclib-ecc runs them, so its libsecp256k1 bindings are the recommended install beside it, and btclib-ecc's SECURITY.md says what happens without them.

An address from a mnemonic

from btclib_wallet import bip44
from btclib_wallet.mnemonic import bip39

words = "abandon " * 11 + "about"
xprv = bip39.mxprv_from_mnemonic(words)
assert (
    bip44.address_from_der_path(xprv, "m/84h/0h/0h/0/0")
    == "bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu"
)

The address is the first one BIP84 lists for that mnemonic.

What is here

  • BIP32 hierarchical deterministic key chains, and SLIP132 key versions with their mapping to address types
  • BIP39, Electrum and SLIP39 master keys from a mnemonic, whose scheme up to the seed is btclib-mnemonics'
  • BIP44 addresses from an extended key and a m/purpose'/coin_type'/account'/change/address_index path
  • BIP85 deterministic entropy, one root key behind many wallets
  • BIP38 password-protected private keys, and Casascius minikeys
  • BIP380 output descriptors and BIP379 miniscript
  • BIP174 and BIP370 partially signed transactions, with the taproot, MuSig2, FROST and silent payment fields
  • BIP352 silent payments
  • BIP322 signed messages
  • BIP21 payment URIs, and the BOLT11 invoices and BOLT9 feature bits they carry
  • coin selection and a transaction builder
  • wallets: an extended key at a BIP44 account, a set of individual keys, an output descriptor per chain, a script template
  • an external signer behind one contract, with Bitcoin Core's HWI behind it for a hardware wallet, and the requests that import a wallet into Bitcoin Core
  • a chain backend behind one interface, over a full node's JSON-RPC or a block explorer's or an Electrum server's API

Architecture

ARCHITECTURE.md is the design: which module holds what, the dependencies and why each, and every place a module crosses out of the process it runs in. ASSURANCE_CASE.md is why the security section below holds.

Security

A mnemonic, an extended private key and a PSBT being signed are secrets, and where they are handled is this package. SECURITY.md says what that promises, where constant time ends, and how to report a vulnerability.

Contributing

CONTRIBUTING.md has the commands each CI job runs, verbatim. uv sync creates the environment; uv is the only tool that has to be installed. REVIEWING.md is what a pull request is answered against.

How the organization decides, and who holds which role, is its GOVERNANCE.md; what it intends to do, and what it deliberately does not, is its ROADMAP.md.


The btclib organization and its projects are actively supported by DGI and CheckSig.

Metadata

Release files for btclib-wallet 2026.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for btclib-wallet 2026.10.4
File Size Uploaded
btclib_wallet-2026.10.4.tar.gz 2.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for btclib-wallet 2026.10.4
File Interpreter ABI Platform
btclib_wallet-2026.10.4-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / btclib_wallet-2026.10.4.tar.gz

Download URL btclib_wallet-2026.10.4.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
810f67476aa21a9efcd00f54d5f30a075b71e38659cf6c46a482427a5420752c
BLAKE2b-256 checksum
How to use checksums
35cadd2f70549e823e150738669466d6a46bb9112a70169a0eb9ac9c6ba8a1d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / btclib_wallet-2026.10.4-py3-none-any.whl

Download URL btclib_wallet-2026.10.4-py3-none-any.whl
Size 454.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e78bdb17ec360f328652853939dab1d97000aa71e5c2e6f4f36ed9de8c8d42c4
BLAKE2b-256 checksum
How to use checksums
ce9e355e5c04783c30b4e7d829d472ff3dac32d6312f532255c3f1b61af07326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.10.4 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