# petertodd/python-bitcoinlib

Python3 library providing an easy interface to the Bitcoin data structures and protocol.

Repository: https://github.com/petertodd/python-bitcoinlib
Canonical: https://ross.abutalabs.com/products/python-bitcoinlib
Language: Python
License: NOASSERTION
License Family: other
Last push: 2025-03-14T19:54:17+00:00

## Health v2 (maintenance only)
Score: 28/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 11, release rhythm 8, longevity 100
- inputs: {"age_days": 4920, "days_push": 537, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1948, forks 646 (observed 2026-08-28T04:05:57.983324+00:00)

## What it is
A Python 3 library providing a low-level, ground-up interface to Bitcoin data structures and protocol internals, including transactions, scripts, serialization, and Bitcoin Core RPC support. It closely mirrors the Satoshi C++ codebase naming and separates consensus-critical code under bitcoin.core.

## Use cases
- construct and sign raw bitcoin transactions in python
- parse and serialize bitcoin blocks and transactions
- talk to a bitcoin core node over rpc
- verify bitcoin scripts and evaluate opcodes
- encode and decode base58 addresses and private keys
- build p2sh spending transactions programmatically

## When to choose
- you need low-level manipulation of bitcoin protocol internals rather than a wallet
- you want consensus-critical data structures that mirror bitcoin core behavior
- you're writing scripts or tooling that interacts with a bitcoin core node

## When to avoid
- you want a high-level wallet or payment processing library
- you need a full node or network peer implementation
- you're building for other cryptocurrencies with different consensus rules

## Facets
- artifact type: library
- maturity: active
- function: serialization, cryptography, rpc, parser
- domain: blockchain, developer-tools, apis
- platform: python, windows, cross-platform
- tags: bitcoin, bitcoin-core-rpc, transactions, script-verification, low-level-protocol, cryptocurrency, linux, macos

## Member repositories
- petertodd/python-bitcoinlib (main) score 28

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:57.983324+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:07:00.331767+00:00, confidence not recorded.
  - readme: https://github.com/petertodd/python-bitcoinlib (fetched 2026-08-28T04:05:57.983324+00:00, sha c3ad11d5712e)
  - registry_pypi: https://pypi.org/pypi/python-bitcoinlib/json (fetched 2026-08-29T10:46:44.632987+00:00, sha 2c8398ae633d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
