--- id: bittensor-drand version: "2.0.0" license: unclear license_treatment: permissive maintenance: abandoned --- # bittensor-drand — Rust-backed Python library for generating timelock-encrypted weight commitments for Bittensor's commit-reveal mechanism using drand randomness. License: permissive · Maintenance: abandoned · Downloads: 281.5K/mo ## 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 above — 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 pip install bittensor-drand uv add bittensor-drand 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_current - Install friction: medium - Maintenance: abandoned - Downloads: 281.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags timelock encryption drand, bittensor commit reveal weights, encrypted commitments blockchain, post-quantum ml-kem encryption, bittensor weight encryption, drand randomness python, substrate commit reveal, bittensor-ecosystem, post-quantum-crypto [View on SkillFed](https://skillfed.io/packages/bittensor-drand) · [View on PyPI](https://pypi.org/project/bittensor-drand/)