Metadata-Version: 2.4
Name: btclib-wallet
Version: 2026.11.11
Summary: Bitcoin wallet functionality built on btclib
Keywords: bitcoin,wallet,bip32,bip39,slip39,electrum,psbt,output-descriptors,miniscript,hardware-wallet,message-signing,silent-payments,coin-selection,bip44,bip85,bip21,bolt11,mnemonic
Author: The btclib developers
Author-email: The btclib developers <devs@btclib.org>
License-Expression: MIT
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: btclib>=2026.11.10
Requires-Dist: ecc>=2026.11.8
Requires-Dist: bip39-slip39>=2026.11.2
Requires-Dist: base58-bech32>=2026.10.23
Requires-Dist: bitcoin-core-rpc>=2026.9.3
Requires-Dist: typing-extensions>=4.10
Requires-Dist: btclib[secp256k1]>=2026.11.10 ; extra == 'secp256k1'
Requires-Dist: btclib-secp256k1>=0.8.0.13 ; extra == 'secp256k1'
Requires-Python: >=3.11
Project-URL: homepage, https://btclib.org/btclib-wallet/
Project-URL: documentation, https://btclib-wallet.readthedocs.io/
Project-URL: download, https://github.com/btclib-org/btclib-wallet/releases
Project-URL: changelog, https://github.com/btclib-org/btclib-wallet/blob/main/RELEASE_NOTES.md
Project-URL: repository, https://github.com/btclib-org/btclib-wallet
Project-URL: issues, https://github.com/btclib-org/btclib-wallet/issues
Project-URL: pull_requests, https://github.com/btclib-org/btclib-wallet/pulls
Provides-Extra: secp256k1
Description-Content-Type: text/markdown

# btclib-wallet

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

