Draft:Bittensor

Bittensor (abbreviation: TAO; sign: 𝞃) is an open-source, decentralized protocol that combines blockchain technology with artificial intelligence to create a peer-to-peer machine learning network and blockchain-based digital commodities market.

Bittensor employs a modular architecture with subnets dedicated to specific machine learning domains, where miners register pre-trained AI models to provide services and validators ensure response quality. Consensus is achieved using the Yuma Consensus, a hybrid Proof-of-Stake and Proof-of-Work mechanism that evaluates AI model quality and protects against malicious validator activity.

TAO, the native cryptocurrency of Bittensor, is used for staking, governance, and payments within the ecosystem. It has a capped supply of 21 million tokens, closely resembling Bitcoin's model, and follows a halving cycle every 10.5 million blocks.

Bittensor's decentralized AI marketplace has potential applications across various industries, including natural language processing, computer vision, predictive analytics, and autonomous systems. By democratizing access to AI capabilities and fostering collaboration, Bittensor aims to accelerate innovation and promote more equitable ownership of machine intelligence. However, as an emerging technology, it faces challenges such as regulatory uncertainty, security vulnerabilities, and competition from centralized AI providers.

Background
The first decentralized blockchain was conceptualized by Satoshi Nakamoto in 2008, and has introduced a new approach to trust, security, and decentralization in digital systems. The decentralized nature of blockchain has led to the development of various applications, including decentralized finance and marketplaces.

Centralized marketplaces for digital commodities, however, have been associated with certain limitations, such as high costs, lack of transparency, and the potential for monopolistic practices. Bittensor, a decentralized marketplace for machine intelligence, aims to address these limitations by leveraging blockchain technology.

Bittensor's system is based on a network of computers that continuously and asynchronously share representations peer-to-peer across the internet. The marketplace utilizes a digital ledger to record ranks and provide incentives to peers in a decentralized manner.

The decentralized structure of Bittensor's marketplace is designed to promote competition, innovation, and accessibility, potentially democratizing access to digital resources. The growth of edge computing, IoT, and AI applications has led to discussions about the potential benefits of decentralized commodity marketplaces.

Creation
Bittensor was founded in March 2019 by the Opentensor Foundation, a non-profit organization focused on developing decentralized artificial intelligence technologies. The project's initial whitepaper, titled "BitTensor: An Intermodel Intelligence Measure '', was authored by Jacob Robert Steeves, Ala Shaabana, and Matthew McAteer.

In November 2021, the whitepaper was revised with the new title "Bittensor: A Peer-to-Peer Intelligence Market", and listed Yuma Rao as a co-author alongside Steeves, Shaabana, Daniel Attevelt, and McAteer. While Steeves and Shaabana are publicly known as co-founders, Rao's identity remains pseudonymous.

Bittensor aimed to create a decentralized, blockchain-based machine learning network that incentivizes participants to contribute AI models and rewards them with the native TAO token based on their contributions. The stated goal was to democratize access to AI capabilities and foster collaboration in artificial intelligence development.

Since its inception, the Bittensor network has undergone several iterations and upgrades:


 * Launch of Kusanagi (January 2021): Marked Bittensor's debut as the first main network version built using the Substrate blockchain development framework. This initial implementation enabled miners and validators to start earning TAO rewards for their contributions to the network.
 * Pause of Kusanagi (May 2021): The Kusanagi network was temporarily halted to allow for refinements and optimizations of the consensus mechanisms, ensuring a more robust and efficient system moving forward.
 * Transition to Nakamoto (November 2021): Building upon the lessons learned from Kusanagi, the Bittensor team launched the Nakamoto network as a successor through a hard fork upgrade. The blockchain and all 546,113 previously mined TAO were migrated to Nakamoto, which started from block 0. This significant update introduced various enhancements and laid the groundwork for future scalability and interoperability.
 * Launch of Finney (March 2023): The Bittensor network launched Finney, an upgrade named after Bitcoin pioneer Hal Finney. This upgrade introduced the Yuma hybrid consensus algorithm, which combines Proof-of-Stake and Proof-of-Work to evaluate AI model quality and protect against malicious validator activity.

