SolWave - AI-Powered Payments for the Autonomous Web. Complete platform for AI-powered payments on Solana using x402 payment protocol, Google Agent Development Kit (ADK), and autonomous agents.
solwave-x402-adk is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on agent-commerce, ai-agents, autonomous-agents, blockchain. It currently has 1 GitHub stars and 1 forks, and sits alongside related tools like piprail, magpie-x402, awesome-agent-economy, awesome-agent-economy, clicks-protocol, x402-pay.
Complete x402 (Solana) payment protocol implementation for API monetization
https://github.com/user-attachments/assets/7973183b-c5b5-4ed4-9955-e72599414630
Built for the Solana X402 Hackathon 🏆
Features • Architecture • Quick Start • Documentation • Contributing
MicroAPI Hub is a complete end-to-end implementation of the x402 payment protocol for Solana, enabling API providers to monetize their endpoints with blockchain payments. This project demonstrates how to build a production-ready payment system that integrates seamlessly with Solana's blockchain.
x402 is an open payment standard that enables clients to pay for external resources (APIs, content, data) using blockchain payments. It follows HTTP status code 402 (Payment Required) semantics and provides a standardized way to implement pay-per-use APIs with on-chain settlement and verifiable receipts.
.well-known/x402 protocol complianceThe following Mermaid diagram shows the end-to-end x402 payment flow across swimlanes for Client, Provider, Facilitator, and Solana:
sequenceDiagram
autonumber
box Client
participant C as Client (Web UI / Agent)
end
box Provider API
participant P as Provider API (x402 Guard)
end
box Facilitator
participant F as Facilitator (Verify & Settle)
end
box Solana
participant S as Solana Network
end
C->>P: 1) GET /api/data (no X-PAYMENT)
P-->>C: 2) 402 Payment Required + PaymentRequirements
note over C: Create x402 Payment Header<br/>- Secure nonce<br/>- Time window<br/>- Authorization payload
C->>P: 3) GET /api/data with X-PAYMENT
P->>F: 4) POST /verify { paymentHeader, requirements }
F-->>P: 5) { isValid: true }
P->>F: 6) POST /settle { paymentHeader, requirements }
F->>S: 7) Submit transaction (native/SPL)
S-->>F: 8) Confirmed (tx hash)
F-->>P: 9) { success: true, txHash }
P-->>C: 10) 200 OK + X-PAYMENT-RESPONSE (txHash)
Alternatively, here is a swimlane-style activity view using Mermaid flowchart subgraphs (lanes):
flowchart LR
subgraph L1[Client]
A[Request /api/data] --> B[Receive 402 + Requirements]
B --> C[Create X-PAYMENT header]
C --> D[Call /api/data with header]
end
subgraph L2[Provider]
D --> E[Verify with Facilitator]
E --> G[Settle with Facilitator]
G --> H[Return 200 + X-PAYMENT-RESPONSE]
end
subgraph L3[Facilitator]
E --> F[Verify Authorization]
G --> I[Build & Submit Transaction]
end
subgraph L4[Solana]
I --> J[Confirm Transaction]
end
J --> H
┌─────────┐ ┌──────────┐ ┌─────────────┐ ┌──────────┐
│ Client │ │ Provider │ │ Facilitator │ │ Solana │
└────┬────┘ └────┬─────┘ └──────┬──────┘ └────┬─────┘
│ │ │ │
│ 1. GET /api/data │ │ │
├──────────────────►│ │ │
│ │ │ │
│ 2. 402 Payment │ │ │
│ Required │ │ │
│ + Requirements │ │ │
│◄──────────────────┤ │ │
│ │ │ │
│ 3. Create Payment │ │ │
│ Authorization │ │ │
│ (with nonce) │ │ │
│ │ │ │
│ 4. POST /api/data │ │ │
│ + X-PAYMENT │ │ │
│ header │ │ │
├──────────────────►│ │ │
│ │ │ │
│ │ 5. POST /verify │ │
│ ├──────────────────────►│ │
│ │ │ │
│ │ 6. Verify Response │ │
│ │ {isValid: true} │ │
│ │◄──────────────────────┤ │
│ │ │ │
│ │ 7. POST /settle │ │
│ ├──────────────────────►│ │
│ │ │ │
│ │ │ 8. Create Transaction│
│ │ ├─────────────────────►│
│ │ │ │
│ │ │ 9. Transaction Hash │
│ │ │◄─────────────────────┤
│ │ │ │
│ │ 10. Settlement Resp │ │
│ │ {success: true, │ │
│ │ txHash: "..."} │ │
│ │◄──────────────────────┤ │
│ │ │ │
│ 11. 200 OK │ │ │
│ + X-PAYMENT- │ │ │
│ RESPONSE │ │ │
│◄──────────────────┤ │ │
│ │ │ │
┌─────────────────────────────────────────────────────────────┐
│ Web UI (Next.js) │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Wallet │ │ Payment │ │ Resource │ │
│ │ Provider │ │ Modal │ │ Card │ │
│ │ │ │ │ │ │ │
│ │ • Connect │ │ • Show │ │ • Display │ │
│ │ • Sign │ │ Amount │ │ Info │ │
│ │ • State │ │ • Execute │ │ • Trigger │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
│
│ HTTP
▼
┌─────────────────────────────────────────────────────────────┐
│ Provider API Service │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ x402 Guard Middleware │ │
│ │ │ │
│ │ 1. Check X-PAYMENT header │ │
│ │ 2. If missing → Return 402 │ │
│ │ 3. If present → Verify with Facilitator │ │
│ │ 4. If valid → Settle with Facilitator │ │
│ │ 5. If settled → Allow request to proceed │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ │ POST /verify, /settle │
│ ▼ │
└─────────────────────────────────────────────────────────────┘
│
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Facilitator Service │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Verification Engine │ │
│ │ │ │
│ │ • Parse payment header │ │
│ │ • Validate signature │ │
│ │ • Check nonce (replay protection) │ │
│ │ • Validate time window │ │
│ │ • Verify amount & recipient │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Settlement Engine │ │
│ │ │ │
│ │ • Create Solana transaction │ │
│ │ • Sign with fee payer │ │
│ │ • Submit to blockchain │ │
│ │ • Wait for confirmation │ │
│ │ • Return transaction hash │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ │ RPC │
│ ▼ │
└─────────────────────────────────────────────────────────────┘
│
│
▼
┌──────────────┐
│ Solana │
│ Blockchain │
└──────────────┘
# Clone the repository
git clone https://github.com/yourusername/microapi-hub.git
cd microapi-hub
# Install dependencies
npm install --workspaces
cd services/facilitator
# Create .env file
cat > .env << EOF
PORT=8787
NETWORK=devnet
RPC_URL=https://api.devnet.solana.com
FEE_PAYER_SECRET= # Optional: base58-encoded keypair
SETTLEMENT_MODE=native
DEMO_MODE=true
EOF
# Start facilitator
npm run dev
cd services/provider-api
# Create .env file
cat > .env << EOF
PORT=8080
PAY_TO_PUBKEY=YOUR_SOLANA_PUBKEY
USDC_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
FACILITATOR_URL=http://localhost:8787
EOF
# Start provider API
npm run dev
cd clients/web
# Create .env.local file
cat > .env.local << EOF
NEXT_PUBLIC_PROVIDER_DISCOVERY_URL=http://localhost:8080/.well-known/x402
EOF
# Start web UI
npm run dev
Payment verification and on-chain settlement service.
Endpoints:
POST /verify - Verify payment authorizationPOST /settle - Settle payment on-chainGET /health - Health checkGET /supported - Supported payment schemesKey Features:
API server with x402 payment protection.
Endpoints:
GET /api/data - Protected endpoint (example)GET /.well-known/x402 - Discovery endpointGET /health - Health checkKey Features:
Next.js application with wallet integration.
Features:
microapi-hub/
├── services/
│ ├── facilitator/ # Payment verification & settlement
│ │ ├── src/
│ │ │ ├── index.ts # Main facilitator service
│ │ │ ├── config.ts # Configuration management
│ │ │ ├── errors.ts # Error handling
│ │ │ └── registry.ts # Registry client
│ │ └── package.json
│ └── provider-api/ # Protected API server
│ ├── src/
│ │ ├── index.ts # Main provider service
│ │ └── config.ts # Configuration
│ └── package.json
├── clients/
│ ├── web/ # Next.js web UI
│ │ ├── app/ # Next.js app router
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities
│ │ └── package.json
│ └── agent-demo/ # Example client
├── contracts/
│ └── registry/ # Solana Anchor program
│ └── programs/
│ └── registry/
│ └── src/
│ └── lib.rs # Registry contract
├── shared/
│ └── types/ # Shared TypeScript types
│ ├── x402.ts # x402 protocol types
│ ├── errors.ts # Error types
│ └── registry.ts # Registry types
├── docs/ # Documentation
│ ├── API.md
│ └── DEVELOPER.md
├── infra/ # Infrastructure
│ └── docker-compose.yml
└── x402/ # x402 protocol library
# Run all tests
npm test
# Run E2E tests
npm run e2e
# Build all services
npm run build
# Start all services with Docker Compose
cd infra
docker-compose up
✅ x402 Protocol Integration: Full specification implementation
✅ Solana Integration: Deployed to devnet, mainnet-ready
✅ Open Source: All code on GitHub
✅ Demo Video: 3-minute demonstration
✅ Documentation: Comprehensive setup and usage guides
See HACKATHON.md for demo video script and submission details.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is open source. See LICENSE file for details.
/docs directoryBuilt with ❤️ for the Solana X402 Hackathon
x402 (HTTP 402 Payment Required) SDK + MCP server: let any API charge for itself and any AI agent pay for itself, USDC & stablecoins across EVM, Solana & 8 more chain families, in a couple of lines. Backendless, no fee, self-custodial, paid straight to your wallet. TypeScript, MIT.
Collateral that can still sell itself — Magpie's x402 agent API: borrow SOL programmatically on Solana.
Explore and connect projects enabling AI agents to earn, trade, verify identity, and build reputation in the agent economy ecosystem.
A curated list of projects, protocols, and platforms powering the AI agent economy
Agent commerce settlement router for AI agents on Base. Split USDC into liquid working capital and routed yield.
Open-source x402 payment processor for AI agents. Sub-400ms settlement on Solana + 7 EVM chains. Let LLMs pay for APIs programmatically with USDC. npm: nory-x402
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
The first agentic payment network: policy-controlled, gasless, and real money-ready. OmniClaw CLI + Financial Policy Engine let autonomous agents pay and earn safely at machine speed.
Multi-Agent AI Task Orchestrator 2026
Autonomous AI BD Agent for SolCex Exchange: 24/7 Cross-Chain Token Scoring & Payments 2026