EIN: Decentralized Inference Network with X402
Core Concept
Infernet = Infrastructure + Inference + Network
A peer-to-peer network where anyone can:
- Provide inference capacity (run AI models)
- Consume inferences paying per request with X402
- Compete on price, quality, and speed
Problem It Solves
Current State:
- Centralized AI APIs (OpenAI, Anthropic, etc.)
- Fixed and high prices
- Censorship and geographic restrictions
- No real competition
- GPU resources wasted globally
With Infernet:
- Free inference marketplace
- Dynamic pricing through competition
- No censorship - truly decentralized AI
- Monetize your idle GPU
- Global access without restrictions
Architecture
1. Provider Nodes
class InferenceNode {
constructor() {
this.models = ['llama-3.3', 'mistral-7b', 'stable-diffusion'];
this.pricing = {
'llama-3.3': '0.0001 USDC/token',
'mistral-7b': '0.00008 USDC/token',
'stable-diffusion': '0.01 USDC/image'
};
}
// X402 endpoint for inference
async handleInference(request) {
// Verify X402 payment
// Execute inference
// Return result
}
}
2. On-Chain Registry
- Smart contract on Base for node registration
- Metadata: available models, prices, average latency
- Reputation based on fulfillment
3. Client SDK
const infernet = new InfernetClient({
network: 'base',
paymentWallet: walletClient // Wallet API v2
});
// Find best price for Llama 3.3
const nodes = await infernet.findNodes({
model: 'llama-3.3',
maxPrice: '0.0002',
minReputation: 0.9
});
// Execute inference with automatic payment
const response = await infernet.inference({
node: nodes[0],
prompt: "Explain Web3 in simple terms",
maxTokens: 100
});
X402 Economics
Payment Flow:
- Client searches for available nodes
- Selects by price/speed/reputation
- Sends request with X402
- Node verifies instant payment
- Executes inference
- Client receives result
Advantages:
- No intermediaries: Direct node-client payment
- Real micropayments: Pay only for what you use
- Instant settlement: USDC on Base
- No accounts needed: You only need a wallet
MVP Features
V1 - Hackathon (see task-tracking):
- Node registry in smart contract
- 3 demo nodes with different models
- Client that finds best price
- X402 payments for inference
- Metrics dashboard
V2 - Post-Hackathon:
- Proof of Inference (cryptographic verification)
- Staking for nodes (collateral)
- Automatic load balancing
- Parallel multi-model support
- Distributed caching
Tech Stack
- Smart Contracts: Solidity on Base (see node-registry-smart-contract)
- Nodes: Node.js + Express + X402
- Models: Llama.cpp, ONNX Runtime, powerful open-source models
- Payments: X402 + Wallet API v2 (see learn-x402 and learn-wallet-api)
- Frontend: React + Viem
Use Cases
1. App Developers
“Integrate AI without centralized APIs”
const ai = new InfernetClient();
const response = await ai.complete("Generate code for...");
2. GPU Providers
“Monetize your idle hardware”
- Install Infernet node
- Configure models and prices
- Earn USDC for inference
3. Autonomous AI Agents
“Agents that buy intelligence”
- Agents with their own wallets
- Buy inference as needed
- Optimize by cost/quality
Hackathon Demo
Setup:
- 3 Infernet Nodes with different prices
- Demo Client that compares prices
- AI Agent that uses the network autonomously
- Dashboard showing real-time activity
Demo Flow:
- “I want to generate an image of an astronaut cat”
- Client searches for nodes with Stable Diffusion
- Finds 3 options: 0.008, $0.012
- Selects the cheapest with good reputation
- Pays with X402 automatically
- Receives image in 5 seconds
- Total spent: $0.008 USDC
Why We’ll Win
- Uses both CDP technologies: Wallet API + X402 (detailed in cdp-submission)
- Solves a real problem: Democratizes AI access
- Clear business model: Marketplace with fees
- Technically impressive: P2P + payments + AI
- Great narrative: “Uber for GPUs”
Future Vision
“Imagine a world where:”
- Any GPU can earn money
- Any app can use AI without censorship
- AI prices drop through competition
- AI agents have their own economy
“That’s Infernet - the missing infrastructure for decentralized AI.”
See also: project, CLI PRS, project-architecture, submission
Related projects: Financial Contracts, Optimizer Finance