Architecture
Bittensor's architecture is designed to facilitate a decentralized, scalable, and efficient marketplace for AI services. The network consists of several key components that work together to enable collaborative learning, ensure data security, and maintain the integrity of the system.

At the core of Bittensor's architecture is the modular subnet system. Subnets are dedicated to specific machine learning domains, such as natural language processing, computer vision, or predictive analytics. Each subnet has its own set of rules and parameters, including minimum staking requirements for validators, reward distribution mechanisms, and the specific AI models and datasets used. This modular approach enhances the efficiency and scalability of the network, allowing for parallel processing of requests and the compartmentalization of data and resources.

Within each subnet, there are three main types of participants: miners, validators, and nominators.


 * Miners offer AI models and respond to user requests, contributing to the Proof-of-Work component of the consensus. Miners are rewarded with emissions, and low scoring miners are subject to being de-registered by new participants.
 * Validators send user queries to miners, assess the quality of their responses, and rank the quality of the miner’s responses. Validator emissions are weighted by their V-Trust score, which measures the reliability and effectiveness of validators based on how closely their scoring aligns with the consensus of the network. Poor performing validators lose emissions, and also face the risk of deregistration.
 * Nominators are TAO holders who delegate their tokens to validators, increasing the validators' influence and earning a share of the rewards.

Bittensor employs a decentralized mixture-of-experts (MoE) approach, where each miner acts as an expert, offering its specialized knowledge and capabilities to the network. Within the subnet, validators distribute the request to a subset of miners, who process the input data using their AI models and generate outputs. The validators then assess the quality and relevance of each miner's response. Typically, the result from the highest-scoring miner is returned to the user, ensuring low latency.

Bittensor's architecture is designed to scale horizontally, accommodating a growing number of participants and handling increasing volumes of requests. The peer-to-peer communication protocol enables efficient and secure interactions between network participants, eliminating the need for intermediaries and reducing the risk of single points of failure. The network also supports cross-subnet communication and interoperability, enabling the seamless integration of different AI services and creating opportunities for the development of novel applications that span across domains.

Consensus Mechanism
The Yuma consensus mechanism is designed to achieve consensus in a decentralized network through a game-theoretic approach involving honest participants (with stake $$s_H$$) and potentially malicious participants (cabal, with stake $$1 - s_H$$). The objective is to optimize a Nash equilibrium, which is a state where no participant can improve their payoff by unilaterally changing their strategy, given the strategies of others.

The honest participants aim to maintain their scoring power (stake) $$s_H$$ by ensuring that their emission (reward) $$e_H$$ is at least equal to their stake, i.e., $$s_H \leq e_H$$. They assign a weight $$w_H$$ to themselves and $$1 - w_H$$ to the cabal, representing the ongoing cost or expense they incur for maintaining their scoring power.

On the other hand, the cabal can freely set its self-weight $$w_C$$ and weight $$1 - w_C$$ on the honest participants without incurring any cost. The cabal's goal is to maximize the honest self-weight expense $$w_H$$ by strategically setting their self-weight $$w_C$$. This is expressed by the following formula:

$$w_C^* = \arg\max_{w_C} \mathbb{E}[w_H | s_H = e_H(s_H, w_H, w_C)]$$

This formula represents the cabal's optimal self-weight $$w_C^*$$ that maximizes the expected value of the honest self-weight expense $$w_H$$, given the honest stake $$s_H$$, honest self-weight $$w_H$$, and cabal self-weight $$w_C$$. The cabal aims to force the honest participants to incur a higher cost (higher $$w_H$$) to maintain their scoring power.

However, if the honest majority (i.e., $$s_H > 0.5$$) employs a consensus policy $$\pi$$, they can modify all weights to optimize the Nash equilibrium and minimize the honest self-weight expense $$w_H$$, which the cabal tried to maximize. This is expressed by the following formula:

$$\min_{\pi} \max_{w_C} \mathbb{E}[w_H \mid s_H = e_H(s_H, \pi(w))]$$

