Bittensor Subnet 58 — Miner & Validator for DRAIN Protocol scoring of AI providers
HS58-subnet is an early-stage Python project in the AI payments / x402 ecosystem, focused on agent-to-agent, bittensor, drain-protocol, subnet-58. It currently has 2 GitHub stars and 8 forks, and sits alongside related tools like HS58, a2a-go, swival.
Network Oracle: Decentralized provider monitoring for AI services.
Miners probe provider endpoints worldwide. Validators score miners by consensus accuracy. Honest monitors earn TAO — no wallets, no staking, no provider setup needed.
Marketplace Registry ──► Validator ──► sends ProviderProbe to all Miners
│
Miner A ◄──────┤──────► Miner B ◄──────┤──────► Miner C
│ │ │
▼ ▼ ▼
HTTP GET probe HTTP GET probe HTTP GET probe
Provider URL Provider URL Provider URL
│ │ │
└────────────────────────┼────────────────────────┘
▼
Validator: Consensus
(majority vote + median latency)
│
▼
Miner scores = accuracy vs consensus
→ EMA smoothed → Bittensor weights
| Role | What it does | Requirements |
|---|---|---|
| Miner (Neutral Monitor) | Receives probe URLs from validators, performs HTTP GET, reports reachability + status + latency | VPS + internet |
| Validator (Miner Evaluator) | Sends probe tasks, computes consensus, scores miners by accuracy, sets weights | Staked TAO + VPERMIT |
Each epoch, the validator:
PROBES_PER_ROUND providers using the epoch's block hash as seed — all validators probe the same targetsProviderProbe(target_url) to all active miners (filters out validators and unreachable UIDs)reachable + status0.4 * reachable_match + 0.3 * status_match + 0.3 * latency_bandThe latency band is a binary check: 1.0 if response latency < MAX_LATENCY_DEVIATION (2000ms), 0.0 otherwise. This is deterministic across all validators regardless of geographic location.
| Attack | Why it fails |
|---|---|
| Lie about reachability | Consensus detects disagreement — your score drops |
| Fake latency values | Binary band check; anything under threshold scores equally |
| Collude with other miners | Requires >50% of miners; validators can spot-check independently |
| Validator manipulates scores | Yuma consensus penalizes weight outliers |
| Validators set different weights | Deterministic sampling ensures all validators agree |
The oracle monitors all provider types: DRAIN, MPP (x402), and any HTTP service. The miner just pings URLs — it doesn't know or care about the payment protocol. A 402 Payment Required response is a valid "alive" signal for MPP providers.
pip install bittensor bittensor-cliNo Polygon wallet, no RPC URL, no Alchemy subscription needed.
pip install bittensor bittensor-cli
# Create coldkey (stores TAO)
btcli wallet new_coldkey --wallet.name hs58
# Create hotkey (used for subnet registration)
btcli wallet new_hotkey --wallet.name hs58 --wallet.hotkey default
Save your mnemonics securely. Check your address:
btcli wallet overview --wallet.name hs58
Miners are Neutral Monitors. No provider, no wallet, no registration — just probe URLs.
btcli subnet register --netuid 58 --wallet.name hs58 --wallet.hotkey default
Local:
pip install -e .
python neurons/miner.py --netuid 58 --wallet.name hs58 --wallet.hotkey default
Railway:
BT_HOTKEY_B64=...
BT_COLDKEYPUB_B64=...
WALLET_NAME=hs58
HOTKEY_NAME=default
NEURON_TYPE=miner
AXON_PORT=8091
AXON_EXTERNAL_PORT=443
Linux / Mac:
base64 -w 0 < ~/.bittensor/wallets/hs58/hotkeys/default
base64 -w 0 < ~/.bittensor/wallets/hs58/coldkeypub
Windows PowerShell:
[Convert]::ToBase64String([IO.File]::ReadAllBytes("$env:USERPROFILE\.bittensor\wallets\hs58\hotkeys\default"))
[Convert]::ToBase64String([IO.File]::ReadAllBytes("$env:USERPROFILE\.bittensor\wallets\hs58\coldkeypub"))
btcli subnet register --netuid 58 --wallet.name hs58 --wallet.hotkey default
btcli stake add --wallet.name hs58 --wallet.hotkey default --amount 100
Railway:
BT_HOTKEY_B64=...
BT_COLDKEYPUB_B64=...
WALLET_NAME=hs58
HOTKEY_NAME=default
NEURON_TYPE=validator
Docker (self-hosted, with auto-update):
docker build -t hs58-validator .
docker run -d --restart unless-stopped \
-e BT_HOTKEY_B64="$(base64 -w 0 < ~/.bittensor/wallets/hs58/hotkeys/default)" \
-e BT_COLDKEYPUB_B64="$(base64 -w 0 < ~/.bittensor/wallets/hs58/coldkeypub)" \
-e NEURON_TYPE=validator \
-e WALLET_NAME=hs58 \
-e HOTKEY_NAME=default \
-e AUTOUPDATE_ENABLED=true \
hs58-validator
| Variable | Default | Used by | Description |
|---|---|---|---|
PROBE_TIMEOUT_MS |
5000 |
Miner | HTTP probe timeout in milliseconds |
REGISTRY_URLS |
https://handshake58.com/api/validator/registry,https://mpp.dev/api/services |
Validator | Provider registry URLs (comma-separated, validators try them in order with cache fallback) |
REGISTRY_CACHE |
registry_cache.json |
Validator | Local fallback cache file |
PROBES_PER_ROUND |
5 |
Validator | Random providers probed per epoch |
MAX_LATENCY_DEVIATION |
2000 |
Validator | Latency band threshold in ms (binary: below = pass) |
MARKETPLACE_URL |
https://www.handshake58.com |
Validator | Marketplace for probe alerts |
AUTOUPDATE_ENABLED |
false |
Both | Auto-update for Docker deployments |
AUTOUPDATE_BRANCH |
main |
Both | Git branch to track |
HS58-subnet/
├── neurons/
│ ├── miner.py # Neutral Monitor (HTTP probe)
│ └── validator.py # Miner Evaluator (consensus scoring)
├── subnet58/
│ ├── __init__.py # Version (2.1.1)
│ ├── protocol.py # ProviderProbe Synapse (4 fields)
│ ├── config.py # Oracle configuration constants
│ ├── registry_client.py # Provider discovery + cache + alerts
│ ├── base/ # Base classes (Bittensor template)
│ │ ├── neuron.py
│ │ ├── miner.py
│ │ └── validator.py
│ └── utils/
│ ├── config.py # CLI args
│ └── misc.py
├── requirements.txt
├── setup.py
├── .env.example
├── Dockerfile
├── entrypoint.sh # Wallet decode + neuron start
└── min_compute.yml
Install the development extras and run the test suite:
pip install -e .[dev]
pytest tests/ -v --cov # unit tests with coverage
ruff check . # lint (syntax + undefined names)
The CI runs two jobs on every push and pull request to main:
ruff with a conservative ruleset (syntax errors, invalid
comparisons, undefined names) — the same rules GitHub recommends for
Python actions. Does not enforce style.pytest with coverage on Python 3.9, 3.10, and 3.11. The
coverage XML is uploaded as an artifact for downstream tooling.The unit tests cover the Yuma-proof v2.1.0 logic — deterministic provider
sampling, binary latency band, consensus computation, registry failover,
the active-miner UID filter, and the ProviderProbe Synapse contract.
PolyForm Shield 1.0 — Use, modify, and deploy for any purpose except building a competing product. See LICENSE.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Aser is a lightweight, self-assembling AI Agent frame.
Beacon - agent-to-agent pings with optional RTC value attached (BoTTube/Moltbook/RustChain + UDP bus)