Bittensor Developer Guides
website·Indexed 34 days ago
https://guides.learnbittensor.orgTechnical documentation for the Bittensor ecosystem, covering the Subtensor API, Bittensor SDK, and btcli. Includes guides on subnet management, incentive mechanisms, staking and delegation, governance, and EVM integration, as well as instructions for running local subtensor instances and managing blockchain storage and runtime interfaces.
What's inside Bittensor
- Yuma Consensus is a distributed judgment mechanism used in Bittensor subnets to distribute rewards. Validators act as judges, ranking the performance of miners. The system uses a trust-weighted model where a validator's influence is proportional to the stake delegated to them by the community. To maintain honesty, the system rewards validators who accurately predict which miners will eventually be recognized as the best by the network. This creates a feedback loop where lazy or dishonest validators lose emissions, prompting the community to move stake to more reliable validators.
Overview of the Crowdloan Precompile
The Crowdloan precompile allows EVM contracts to create and manage crowdloans entirely on-chain. A campaign creator defines a funding cap and deadline; contributors deposit TAO, and upon reaching the cap, the crowdloan can be finalized to execute a transfer to a target address.
Precompile Address:
0x0000000000000000000000000000000000000809Overview of Consensus-Based Weights (Liquid Alpha)
Consensus-based weights, also known as 'liquid alpha', improves the correlation between a subnet validator's dividends and the performance of the subnet miner they are bonded to. It replaces a static alpha value (previously 0.9) in the Exponential Moving Average (EMA) calculation of the bond value with a variable alpha. This helps in the early discovery of promising miners and prevents abrupt bond value changes that typically indicate exploitation.Overview of EVM on Bittensor
The Bittensor blockchain (Subtensor) implements a full Ethereum Virtual Machine (EVM) runtime as an application layer. This allows developers to deploy most EVM smart contracts without modifying the code, interact with them on the Subtensor blockchain, and use standard Ethereum JSON-RPC methods. All EVM operations are executed solely on the Bittensor blockchain, not on the Ethereum network.Overview of the Bittensor Python SDK
The Bittensor Python SDK provides a programmable interface to the Bittensor blockchain, allowing developers to interact with the network, manage wallets, execute blockchain calls, and operate subnets programmatically.Overview of the Bittensor Network Architecture
Bittensor is an open-source platform where participants produce digital commodities (e.g., compute, storage, AI inference/training). The network is organized into independent communities called subnets. Each subnet consists of miners who produce the commodity and validators who evaluate the work. The network distributes liquidity in the form of TAO (τ) and subnet-specific alpha tokens based on the value of contributions.Overview of the Leasing precompile
The Leasing precompile allows EVM contracts to create lease crowdloans, terminate leases, and query lease state. It is located at the address0x000000000000000000000000000000000000080a.Overview of Yuma Consensus 3 (YC3)
Yuma Consensus 3 (YC3) is a drop-in replacement for the Yuma Consensus mechanism in Bittensor. It improves validator fairness, bond mechanics, and precision handling. The most significant change is the introduction of per-bond EMA scaling, where each validator-miner bond pair has its own adjustment rate (alpha value) instead of a single global rate. This allows individual relationships to evolve based on specific performance and consensus differences. YC3 is backward compatible, and most subnet owners do not need to make changes for the upgrade to be seamless.Overview of Bittensor Staking Precompiles
The staking precompile allows Ethereum-compatible smart contracts to interact with the subtensor staking feature, specifically enabling the calling ofadd_stakeandremove_stakemethods to delegate or undelegate stake to a hotkey.Overview of Yuma Consensus (YC)
Yuma Consensus (YC) is an on-chain algorithmic process within Subtensor that computes emissions for validators and miners. It works by resolving a matrix of validator rankings (weights assigned to miners) into two emissions vectors. The algorithm weights inputs from more trusted validators (based on stake) more heavily to filter out unreliable signals and incentivize honest, consistent evaluations of miner performance.Overview of bittensor-wallet core classes
The
bittensor-walletlibrary provides a Python interface to a Rust core for cryptographic operations. It centers around three primary classes:Keypair: The primitive for signing, verifying, and encrypting (contains public and optional private keys).Wallet: Manages persistence of a named wallet on disk, wrapping coldkeys and hotkeys.Keyfile: Handles serialization and at-rest password encryption for a single key file on disk.
Overview of the VotingPower precompile
The VotingPower precompile provides smart contracts with read-only access to the per-validator Exponential Moving Average (EMA) voting power scores tracked on each subnet. This is primarily used for building on-chain governance mechanisms such as slashing conditions, quorum checks, and reward weighting based on validator influence.
Contract Address:
0x000000000000000000000000000000000000080d