Here, the consensus policy $$\pi$$ modifies the weights $$w$$ to minimize the expected value of the honest self-weight expense $$w_H$$, while considering the cabal's strategy to maximize $$w_H$$ through their self-weight $$w_C$$. The consensus policy $$\pi$$ aims to find a Nash equilibrium where the honest participants can maintain their scoring power with minimal cost, despite the cabal's attempts to increase their cost.

Weight Consensus
The consensus policy $$\pi$$ modifies the validators' weights to minimize the variance in rewards while correcting for objectively incorrect validator self-weights.

The consensus weight for honest validators is calculated as:

$$w_H = \frac{s_H w_H^2 + (1 - s_H)(1 - w_C)^2}{s_H w_H + (1 - s_H)(1 - w_C)}$$

This formula represents the consensus weight assigned to honest validators, which is a weighted average of their self-weight $$w_H$$ and the weight assigned to them by the cabal $$(1 - w_C)$$, weighted by the respective stakes $$s_H$$ and $$(1 - s_H)$$.

Similarly, the consensus weight for cabal validators is calculated as:

$$w_C = \frac{s_H (1 - w_H)^2 + (1 - s_H)w_C^2}{s_H (1 - w_H) + (1 - s_H)w_C}$$

This formula represents the consensus weight assigned to cabal validators, which is a weighted average of the weight assigned to them by the honest validators $$( 1 - w_H )$$ and their self-weight $$w_C$$, weighted by the respective stakes $$s_H$$ and $$(1 - s_H)$$.

The consensus deviation is the difference between the consensus weight and the self-weight for honest validators ($$\Delta w_H = w_H - w_H$$) and cabal validators ($$\Delta w_C = w_C - w_C$$). These deviations are used in the consensus policy to adjust the weights and achieve the desired Nash equilibrium.

Quality-Weighted Voting
The Yuma consensus introduces the concept of "quality-weighted voting," which adjusts a miner's influence based on the quality of their AI services. This incentivizes miners to provide high-performing models, exhibiting an exponential reward distribution curve where more specialized miners receive greater rewards. By considering the quality of contributions, Yuma aims to incentivize miners to continuously improve the performance of their AI models and services.

Security Measures
To ensure the security and integrity of the network, Yuma employs several security measures:


 * 1) Slashing Penalties: Malicious activities, such as proposing invalid blocks, can result in token slashing, where a portion of the validators stake is slashed or removed as a penalty. This disincentivizes validators from engaging in malicious behavior.
 * 2) Reputation Scores: Validators maintain reputation scores, which can be reduced as a consequence of poor performance or malicious activities. Lower reputation scores can lead to reduced influence and rewards for validators, incentivizing them to maintain good behavior and performance.
 * 3) Weight Trust: Yuma incorporates a weight trust mechanism, denoted as $$T = (W > 0)S$$, which is the sum of stake assigning a non-zero weight to a validator. A consensus threshold $$C = (1 + \exp(-\rho(T - \kappa)))^{-1}$$ provides a smooth threshold at $$\kappa$$, where exceeding $$\kappa$$ ratio of stake quickly allows for high trust. This mechanism nullifies rewards for validators deemed untrustworthy by the majority stake, as indicated by a zero weight assigned to them.

In summary, the Yuma consensus mechanism is a stake-based, variable-expense consensus algorithm designed to achieve accurate consensus in adversarial settings. It incorporates stake-based weight trust, smooth density evolution, and Nash equilibrium optimization via weight reduction, ensuring minority stake deterioration when faced with malicious actors. The combination of these mechanisms aims to create a secure and incentive-aligned decentralized network for AI services.

Distribution and Tokenomics
TAO's distribution is based on a fair launch model, with no pre-mined tokens or initial coin offerings (ICOs). Instead, TAO is issued through a block reward mechanism, where miners and validators earn tokens for their contributions to the network. Approximately every 12 seconds, a new block is added to the Bittensor blockchain, and a reward of 1 TAO is distributed among the participants. This results in a daily emission of 7,200 TAO tokens.