<!-- Section 2 of the organization's standard says which badges sit here. -->
[![PyPI version](https://img.shields.io/pypi/v/btclib-wallet.svg?logo=pypi)](https://pypi.org/project/btclib-wallet/)
[![GitHub release](https://img.shields.io/github/v/release/btclib-org/btclib-wallet.svg)](https://github.com/btclib-org/btclib-wallet/releases)
[![development status](https://img.shields.io/pypi/status/btclib-wallet.svg)](https://pypi.org/project/btclib-wallet/)
[![license](https://img.shields.io/github/license/btclib-org/btclib-wallet.svg)](https://github.com/btclib-org/btclib-wallet/blob/main/LICENSE)
[![downloads](https://static.pepy.tech/badge/btclib-wallet)](https://pepy.tech/projects/btclib-wallet)
[![supported Python versions](https://img.shields.io/pypi/pyversions/btclib-wallet.svg?logo=python)](https://pypi.org/project/btclib-wallet/)
[![implementation](https://img.shields.io/pypi/implementation/btclib-wallet.svg)](https://pypi.org/project/btclib-wallet/)
[![wheel](https://img.shields.io/pypi/wheel/btclib-wallet.svg)](https://pypi.org/project/btclib-wallet/)

[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14813/badge)](https://www.bestpractices.dev/projects/14813)
[![OpenSSF Baseline](https://www.bestpractices.dev/projects/14813/baseline)](https://www.bestpractices.dev/projects/14813)

[btclib](https://github.com/btclib-org/btclib) is the protocol: the
encodings other than Base58Check and bech32, 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](https://github.com/btclib-org/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

```shell
python -m pip install --upgrade btclib-wallet
```

Signing and verifying run where ecc runs them, so its
[libsecp256k1 bindings](https://github.com/btclib-org/btclib-secp256k1)
are the recommended install beside it, and ecc's
[SECURITY.md](https://github.com/btclib-org/ecc/blob/main/SECURITY.md)
says what happens without them.

## An address from a mnemonic

```python
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](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)
  hierarchical deterministic key chains, and
  [SLIP132](https://github.com/satoshilabs/slips/blob/master/slip-0132.md)
  key versions with their mapping to address types
- [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki),
  [Electrum](https://electrum.org/#home) and
  [SLIP39](https://github.com/satoshilabs/slips/blob/master/slip-0039.md)
  master keys from a mnemonic, whose scheme up to the seed is
  [bip39-slip39](https://github.com/btclib-org/bip39-slip39)'
- [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)
  addresses from an extended key and a
  `m/purpose'/coin_type'/account'/change/address_index` path
- [BIP85](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki)
  deterministic entropy, one root key behind many wallets
- [BIP38](https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki)
  password-protected private keys, and Casascius minikeys
- [BIP380](https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki)
  output descriptors and
  [BIP379](https://github.com/bitcoin/bips/blob/master/bip-0379.md)
  miniscript
- [BIP174](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki)
  and [BIP370](https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki)
  partially signed transactions, with the taproot, MuSig2, FROST and
  silent payment fields
- [BIP352](https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki)
  silent payments
- [BIP322](https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki)
  signed messages
- [BIP21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki)
  payment URIs, and the BOLT11 invoices and BOLT9 feature bits they carry
- [dlcspecs](https://github.com/discreetlogcontracts/dlcspecs)
  discreet log contracts: the funding, execution and refund transactions,
  the CETs' adaptor signatures, and an oracle's announcements and
  attestations
- 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](https://github.com/bitcoin-core/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, or a peer's BIP157 compact
  filters over p2p

## Architecture

[ARCHITECTURE.md](https://github.com/btclib-org/btclib-wallet/blob/main/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](https://github.com/btclib-org/btclib-wallet/blob/main/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](https://github.com/btclib-org/btclib-wallet/blob/main/SECURITY.md)
says what that promises, where constant time ends, and how to report a
vulnerability.

## Contributing

Development is LLM-based: humans are welcome, as long as they are
comfortable with agentic development ;-). A contribution must have been
read and understood by the person who submits it.
[`CONTRIBUTING.md`](https://github.com/btclib-org/btclib-wallet/blob/main/CONTRIBUTING.md#working-with-an-llm)
has the rules.

[CONTRIBUTING.md](https://github.com/btclib-org/btclib-wallet/blob/main/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](https://github.com/btclib-org/btclib-wallet/blob/main/REVIEWING.md)
is what a pull request is answered against.

How the organization decides, and who holds which role, is its
[GOVERNANCE.md](https://github.com/btclib-org/.github/blob/main/GOVERNANCE.md);
what it intends to do, and what it deliberately does not, is its
[ROADMAP.md](https://github.com/btclib-org/.github/blob/main/ROADMAP.md).

## Links

- Documentation: <https://btclib-wallet.readthedocs.io/>
- Source: <https://github.com/btclib-org/btclib-wallet>
- Releases: <https://github.com/btclib-org/btclib-wallet/releases>
- [CHANGELOG.md](https://github.com/btclib-org/btclib-wallet/blob/main/CHANGELOG.md),
  and [RELEASE_NOTES.md](https://github.com/btclib-org/btclib-wallet/blob/main/RELEASE_NOTES.md)
  for what a release asks a user to act on

## Status

<!-- Section 2 of the organization's standard says which badges sit here. -->
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/btclib-org/btclib-wallet/main.svg)](https://results.pre-commit.ci/latest/github/btclib-org/btclib-wallet/main)
[![lint workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/lint.yml?query=branch%3Amain)
[![test workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/test.yml?query=branch%3Amain)
[![docs workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/docs.yml?query=branch%3Amain)
[![documentation build](https://app.readthedocs.org/projects/btclib-wallet/badge/?version=latest)](https://btclib-wallet.readthedocs.io)
[![vendored-vectors workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/vendored-vectors.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/vendored-vectors.yml?query=branch%3Amain)
[![mutation workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/mutation.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/mutation.yml?query=branch%3Amain)
[![qa-assets workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/qa-assets.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/qa-assets.yml?query=branch%3Amain)
[![fuzz workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/fuzz.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/fuzz.yml?query=branch%3Amain)
[![integration-bitcoind workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-bitcoind.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-bitcoind.yml?query=branch%3Amain)
[![integration-hwi workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-hwi.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-hwi.yml?query=branch%3Amain)
[![integration-electrs workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-electrs.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-electrs.yml?query=branch%3Amain)
[![integration-floresta workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-floresta.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/integration-floresta.yml?query=branch%3Amain)
[![deps-latest workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/deps-latest.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/deps-latest.yml?query=branch%3Amain)
[![pypi-install workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/pypi-install.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/pypi-install.yml?query=branch%3Amain)
[![deps-oldest workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/deps-oldest.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/deps-oldest.yml?query=branch%3Amain)
[![os-macos workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-macos.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-macos.yml?query=branch%3Amain)
[![os-ubuntu workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-ubuntu.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-ubuntu.yml?query=branch%3Amain)
[![os-windows workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-windows.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/os-windows.yml?query=branch%3Amain)
[![links workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/links.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/links.yml?query=branch%3Amain)
[![sdist-rebuild workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/sdist-rebuild.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/sdist-rebuild.yml?query=branch%3Amain)
[![codeql workflow status](https://github.com/btclib-org/btclib-wallet/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/btclib-org/btclib-wallet/actions/workflows/codeql.yml?query=branch%3Amain)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/btclib-org/btclib-wallet/badge)](https://scorecard.dev/viewer/?uri=github.com/btclib-org/btclib-wallet)

---

The btclib organization and its projects are actively supported by
[DGI](https://dgi.io) and [CheckSig](https://checksig.com).
