skillfed

bittensor-drand

Rust-backed Python library for generating timelock-encrypted weight commitments for Bittensor's commit-reveal mechanism using drand randomness.

bittensor-drand v2.0.0 281.5K downloads/30d#8,095 on PyPI6
Permissive license Abandoned released

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-drand

uv

uv add bittensor-drand

poetry

poetry add bittensor-drand

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: Build ToolsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

timelock encryption drandbittensor commit reveal weightsencrypted commitments blockchainpost-quantum ml-kem encryptionbittensor weight encryptiondrand randomness pythonsubstrate commit reveal
bittensor-ecosystempost-quantum-crypto

More Software Development packages