Autonomy unbridled. Governed by math, not blind faith.
Documentation • Inference Labs • Stats • Studio • Dashboard
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.
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.
- 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
- 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
| 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.
Automatically detects your platform, downloads the latest release, verifies the SHA256 checksum, and installs to /usr/local/bin:
curl -fsSL https://raw.githubusercontent.com/inference-labs-inc/subnet-2/main/install.sh | bashTo install only the miner or validator:
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-validatorFor testnet builds (from the testnet branch):
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-validatorOr download manually from GitHub Releases.
git clone https://github.com/inference-labs-inc/subnet-2.git
cd subnet-2
cargo build --release --bin sn2-validator --bin sn2-minerBinaries will be at target/release/sn2-validator and target/release/sn2-miner.
btcli subnet register --subtensor.network finney --netuid 2 --wallet.name {your_coldkey} --wallet.hotkey {your_hotkey}Docker
---
services:
subnet-2-miner:
image: ghcr.io/inference-labs-inc/subnet-2:latest
restart: unless-stopped
ports:
- 8091:8091
volumes:
- {path_to_your_.bittensor_directory}:/home/subnet2/.bittensor
environment:
- PUID=1000
- HOME=/home/subnet2
labels:
- com.centurylinklabs.watchtower.enable=true
command: sn2-miner --wallet-name {your_miner_key_name} --wallet-hotkey {your_miner_hotkey_name} --netuid 2
watchtower:
image: containrrr/watchtower:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command: --interval 60 --cleanup --label-enabledocker 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 2make 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):
pm2 start ./sn2-miner --name subnet-2-miner --kill-timeout 3000 -- \
--wallet-name {your_miner_key_name} \
--wallet-hotkey {your_miner_hotkey_name} \
--netuid 2Docker
---
services:
subnet-2-validator:
image: ghcr.io/inference-labs-inc/subnet-2:latest
restart: unless-stopped
ports:
- 8443:8443
- 9090:9090
volumes:
- {path_to_your_.bittensor_directory}:/home/subnet2/.bittensor
environment:
- PUID=1000
- HOME=/home/subnet2
labels:
- com.centurylinklabs.watchtower.enable=true
command: sn2-validator --wallet-name {validator_key_name} --wallet-hotkey {validator_hotkey_name} --netuid 2
watchtower:
image: containrrr/watchtower:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command: --interval 60 --cleanup --label-enabledocker 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 2make 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):
pm2 start ./sn2-validator --name subnet-2-validator --kill-timeout 3000 -- \
--wallet-name {validator_key_name} \
--wallet-hotkey {validator_hotkey_name} \
--netuid 2Miners 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.
| Component | Requirement |
|---|---|
| CPU | 8 core 3.2GHz |
| RAM | 32GB |
| Network Up | 400Mbps |
| Network Down | 400Mbps |
| Storage | 1TB |
| Storage Medium | NVMe SSD |
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 |
Validators are responsible for verifying model outputs as provided by miners, and updating that miner's score based on the verification results.
| Component | Requirement |
|---|---|
| CPU | 8 core 3.2GHz |
| RAM | 16GB |
| Network Up | 400Mbps |
| Network Down | 400Mbps |
| Storage | 1TB |
| Component | Recommendation |
|---|---|
| CPU | 8 core 3.4GHz |
| RAM | 32GB |
| Network Up | 1+Gbps |
| Network Down | 1+Gbps |
| Storage | 2+TB |
| Storage Medium | SSD |
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.