x402 is a modular, trustless, API-first financial stack built on the Solana blockchain. It provides the protocol and infrastructure for AI-to-AI resource settlement, enabling autonomous agents to trade compute, data, and services with cryptographic certainty.
Note
Virtual Hub Layout: This repository is a virtual hub, not a monorepo. Each sub-project is a standalone repository. Clone them alongside this hub for local development.
If you are new to the x402 ecosystem, select your path below to get started immediately:
You run a web API (REST, GraphQL, etc.) and want to monetize it via HTTP 402.
- Pick a Rail: Choose between
exact(instant, low-latency payouts) orsla-escrow(escrow protection for conditional delivery). - Get Started (
exactrail): Walk through the hands-on x402-seller-lab-express or view the minimal x402-seller-starter. - Get Started (
sla-escrowrail): Read the Seller Oracle Integration Guide.
You build autonomous agents, wallets, or clients that need to pay for premium resources.
- Get Started (MCP/Cursor): Run
npx -y @pr402/mcp-serveror install the SDKnpm i @pr402/client. - Exact Payments Guide: Read the Buyer Exact Quickstart.
- Escrow Payments Guide: Read the Buyer Escrow Integration Guide.
Agent Skills (skills.sh)
Install pr402 integrator skills into Cursor, Claude Code, Copilot, and other agents:
npx skills add miraland-labs/x402-agent-skills --skill pr402 --skill pr402-seller --skill pr402-buyer -y
npx skills add miraland-labs/x402-agent-skills --skill pr402
npx skills add miraland-labs/x402-agent-skills --skill pr402-seller
npx skills add miraland-labs/x402-agent-skills --skill pr402-buyerSkills source: miraland-labs/x402-agent-skills (public). Hub mirror: skills/pr402, skills/pr402-seller, and skills/pr402-buyer. See .cursor/skills/INTEGRATOR_SKILLS.md. Starter code remains in x402-seller-starter and x402-buyer-starter.
You want to build or host a verification oracle for conditional sla-escrow payments.
- Get Started: Follow the step-by-step Oracle Developer Guide.
- Reference Workspace: Explore the oracles folder containing the shared library and three reference oracle crates.
You want to inspect, deploy, or extend the core settlement contracts.
- Core Engines: Read the specifications for UniversalSettle (SplitVault) and SLA-Escrow.
- Facilitator Gateway: Inspect the pr402 Facilitator REST-to-Solana gateway.
| Pillar | Role | Type | Description |
|---|---|---|---|
| pr402 Facilitator | REST-to-Solana Gateway | Rust/Vercel | Handles vault discovery, transaction building, and settlement verification. |
| UniversalSettle | Payout Engine (exact rail) |
On-chain Program | Facilitates high-velocity payouts and automated revenue splitting. |
| SLA-Escrow | Escrow Enforcer (sla-escrow rail) |
On-chain Program | Holds funds in escrow until delivery is verified by a trusted oracle. |
| Oracles Workspace | Adjudication Engine | Rust Workspace | Houses reference oracles (API Quality, Transfer, File Delivery) and specs. |
- Architecture Overview — Core design principles, transaction lifecycles, and security invariants.
- Subscription Pattern — Blueprint for mapping recurring subscriptions (hourly/daily/monthly) to the
exactrail. - Ecosystem Pitch — Detailed rationale behind the x402 protocol and agentic economy.
Maintained by: Miraland Labs
Repository Hub: github.com/miraland-labs/x402