University of Connecticut student team building BittBridge AI
BittBridge AI is a UConn student-led effort exploring decentralized AI.
Built by a group of University of Connecticut students working with Dr. Dave Wanik, this interface supports a student hackathon focused on BittBridge AI, validator telemetry, and decentralized prediction systems.
Live surface
Miner performance leaderboard
The dashboard pulls validator telemetry directly from W&B and ranks miners using the latest moving-average scores published by active runs, giving UConn students a live view of how the subnet behaves during hackathon work.
Overview
This site documents and visualizes BittBridge AI as a University of Connecticut student effort. It combines a live leaderboard with technical context so students, mentors, and collaborators can inspect how the subnet behaves during experiments, demos, and hackathon sessions.
Purpose and Scope
BittBridge is a Bittensor subnet (netuid 420 on testnet) that implements a decentralized price prediction system for the USDT/CNY currency pair. In this project context, the platform is also being used as a learning and build environment for UConn students working with Dr. Dave Wanik on BittBridge AI and running a student hackathon around the system.
The subnet operates through a challenge-response architecture:
- Validators (
neurons/validator.py) query miners every 5 minutes with timestamp-based challenges - Miners (
neurons/miner.py) respond with point predictions and 90% confidence intervals - Evaluation occurs after 3600-second delay to allow actual market prices to materialize
- Rewards are calculated using point forecast scoring, interval forecast scoring, and exponential moving average (EMA) smoothing with alpha=0.00958
- CoinGecko API provides both real-time price data for miners and ground truth data for validator evaluation
System Architecture
High-Level System Overview
Validator-Miner Ecosystem Architecture
The complete operational architecture features three concurrent validator loops:
Function: Queries miners every 5 minutes with timestamp-based challenges
prediction_scheduler() → neurons/validator.py
Function: Processes predictions after 3600s delay, allowing actual prices to materialize
evaluation_loop() → neurons/validator.py
Function: Updates network state by syncing with the blockchain
metagraph_resync_scheduler() → neurons/validator.py
Miners run Axon servers on port 8091 that handle Challenge synapses by fetching USDT/CNY prices from CoinGecko.
Core Prediction Workflow
Prediction-to-Reward Lifecycle
The two-phase lifecycle with delayed evaluation:
Phase 1: Collection
Collects predictions every 5 minutes and queues them with timestamps
Phase 2: Evaluation
Processes predictions after 3600s delay, allowing actual prices to materialize before evaluation
Reward Calculation
Calculates combined scores using point forecasts, interval forecasts, and EMA smoothing
Key System Components
The following table maps system components to their corresponding code implementations:
| Component | Code Entity | Primary Function | File Location |
|---|---|---|---|
| Validator Neuron | Validator(BaseValidatorNeuron) |
Orchestrates three concurrent loops | neurons/validator.py |
| Miner Neuron | Miner(BaseMinerNeuron) |
Generates price predictions with intervals | neurons/miner.py |
| Challenge Protocol | Challenge synapse |
Defines timestamp, prediction, interval fields | bittbridge/protocol.py |
| Prediction Scheduler | prediction_scheduler() |
Queries miners every 5 minutes | neurons/validator.py |
| Evaluation Loop | evaluation_loop() |
Processes predictions after 3600s delay | neurons/validator.py |
| Metagraph Resync | metagraph_resync_scheduler() |
Updates network state every 600s | neurons/validator.py |
| Reward System | get_incentive_mechanism_rewards() |
Calculates point/interval scores with EMA | bittbridge/validator/reward.py |
| Prediction Queue | self.prediction_queue |
Stores pending predictions with timestamps | neurons/validator.py |
| W&B Integration | setup_wandb(), log_wandb() |
Experiment tracking and logging | bittbridge/utils/wandb.py |
| Timestamp Utilities | get_now(), round_to_interval() |
Time management and epoch alignment | bittbridge/utils/timestamp.py |
| CoinGecko Client | fetch_current_usdt_cny() |
External price data fetching | neurons/miner.py |
| Interval Estimation | estimate_interval() |
Generates 90% confidence bounds | neurons/miner.py |
Technical Architecture Stack
The layered architecture from application code to infrastructure dependencies:
Application Layer
BittBridge Package Layer
Framework Layer
Observability Layer
Concurrent Loop Architecture
The validator manages three concurrent tasks using asyncio.gather():
Prediction Scheduler
Every 5 minutes
Populates the queue by querying all active miners with timestamp-based challenges
Evaluation Loop
Continuous with 3600s delay
Processes ready predictions after delay, fetches ground truth prices, calculates rewards
Metagraph Resync
Every 600 seconds
Maintains current network state by syncing with the blockchain
Shared State
All three loops operate concurrently, sharing state through:
prediction_queue- Pending predictions awaiting evaluationmoving_average_scores- EMA-smoothed miner performance scoresmetagraph- Current network topology and state
File Structure Overview
The BittBridge subnet follows the standard Bittensor subnet template structure with specialized USDT/CNY prediction logic:
bittbridge/
├── neurons/
│ ├── validator.py # Validator with 3 concurrent loops
│ └── miner.py # Miner with CoinGecko integration
├── bittbridge/ # Core package
│ ├── protocol.py # Challenge synapse (timestamp, prediction, interval)
│ ├── base/
│ │ ├── validator.py # BaseValidatorNeuron
│ │ └── miner.py # BaseMinerNeuron
│ ├── validator/
│ │ ├── forward.py # forward() - query miners
│ │ └── reward.py # get_incentive_mechanism_rewards()
│ └── utils/
│ ├── wandb.py # setup_wandb(), log_wandb()
│ ├── timestamp.py # get_now(), round_to_interval()
│ └── uids.py # UID management utilities
├── tests/
│ ├── test_mock.py # MockSubtensor, MockMetagraph
│ └── test_template_validator.py # Validator unit tests
├── docs/
│ ├── running_on_staging.md # Local development setup
│ ├── running_on_testnet.md # Testnet deployment (netuid 420)
│ └── running_on_mainnet.md # Mainnet deployment guide
├── scripts/
│ └── install_staging.sh # Local blockchain setup script
├── .circleci/
│ └── config.yml # CI/CD pipeline (black, pylint)
├── requirements.txt # Python dependencies
├── setup.py # Package configuration
└── README.md # Quickstart deployment guide
Key Configuration Files
requirements.txt- Python package requirements includingbittensor >= 7.0.0,torch >= 2,wandb >= 0.18setup.py- Package metadata and installation configurationREADME.md- Comprehensive testnet deployment guide with step-by-step instructions
Development and Deployment Pipeline
The system includes a comprehensive development pipeline with multiple deployment environments:
Local Development
Set up a local blockchain for testing and development
docs/running_on_staging.md
Testnet Deployment
Deploy to Bittensor testnet (netuid 420)
docs/running_on_testnet.md
Mainnet Deployment
Production deployment to Bittensor mainnet
docs/running_on_mainnet.md
Automated Testing
CircleCI integration with comprehensive test coverage
.circleci/config.yml
Production-Ready Practices
The subnet implements:
- Staged deployments across local, testnet, and mainnet environments
- Automated testing with code quality checks (black, pylint)
- Comprehensive documentation for different deployment scenarios
- Monitoring and logging with Weights & Biases integration