This document describes the emergent marketplace for AI compute created by the Routstr protocol. By using Nostr as a global, censorship-resistant message bus, Routstr effectively builds a decentralized Order Book where supply (Providers) and demand (Clients/Agents) meet without a central coordinator.
The marketplace consists of three primary order types, mirroring traditional financial markets but adapted for compute resources:
- Actor: Standard Providers (e.g., wrappers around OpenAI/Anthropic or stable GPU clusters).
- Mechanism: Providers publish Kind 38421 announcements with a fixed
priceper token. - Behavior: "I will sell
gpt-4inference at10 sats/1k tokens." - Stability: These prices change infrequently (hours/days), providing predictable costs for real-time users.
- Actor: Interactive Agents, Chat Clients, IDEs.
- Mechanism: Clients query the registry (RIP-02) and select the best available provider right now, accepting the current "Limit Sell" price.
- Behavior: "I need an answer now. I will pay the going rate of
10 sats." - Priority: Latency > Price.
- Actor: Batch processing bots, data augmentation pipelines, fine-tuning scripts.
- Mechanism: These actors have tasks that are not time-sensitive. They hold off on execution until a provider appears with a price below their target threshold.
- Behavior: "I have 1M rows to process. I will buy
llama-3-70bcompute only if the price drops below0.5 sats/1k tokens." - Implementation:
- Node Level: Routstr nodes implement the OpenAI Batch API (
/v1/batches), allowing users to submit file-based batch jobs. The node internally holds these jobs and executes them only when market conditions meet the user's price criteria. - Client Level: Specialized clients can also run locally, observing the Kind 38421 stream and dispatching requests one-by-one or in parallel only when a suitable provider is detected.
- Node Level: Routstr nodes implement the OpenAI Batch API (
- Effect: This creates a "floor" price in the market, soaking up excess supply when providers lower prices.
To maximize utilization, providers with self-hosted hardware (e.g., H100 clusters, mining rigs repurposed for AI) can implement Dynamic Pricing Algorithms.
- Inputs: Electricity cost, hardware amortization, cooling.
- Logic:
Price = (Energy_Cost + Margin) * Utilization_Factor - Behavior: If the GPU is idle, the price drops towards the marginal cost of electricity to attract "Limit Buy" batch jobs. If the GPU is busy, the price rises to capture high-value "Market Buy" traffic.
- Mechanism: Providers publish high-frequency price updates via ephemeral Nostr events (or a dedicated pricing stream).
- Discovery: Smart Clients (RIP-03) and Aggregators monitor these streams.
- Arbitrage: If a provider drops their price significantly, automated batch jobs (Limit Buys) immediately route traffic to them, filling the idle capacity.
This hybrid structure creates a highly efficient market:
- High Availability: "Limit Sell" providers ensure there is always capacity for urgent tasks.
- High Utilization: "Dynamic Pricing" + "Limit Buy" bots ensure that hardware rarely sits idle, as price drops automatically trigger deferrable workloads.
- Price Discovery: The intersection of these forces reveals the true global market price for a token of intelligence at any given second.