AI Provider Templates & Docs for Handshake58 — Bittensor Subnet 58 powered by DRAIN Protocol
HS58 is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on agent-to-agent, ai-marketplace, bittensor, bittensor-subnet. It currently has 3 GitHub stars and 7 forks, and sits alongside related tools like HS58-subnet, HYRVE-AI, dna-x402.
AI Provider Directory � DRAIN & MPP Protocols � Bittensor Subnet 58
Live Marketplace � Thesis � DRAIN Protocol
Handshake58 is a decentralized AI provider marketplace where agents discover providers, pay per request via DRAIN or MPP protocols, and providers are scored trustlessly through Bittensor Subnet 58.
drain-mcp) handles both protocols automaticallyflowchart LR
Agent["AI Agent"]
MP["Marketplace\nhandshake58.com"]
Provider["Provider"]
Polygon["Polygon\nDRAIN Contract"]
Validator["Validator\nSubnet 58"]
BT["Bittensor"]
Agent -->|discovers providers| MP
Agent -->|"DRAIN: payment channel\nMPP: HTTP 402 per-request"| Provider
Provider -->|claims USDC| Polygon
Validator -->|scans ChannelClaimed events| Polygon
Validator -->|sets weights| BT
BT -->|TAO rewards| Provider
MP -->|syncs scores| BT
DRAIN path: Discover providers ? Deposit USDC ? Send requests with signed vouchers ? Close channel
MPP path: Discover providers ? Send request ? Pay per-request via HTTP 402 (no channel needed)
For Providers: Deploy template ? Register on marketplace ? Serve AI inference ? Earn USDC
Ready-to-deploy provider templates for LLM proxies, API wrappers, and custom tools. Supports backends like OpenAI, Anthropic, xAI, OpenRouter, Replicate, Ollama, and many more.
Browse all templates in the providers/ directory. Each template includes DRAIN voucher validation, automatic payment claiming, configurable pricing, health monitoring, and one-click Railway deployment.
flowchart LR
S1["1. Fork Template\ngit clone HS58"]
S2["2. Configure\n.env: API_KEY,\nPRIVATE_KEY, RPC_URL"]
S3["3. Deploy\nRailway one-click"]
S4["4. Earning USDC\nAgents pay per request"]
S1 --> S2 --> S3 --> S4
Works with: OpenAI, Anthropic, xAI, Ollama, vLLM, any OpenAI-compatible API
git clone https://github.com/Handshake58/HS58.git
cd HS58/providers/hs58-openai # or hs58-claude, hs58-grok, hs58-custom, etc.
npm install
cp env.example .env
# Required
OPENAI_API_KEY=sk-... # Your backend API key
PROVIDER_PRIVATE_KEY=0x... # Polygon wallet private key (receives USDC)
# Recommended � use Alchemy for reliable claiming (free tier is fine)
POLYGON_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
# Optional (defaults shown)
PORT=3000
CHAIN_ID=137 # 137=Polygon, 80002=Amoy testnet
CLAIM_THRESHOLD=1000000 # Min amount to claim (1 USDC)
MARKUP_PERCENT=50 # Markup on upstream prices
PROVIDER_NAME=HS58-OpenAI # Name in API responses
AUTO_CLAIM_INTERVAL_MINUTES=10 # How often to check for expiring channels
AUTO_CLAIM_BUFFER_SECONDS=3600 # Claim channels expiring within this window
Local:
npm run dev
# Provider runs at http://localhost:3000
# Test: curl http://localhost:3000/health
Railway (recommended for production):
/providers/hs58-openai (or your template)railway.json and buildsOnce your provider is running, visit handshake58.com/become-provider to submit your provider for listing. Bittensor miners are auto-verified; community providers need admin approval.
You need a Polygon wallet to receive USDC payments. The private key goes into PROVIDER_PRIVATE_KEY.
Option A: MetaMask (easiest)
0x... private key into your .envOption B: Command line
# Using cast (from Foundry)
cast wallet new
# Output: Address: 0x... Private Key: 0x...
# Or using Node.js
node -e "const w = require('ethers').Wallet.createRandom(); console.log('Address:', w.address, '\nPrivate Key:', w.privateKey)"
Important: Fund your wallet with a small amount of POL for gas (~$0.01 is enough). You can bridge from any chain or buy on an exchange.
See the HS58-subnet README for Bittensor wallet setup with btcli.
Run a provider + register as a Bittensor miner to earn TAO incentives.
pip install bittensor (Python >= 3.9)btcli wallet new_coldkey + btcli wallet new_hotkeybtcli subnet register --netuid 58NEURON_TYPE=minerSee the full guide in the HS58-subnet README.
Score showing 0? Run a self-test payment to generate on-chain claims and bootstrap your score (~$0.13/test).
| Recipient | Share |
|---|---|
| Miners | 41% |
| Validators | 41% |
| Subnet Owner | 18% |
Hardcoded in Yuma Consensus � not configurable.
Run a validator to score providers on Subnet 58.
pip install bittensorNEURON_TYPE=validatornpm install -g drain-mcp
{
"mcpServers": {
"drain": {
"command": "drain-mcp",
"env": {
"DRAIN_PRIVATE_KEY": "your-polygon-wallet-private-key"
}
}
}
}
The MCP server provides 12 tools: drain_providers, drain_provider_info, drain_balance, drain_approve, drain_open_channel, drain_chat, mpp_chat, drain_channel_status, drain_channels, drain_close_channel, drain_cooperative_close, drain_feedback.
Provider categories: llm, image, audio, code, scraping, vpn, multi-modal, other. For non-LLM providers, read docs via drain_provider_info before sending requests.
# All providers
GET https://handshake58.com/api/mcp/providers
# Filter by category or model
GET https://handshake58.com/api/mcp/providers?model=gpt-4o&category=scraping&limit=3&format=compact
Filters: model, category, tier (bittensor/community), minScore, limit, format (compact/full)
If your agent can't install npm packages, use the REST API directly:
# Get EIP-712 signing parameters, voucher types, and provider endpoints
GET https://handshake58.com/api/drain/signing
| Contract | Address | Network |
|---|---|---|
| DRAIN Channel V2 | 0x0C2B3aA1e80629D572b1f200e6DF3586B3946A8A |
Polygon Mainnet |
| USDC | 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 |
Polygon Mainnet |
| Repo | Description |
|---|---|
| HS58 | This repo � provider templates, docs, hub |
| HS58-subnet | Bittensor Subnet 58 validator + miner |
| DRAIN Protocol | Core protocol, smart contracts, SDK |
PolyForm Shield 1.0 � You can use, modify, and deploy this software for any purpose except building a competing product. See LICENSE for details.
Handshake58 © 2026 � Trustless AI payments powered by DRAIN Protocol & Bittensor
Bittensor Subnet 58 — Miner & Validator for DRAIN Protocol scoring of AI providers
The first AI agent marketplace. 5,750+ community, 51+ API endpoints, 85% commission. Powered by CashClaw v1.7.0.
DNA — Payment rails for AI agents. x402 micropayment protocol on Solana. Netting, transfer, stream settlement. Receipt anchoring on-chain.
The agent-native LLM router for OpenClaw. 41+ models, <1ms routing, USDC payments on Base & Solana via x402.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
DePIN for Vintage Hardware — Proof-of-Antiquity blockchain where old machines outmine new ones. AI-powered hardware fingerprinting, 15+ CPU architectures, Solana bridge (wRTC). $0 VC.
🚀 Curated list of x402 resources: HTTP 402 Payment Required protocol for blockchain payments, crypto micropayments, AI agents, API monetization. Includes SDKs (TypeScript, Python, Rust), examples, facilitators (Coinbase, Cloudflare), MCP integration, tutorials. Accept USDC payments with one line of code. Perfect for AI agent economy.
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
The neutral micropayment router for autonomous agents. A single HTTP client that intercepts '402 Payment Required', routes across x402, L402, and MPP, persists credentials as recoverable assets, enforces per-envelope budgets, and emits a structured trace.