x402 Payment Channels
Payment Channels Protocol for Solana
Watch Our Pitch
See x402 in action - a complete walkthrough of our payment channels solution
Project Overview
BoberPay brings HTTP 402 Payment Required to life with Solana payment channels. Our protocol enables micropayments for API requests with 99.8% cost savings compared to solana transaction, making true pay-per-use APIs economically viable.
Built for developers, BoberPay provides framework-agnostic TypeScript SDKs that integrate seamlessly with Express, NestJS, Fastify, and any Node.js HTTP framework.
The Problem This Solves
Traditional On-Chain Payments (scheme: 'exact')
Every API call → Blockchain transaction → 400-800ms latency → $0.0005 fee
❌ Too slow for real-time APIs
❌ Too expensive for sub-cent payments
❌ Can't scale to 100+ requests/minutePayment Channels Solution (scheme: 'channel')
Setup: 1 on-chain transaction (open channel)
Usage: Unlimited off-chain payments → <10ms latency → $0 fees
Settle: 1 on-chain transaction (claim batch)
✅ 91% faster than on-chain
✅ 94% cheaper overall
✅ Scales to thousands of req/minOur Solution
Payment Channels
Adapting x402 to accept unidirectional payment channels.
Developer-First
Simple middleware integration with full TypeScript support. Add payment protection to any route in 3 lines of code.
Framework Agnostic
Works with Express, NestJS, Fastify, and any Node.js framework. No vendor lock-in.
Technical Implementation
Solana Program (Rust + Anchor)
Custom Solana program managing payment channel accounts, state transitions, and settlement logic with cryptographic verification.
TypeScript SDKs
Server SDK with middleware for Express/NestJS/Fastify. Client SDK for making paid requests with automatic channel management.
Off-Chain Payment Proofs
HTTP headers carry Ed25519-signed payment proofs with nonce-based replay protection. Verified in <1ms without blockchain transactions.
Channel State Machine
Robust state management handling Open, Closing, Closed, and Disputed states with automatic reconciliation and timeout protection.
Key Achievements
Use Cases
AI/ML API Services
Charge per inference for LLM APIs, image generation, or model predictions. Fair pricing based on actual usage without monthly minimums.
Data APIs
Real-time financial data, weather information, or analytics APIs with per-request pricing. Pay only for the data you need.
Compute-as-a-Service
On-demand computation, rendering services, or code execution. Dynamic pricing based on computational complexity.
Content APIs
Premium content access, research papers, or media streaming. Micropayments enable article-by-article or minute-by-minute pricing.
Project Links
x402 Devkit Repository
github.com/x402-solana-toolkitSolana Payment Channel Repository
github.com/x402-solana-toolkitDocumentation
Full documentation and guidesNPM Organization
npmjs.com/org/x402-solanaTry x402 Today
Start accepting micropayments in your APIs with just a few lines of code