skillfed

python-bitcoinlib

The Swiss Army Knife of the Bitcoin protocol.

python-bitcoinlib v0.12.2 420.4K downloads/30d#6,791 on PyPI1,950
Copyleft license AGING released

What it is and what it does

python-bitcoinlib is a low-level Python library for working directly with Bitcoin protocol internals. It provides data structures and tools for manipulating transactions, scripts, keys, serialization, and blockchain parameters, with a design philosophy that mirrors the Bitcoin codebase closely. The library separates consensus-critical code from non-consensus modules like RPC support, wallet utilities, and network communication.

The package is designed for developers who need to build tools that interact with Bitcoin at the protocol level—parsing transactions, validating scripts, constructing custom transactions, or communicating with nodes via RPC. It handles low-level details like endianness conversions and immutable/mutable object distinctions. The library requires libssl-dev and works with v24.0 or later for RPC functionality.

Use it for:

  • Build custom Bitcoin transaction builders or signers that need to manipulate transaction internals
  • Parse and validate Bitcoin scripts or create custom script logic
  • Interact with a node via RPC to query blockchain data or submit transactions
  • Implement Bitcoin address generation, key management, or wallet-related functionality
  • Analyze Bitcoin protocol data structures or implement consensus-critical validation logic

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides low-level Python tools to work with Bitcoin data structures, transactions, scripts, and the Bitcoin protocol, including RPC interface support for Bitcoin Core.

Yes, if you need low-level Bitcoin protocol manipulation in Python. The library has no runtime dependencies, low install friction, and an active if aging maintenance status. The copyleft license is straightforward for open-source use. However, the last release was 2023-06-03 and updates are infrequent—verify compatibility with your Python version and requirements before relying on it for production systems.

Install

python-bitcoinlib on PyPI

pip

pip install python-bitcoinlib

uv

uv add python-bitcoinlib

poetry

poetry add python-bitcoinlib

Installing python-bitcoinlib

Before you install

Low install friction with no runtime dependencies. Maintenance status is aging—last release was 2023-06-03 and last commit 2025-03-14—so updates are infrequent but the repository remains active and not archived.

License in practice

Licensed under LGPLv3+, a copyleft license. Any derivative work or modification must be distributed under compatible terms; linking from proprietary code is permitted if the library remains separate.

Quickstart

pip install python-bitcoinlib

from python_bitcoinlib.core import x, lx, b2x
# Work with Bitcoin data structures and protocol

Requires libssl-dev system library. Bitcoin Core v24.0 or later for RPC interface compatibility.

Verify before relying

  • Whether the package works with modern Python versions given no explicit requires_python constraint
  • Current state of the 'in flux' modules and their production readiness
  • Whether consensus-critical code has been audited for correctness against current Bitcoin Core

Package facts

License not declared (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 1,168 days since the last release
Last repo commit
First released
Downloads 420,420/month — #6,791 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_bitcoinlib-0.12.2-py3-none-any.whl

Keywords: bitcoin

License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Programming Language :: Python

Tags

bitcoin protocol library pythonbitcoin transaction manipulationbitcoin script evaluationbitcoin core rpc interfacebitcoin serialization deserializationbitcoin cryptography keysbitcoin address wallet tools
bitcoin-protocolcryptocurrencycryptography

More Cryptography packages