Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

subnet-2

> 编程语言
Open source

Verifiable inference on Bittensor

2.4K stars0 likes2 views
WebsiteGitHub

About

Verifiable inference on Bittensor

Subnet 2 represents a significant stride in enhancing the Bittensor network, aiming to create the world's largest peer-to-peer Verified Intelligence network, by building a Proof-of-Inference system for the Bittensor network. This initiative aligns with the Opentensor foundation's criteria for innovative subnet solutions. zk-ML allows AI models to be converted into a unique 'fingerprint,' a circuit that can be used to verify that a model's prediction was generated by a specific AI model, thereby providing what we term as Proof-of-Inference.

The miner and validator are native Rust binaries communicating over both HTTP and QUIC (via btlightning). Pre-built binaries are published as GitHub releases; the binaries include a built-in auto-update mechanism that polls for new releases every 5 minutes and performs atomic binary replacement so PM2 restarts with the new version.

Miners and Validators Functionality

Incentive Mechanism and Reward Structure

Subnet 2 incentivizes miners and validators to contribute to the generation and validation of high-quality, secure, and efficient verified AI predictions using a specialized reward mechanism aligned with the unique aspects of zero-knowledge machine learning (zk-ML) and decentralized AI. Zero-knowledge proofs are generally more CPU computationally intensive and open the opportunity for non-GPU miners to participate, however the end goal is to further incentivize the development of proving systems optimized for GPU-based operations. The incentives are based around miners creating succinct and efficient models which can be circuitized with a zero-knowledge proving system.

The reward mechanism scores the initial AI predictions based on the cryptographic integrity and time to generate zk-proofs along with the outputs, rather than solely on end results. This approach reduces the computational burden on validators as zk-proofs confirm the source model and integrity of AI predictions efficiently.

Miners

  • Receive input data from validators on the subnet
  • Generate predictions using custom, verifiable AI models that have been converted into zero-knowledge circuits
  • Return the generated content to the requesting validator for validation and distribution

Validators

  • Produce input data and distribute requests for verified inference throughout miners participating on the subnet
  • Confirm that miners are acting faithfully, by verifying the authenticity of the miner's returned zero-knowledge proof
  • Score results from miners based on performance metrics such as proof size and response time

Quickstart

Prerequisites

Tool Description
Rust Required to build from source. Install via curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
PM2 Process manager used to run and monitor the binaries in the background
btcli CLI for interacting with the Bittensor network (wallet creation, registration)

Alternatively, use Docker — no Rust toolchain needed. See the Docker instructions under Run the Miner and Run the Validator below.

Install from pre-built binary

Automatically detects your platform, downloads the latest release, verifies the SHA256 checksum, and installs to /usr/local/bin:

bash
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/main/install.sh | bash

To install only the miner or validator:

bash
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/main/install.sh | bash -s -- sn2-miner
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/main/install.sh | bash -s -- sn2-validator

For testnet builds (from the testnet branch):

bash
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/testnet/install.sh | NETWORK=testnet bash
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/testnet/install.sh | NETWORK=testnet bash -s -- sn2-miner
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/testnet/install.sh | NETWORK=testnet bash -s -- sn2-validator

Or download manually from GitHub Releases.

Build from source

bash
git clone https://github.com/inference-labs-inc/subnet-2.git
cd subnet-2
cargo build --release --bin sn2-validator --bin sn2-miner

Binaries will be at target/release/sn2-validator and target/release/sn2-miner.

Setup guide →

Register on the Subnet

bash
btcli subnet register --subtensor.network finney --netuid 2 --wallet.name {your_coldkey} --wallet.hotkey {your_hotkey}

Run the Miner

Docker

With docker compose (recommended)

…

With docker cli

bash
docker run -d \
  --name subnet-2-miner \
  -p 8091:8091 \
  -v {path_to_your_.bittensor_directory}:/home/subnet2/.bittensor \
  -e PUID=1000 \
  -e HOME=/home/subnet2 \
  --restart unless-stopped \
  ghcr.io/inference-labs-inc/subnet-2:latest \
  sn2-miner \
  --wallet-name {your_miner_key_name} \
  --wallet-hotkey {your_miner_hotkey_name} \
  --netuid 2

With PM2

bash
make pm2-miner WALLET_NAME={your_miner_key_name} WALLET_HOTKEY={your_miner_hotkey_name}

Or directly (use ./sn2-miner for pre-built binaries, target/release/sn2-miner for source builds):

bash
pm2 start ./sn2-miner --name subnet-2-miner --kill-timeout 3000 -- \
  --wallet-name {your_miner_key_name} \
  --wallet-hotkey {your_miner_hotkey_name} \
  --netuid 2

Run the Validator

Docker

With docker compose (recommended)

…

With docker cli

bash
docker run -d \
  --name subnet-2-validator \
  -p 8443:8443 \
  -p 9090:9090 \
  -v {path_to_your_.bittensor_directory}:/home/subnet2/.bittensor \
  -e PUID=1000 \
  -e HOME=/home/subnet2 \
  --restart unless-stopped \
  ghcr.io/inference-labs-inc/subnet-2:latest \
  sn2-validator \
  --wallet-name {validator_key_name} \
  --wallet-hotkey {validator_hotkey_name} \
  --netuid 2

With PM2

bash
make pm2-validator WALLET_NAME={validator_key_name} WALLET_HOTKEY={validator_hotkey_name}

Or directly (use ./sn2-validator for pre-built binaries, target/release/sn2-validator for source builds):

bash
pm2 start ./sn2-validator --name subnet-2-validator --kill-timeout 3000 -- \
  --wallet-name {validator_key_name} \
  --wallet-hotkey {validator_hotkey_name} \
  --netuid 2

Miner

Miners contribute to this subnet by providing compute to generate output from, and prove AI model inferences. Miners receive workloads from validators in the form of input data, perform verified inferences on those inputs and respond with output along with a zero-knowledge proof of inference.

Hardware requirements

Minimum

Component Requirement
CPU 8 core 3.2GHz
RAM 32GB
Network Up 400Mbps
Network Down 400Mbps
Storage 1TB
Storage Medium NVMe SSD

Recommended

[!NOTE] Exceeding these requirements in terms of storage, network and CPU speed will most likely result in higher rewards due to performance incentivization.

Component Recommendation
CPU 8 core 3.6GHz+
RAM 64GB+
Network Up 1Gbps
Network Down 1Gbps
Storage 2TB
Storage Medium NVMe SSD

Validator

Validators are responsible for verifying model outputs as provided by miners, and updating that miner's score based on the verification results.

Hardware requirements

Minimum

Component Requirement
CPU 8 core 3.2GHz
RAM 16GB
Network Up 400Mbps
Network Down 400Mbps
Storage 1TB

Recommended

Component Recommendation
CPU 8 core 3.4GHz
RAM 32GB
Network Up 1+Gbps
Network Down 1+Gbps
Storage 2+TB
Storage Medium SSD

Architecture

The codebase is organized as a Rust workspace with the following crates:

Crate Purpose
sn2-types Shared types, constants, and protocol definitions
sn2-chain Wallet, metagraph, registration, weights, and auto-update
sn2-verify Proof verification via the Expander backend
sn2-validator Validator binary
sn2-miner Miner binary

Both binaries communicate with miners/validators over HTTP (axum) and QUIC (btlightning). Chain interactions use subxt for direct Substrate RPC.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustbittensorzkzkml

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言