This document provides a high-level introduction to the BitMind Subnet, also known as GAS (Generative Adversarial Subnet) or Bittensor Subnet 34 (SN34). It explains the subnet's purpose, core components, and how they interact in an adversarial competition model. For detailed information about specific subsystems, refer to the child pages listed in the table of contents.
For installation and configuration details, see Installation and Setup. For validator-specific documentation, see Validator System. For mining operations, see Mining Operations.
GAS (Generative Adversarial Subnet) is a Bittensor subnet inspired by Generative Adversarial Networks (GANs). It orchestrates a continuous competition between two types of miners:
Validators orchestrate this competition by challenging both miner types, evaluating their performance, and distributing rewards based on a sophisticated dual-track incentive mechanism. The subnet produces two key outputs:
Unlike static AI safety solutions, GAS thrives on open, incentivized competition where detectors and generators co-evolve, ensuring detection capabilities advance as fast as the threats they face.
Sources: README.md18-26
Validators run three independent PM2 processes (or Docker containers) that work together:
| Process | Entry Point | Responsibilities |
|---|---|---|
sn34-validator | neurons/validator/validator.py | Core orchestration: challenges miners, queries benchmark results, calculates scores, sets weights on chain |
sn34-generator | neurons/validator/services/generator_service.py | Local media generation using 20+ models, CLIP verification, C2PA validation, HuggingFace uploads |
sn34-data | neurons/validator/services/data_service.py | Web scraping, dataset downloads from GAS-Station, data management |
The three-process architecture enables independent scaling, fault isolation, and resource management. Validators must have GPU access for local generation and verification tasks.
Sources: README.md124-126 docs/Validating.md37-49
Discriminative miners submit detection models for cloud evaluation. Each miner can submit one model per modality (image, video, audio). Key characteristics:
model_config.yaml, model.py, and *.safetensors weightssn34_score combines MCC (accuracy) and Brier score (calibration) using geometric meanSources: README.md117-118 docs/Discriminative-Mining.md8-13
Generative miners operate FastAPI servers that receive generation challenges from validators and respond asynchronously:
/gen_image and /gen_video endpointsSources: README.md120-122 docs/Generative-Mining.md8-18
The Competition Cycle
Challenge Phase: sn34-validator calls neurons/validator/challenge_manager.py to issue prompts to generative miners via query_generative_miner()
Generation Phase: Generative miners receive challenges, route to configured services (neurons/gen_miner/services/service_registry.py), and return C2PA-signed media via webhooks
Verification Phase: sn34-generator validates returned media using:
Data Upload Phase: Verified media uploaded to GAS-Station via neurons/validator/services/data_service.py
Evaluation Phase: Discriminative models evaluated on cloud infrastructure against:
Scoring Phase: neurons/validator/validator.py calculates:
sn34_score from benchmark APIWeight Setting: neurons/validator/validator.py allocates rewards with budget:
Sources: High-level architecture diagram in prompt, README.md28-44 docs/Validating.md37-49
Content Flow and State Management
The gas/content_manager.py class provides a unified API for all content operations:
source_type, modality, media_type)verified, uploaded, and rewarded boolean flagsimages/ and videos/ directoriesThe gas/content_db.py SQLite schema includes:
prompts table: prompt_id, prompt_text, modality, media_type, source_type, created_atmedia table: media_id, prompt_id, file_path, verified, uploaded, rewarded, source_type, created_atSources: Content Flow diagram in prompt, gas/content_manager.py44-120 gas/content_db.py20-60
The gas/cli.py command-line interface provides hierarchical commands with aliasing:
The CLI wraps PM2 process management (validator.config.js gen_miner.config.js) and provides utilities for database inspection (gascli validator db_stats gascli validator db_rows).
Sources: README.md60-91 docs/Installation.md70-93
PM2 Mode (Default)
Three independent processes managed by PM2:
sn34-validator: neurons/validator/validator.pysn34-generator: neurons/validator/services/generator_service.pysn34-data: neurons/validator/services/data_service.pyConfiguration via .env.validator and validator.config.js14-52
Docker Mode (Alternative)
Three containers orchestrated by docker-compose.yml:
validator container: All three servicesConfiguration via .env.validator with additional Docker-specific variables (WALLET_PATH, HF_HOME, SN34_CACHE_DIR).
Sources: docs/Validating.md20-49 docs/Validating.md72-169
Implementation Details
Epistula-Signed-By and Epistula-Signed-For headersSources: docs/Discriminative-Mining.md29-52 README.md104-108
Implementation Details
Sources: docs/Generative-Mining.md9-18 README.md99-101
$$sn34_{score} = \sqrt{MCC_{norm}^{1.2} \cdot Brier_{norm}^{1.8}}$$
Where:
Winner-take-all per modality: Only the highest sn34_score per modality (image, video, audio) receives alpha rewards in each competition round.
$$R_{total} = R_{base} \times M$$
Where:
Components:
| Allocation | Percentage |
|---|---|
| Burn address | 40% |
| Video escrow | 31% |
| Image escrow | 21% |
| Audio escrow | 1% |
| Active generators | 7% |
Implementation: neurons/validator/validator.py
Sources: docs/Incentive.md60-108 docs/Incentive.md110-146
For Validators:
.env.validator with WALLET_NAME, WALLET_HOTKEY, HUGGINGFACE_HUB_TOKENgascli validator startFor Discriminative Miners:
./install.sh --no-system-depsmodel_config.yaml, model.py, *.safetensorsgascli d push --image-model detector.zipFor Generative Miners:
.env.gen_miner with wallet and API keys (OpenAI, OpenRouter, or Stability AI)gascli generator startSources: README.md47-110 docs/Installation.md1-102
Sources: docs/Validating.md1-16 docs/Discriminative-Mining.md12 docs/Generative-Mining.md9-12
Refresh this wiki