bittensor-drand
Rust-backed Python library for generating timelock-encrypted weight commitments for Bittensor's commit-reveal mechanism using drand randomness.
What it is and what it does
bittensor-drand is a Rust-backed Python library that encrypts weight commitments for Bittensor's commit-reveal mechanism using drand (distributed randomness) as a timelock. Version 2.0 replaces the prior modulo-based epoch math with a stateful epoch counter model, requiring epoch schedule state from the chain rather than manual tempo and block calculations. The library also provides general-purpose timelock encryption for arbitrary binary data and post-quantum ML-KEM-768 key encapsulation.
The package is designed for two use patterns: high-level integration via the Bittensor SDK (which handles epoch plumbing internally), or direct lower-level calls for custom clients and tooling. It includes functions to encrypt data for a specified number of blocks into the future, encrypt for a specific drand round, and decrypt with either auto-fetched or pre-supplied drand signatures. The Rust core ensures performance-critical encryption and decryption operations run efficiently.
Use it for:
- Encrypt validator weights in Bittensor subnets using commit-reveal to prevent gaming before the reveal epoch.
- Build custom miners or tooling that need direct control over weight commitment encryption without SDK overhead.
- Timelock-encrypt arbitrary secrets to be revealed after a specified number of blockchain blocks.
- Implement post-quantum key encapsulation for NextKey rotation using ML-KEM-768.
- Batch-decrypt multiple ciphertexts for the same drand round by fetching the signature once.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides timelock encryption for Bittensor commit-reveal weight commitments and general-purpose data using drand randomness, with Rust core and Python bindings.
Yes, with caution. The library is feature-complete and carries no known vulnerabilities, with permissive MIT licensing and broad Python version support (3.10–3.14). However, the repository is archived and marked abandoned, meaning no active maintenance or bug fixes should be expected. Install only if you are committed to maintaining a local fork or can tolerate lack of upstream support. For active Bittensor development, prefer using the high-level SDK integration rather than direct library calls.
Install
bittensor-drand on PyPI
pip
pip install bittensor-dranduv
uv add bittensor-drandpoetry
poetry add bittensor-drandInstalling bittensor-drand
Before you install
Medium install friction: compiled wheels provided for Python 3.10–3.14 across macOS and Linux architectures. Repository is archived and marked abandoned as of the latest commit, signaling no active maintenance despite recent release activity.
License in practice
Licensed under MIT (permissive), imposing no restrictions on commercial or proprietary use.
Quickstart
pip install bittensor-drand
from bittensor_drand import get_encrypted_commit_v2
commit_bytes, reveal_round = get_encrypted_commit_v2(
uids=[1, 3],
weights=[100, 200],
version_key=843000,
last_epoch_block=schedule.last_epoch_block,
pending_epoch_at=schedule.pending_epoch_at,
subnet_epoch_index=schedule.subnet_epoch_index,
tempo=schedule.tempo,
blocks_since_last_step=schedule.blocks_since_last_step,
current_block=current_block,
subnet_reveal_period_epochs=reveal_period,
block_time=12.0,
hotkey=wallet.hotkey.public_key,
)
Requires bittensor>=11.0.0 to fetch epoch schedule state; version 2.0.0 is a breaking change from prior API.
Verify before relying
- Whether the archived repository status reflects planned sunsetting or temporary maintenance pause.
- Current stability and bug-fix responsiveness given abandoned maintenance status.
- Real-world performance characteristics for large-scale weight commitments.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 57 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 281,482/month — #8,095 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bittensor_drand-2.0.0-cp310-cp310-macosx_10_12_x86_64.whl; bittensor_drand-2.0.0-cp310-cp310-macosx_11_0_arm64.whl; bittensor_drand-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; bittensor_drand-2.0.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; bittensor_drand-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; bittensor_drand-2.0.0-cp311-cp311-macosx_10_12_x86_64.whl; bittensor_drand-2.0.0-cp311-cp311-macosx_11_0_arm64.whl; bittensor_drand-2.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; bittensor_drand-2.0.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; bittensor_drand-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; bittensor_drand-2.0.0-cp312-cp312-macosx_10_12_x86_64.whl; bittensor_drand-2.0.0-cp312-cp312-macosx_11_0_arm64.whl; bittensor_drand-2.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; bittensor_drand-2.0.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl; bittensor_drand-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; bittensor_drand-2.0.0-cp313-cp313-macosx_10_12_x86_64.whl; bittensor_drand-2.0.0-cp313-cp313-macosx_11_0_arm64.whl; bittensor_drand-2.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; bittensor_drand-2.0.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl; bittensor_drand-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Keywords: substrate, scale, codec, bittensor, commit reveal, drand, TLE
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
bittensorBittensor is a Python SDK and CLI for…
permissive · top 15,000 on PyPI
bittensor-walletManages cryptographic keys and wallets for the…
permissive · top 15,000 on PyPI
bittensor-cliCommand-line interface for managing Bittensor…
permissive · top 15,000 on PyPI
pyragepyrage provides Python bindings to the Rust…
permissive · top 15,000 on PyPI
chia-rsProvides Python bindings to Rust crates for…
unclear · top 15,000 on PyPI
py-sr25519-bindingsProvides Python bindings to the sr25519 Rust…
permissive · top 15,000 on PyPI
py-ed25519-zebra-bindingsProvides Python bindings to the ed25519-zebra…
permissive · top 15,000 on PyPI
smoldot-lightPython bindings for the smoldot_light Rust…
unclear · top 15,000 on PyPI
tensealTenSEAL performs homomorphic encryption…
permissive · top 15,000 on PyPI
twofishProvides Python bindings to the Twofish block…
permissive · top 15,000 on PyPI