bittensor
A lean Python SDK (import bittensor) and CLI (btcli) for the Bittensor chain.
What it is and what it does
Bittensor is a thin, unopinionated wrapper around the Bittensor blockchain, exposing chain reads and transaction intents through both a Python library and a command-line tool. The SDK uses typed namespaces for chain queries (balances, subnets, neurons, delegation), supports both blocking and async patterns, and wraps mutations as serializable intents that can be previewed before execution. The CLI (`btcli`) mirrors the SDK surface: every read becomes a `query` command, every intent becomes a `tx` command, with shell completion and persistent configuration for network and wallet settings.
The package is built as a projection of the chain's own runtime metadata, so reads and intents stay synchronized with the chain without manual updates. It includes wallet management (create, regenerate, sign, verify), a Policy system to bound what mutations may do, and unit-tagged Balance types that prevent mixing currencies. The design goal is safety and transparency: nothing is hidden, every chain call is either wrapped by an intent or explicitly marked raw-only, and a CI gate ensures no operations are silently forgotten.
Use it for:
- Query chain state (balances, subnets, neurons, delegation) from Python or the command line without building a full blockchain node.
- Submit staking, unstaking, and transfer transactions with fee preview and policy-based safety checks before execution.
- Build agents or tools that interact with Bittensor by dispatching reads and intents by name rather than direct method calls.
- Manage local wallets (create, regenerate, sign messages) and verify signatures for Bittensor accounts.
- Automate testnet or finney operations via CLI with environment-variable or config-file-based network and wallet defaults.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bittensor is a Python SDK and CLI for interacting with the Bittensor blockchain, providing typed reads of chain state, transaction intents with safety policies, and a command-line interface for wallet and chain operations.
Yes. Bittensor is actively maintained, has low install friction, carries no known vulnerabilities, and is the canonical SDK for the Bittensor chain. Install it if you need to read chain state, submit transactions, or manage wallets on Bittensor; the CLI and library ship together, so you get both for one install.
Install
bittensor on PyPI
pip
pip install bittensoruv
uv add bittensorpoetry
poetry add bittensorInstalling bittensor
Before you install
Low friction: pure Python wheel with seven runtime dependencies (bittensor-core, eth-account, qrcode, rich, typer, typing-extensions, websockets). Actively maintained with a release on 2026-08-14 and 375 repository stars.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install bittensor
import bittensor as bt
sub = bt.Subtensor()
balance = sub.balances.get("5F...coldkey")
subnets = sub.subnets.all()
Requires Python 3.10–3.14; wallet operations require local key files or secure mnemonic input.
Verify before relying
- Whether bittensor-core (the primary runtime dependency) is a compiled extension or pure Python.
- Performance characteristics for high-frequency chain queries or large batch operations.
- Compatibility with non-finney networks beyond test and local endpoints.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — bittensor-core, eth-account, qrcode, rich, typer, typing-extensions, websockets |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 304,950/month — #7,801 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bittensor-11.1.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
bittensor-cliCommand-line interface for managing Bittensor…
permissive · top 15,000 on PyPI
bittensor-drandProvides timelock encryption for Bittensor…
permissive · top 15,000 on PyPI
bittensor-walletManages cryptographic keys and wallets for the…
permissive · top 15,000 on PyPI
aptos-sdkProvides Python bindings to interact with the…
permissive · top 15,000 on PyPI
web3web3.py is a Python library for interacting…
permissive · top 5,000 on PyPI
async-substrate-interfaceProvides asynchronous and synchronous…
permissive · top 15,000 on PyPI
xrpl-pyA pure Python library for building applications…
permissive · top 15,000 on PyPI
cyscaleCython-accelerated encoder and decoder for the…
permissive · top 15,000 on PyPI
py-clob-clientPython client library for trading on…
permissive · top 15,000 on PyPI