To maintain a balanced supply and demand dynamic, TAO incorporates a four-year halving cycle. Once half of the total TAO supply has been issued, the rate at which new tokens are created is reduced by 50%. The first halving event is expected to occur in October 2025 (as of July 2024), and subsequent halvings will take place every four years thereafter. For instance, by the 12th halving event, projected to happen in 2069, the total number of TAO in existence is expected to be around 20,994,873.

As of July 2024, approximately 7.01 million TAO tokens are in circulation. The majority of these tokens are actively participating in the network through staking or delegation, with 82.67% of the circulating supply being staked or delegated and 17.33% being freely traded.

TAO's tokenomics also include a unique feature called "recycling," where tokens spent on miner and validator registration fees are returned to the reward pool (unissued supply). The cost of registration within subnets fluctuates based on the number of miners seeking to join, creating a dynamic market for network participation. This recycling mechanism delays the halving schedule, as every TAO spent on registration pushes the halving event by approximately 12 seconds. The exact date of the halving cannot be precisely determined due to this dynamic nature of the recycling process.

Ecosystem and Applications
One of the key features of the Bittensor ecosystem is its ability to foster collaboration and knowledge sharing among different AI models and developers. By incentivizing valuable contributions through the TAO token, the network encourages continuous improvement and innovation across various domains.

As of July 2024, the Bittensor network has a current limitation of 45 subnet slots. This limited availability has created a highly competitive environment, where subnet owners must continuously demonstrate the value and performance of their subnets to avoid deregistration. New, potentially more promising ones may replace poorly performing subnets.

Several subnets within the Bittensor ecosystem are working towards lowering the entry barriers for miners and validators, aiming to address significant obstacles such as setup complexity, computing power, bandwidth, and other hardware. By providing more accessible solutions, these subnets hope to attract a wider range of participants and encourage the expansion of the Bittensor network.

Among the notable applications and subnets within the Bittensor ecosystem are:


 * Cortex.t: Focusing on natural language processing, text generation, Cortex.t enables decentralized interactions with leading neural networks, revolutionizing the way developers and users create and utilize AI-driven applications for text-based tasks.
 * ItsAI: Specializing in AI detection for text, ItsAI allows users to submit text and determine the probability of it being AI-generated. The project aims to develop a full web service that will provide AI text detection capabilities to users both within and outside the Bittensor community.
 * Proprietary Trading Network: Focused on financial forecasting and analysis, Proprietary Trading Network enables miners to submit short-term predictions for various financial assets, including cryptocurrencies and stocks.

The Bittensor ecosystem continues to grow and evolve, with the expectation that more innovative and specialized applications will emerge, further expanding the capabilities and reach of decentralized AI. The network's focus on continuous innovation and reaching more users aligns with Bittensor's original vision.

Future Directions
Bittensor's future development includes plans to expand the current limitation of 45 subnets up to 64 subnets. This would enable the network to accommodate a wider range of AI applications. However, this expansion must be carefully managed to ensure platform stability and security.

Challenges
Bittensor, as a decentralized AI platform, faces challenges in navigating regulatory environments and addressing issues like "copy-weighting", where miners copy successful models' weights to gain rewards without contributing value. Ensuring compliance with emerging AI regulations while maintaining decentralization is a balancing act. Bittensor has taken steps to address copy-weighting, such as blacklisting mechanisms, refining the reward system and a newly introduced commit-reveal feature.

Dynamic TAO
The Dynamic TAO (dTAO) proposal aims to decentralize governance by giving TAO token holders a say in resource allocation and direction. It introduces a distinction between TAO held in reserve and Dynamic TAO used within subnets for consensus weight and dividends. The design maintains the 21 million TAO supply cap by gating all Dynamic TAO demand through TAO.

Under dTAO, emission vectors for newly minted TAO to subnets are computed through Uniswap pool market dynamics, allowing decentralized resource allocation based on perceived subnet value. Global Dynamic TAO represents a key's total TAO-denominated value across dynamic tokens, attaining 50% consensus weight on all subnets to reflect TAO's market cap. The proposal decouples subnet selection from delegates, putting power in liquid market dynamics.