Stellar x402 Ecosystem
Complete Stellar implementation of the x402 payment protocol.
"1 line of code to accept digital dollars on Stellar. No fees, 2-second settlement, $0.001 minimum payment."
What is x402?
The x402 payment protocol is an open standard for internet-native payments that leverages the existing 402 Payment Required HTTP status code. It enables:
- •Chain-agnostic payments - Works across different blockchains
- •Gasless for clients - Facilitators can sponsor transaction fees
- •Minimal integration - 1 line for servers, 1 function for clients
- •Low minimums - Support for micropayments ($0.001+)
- •Fast settlement - 2-5 second confirmation times
What Makes Stellar x402 Different?
This implementation brings x402 to the Stellar network, offering unique advantages:
🚀 Ultra-Fast Settlement
- • 2-5 second confirmation - Near-instant finality
- • Ledger-based expiry - More precise than timestamps
- • No gas wars - Fixed, predictable fees
💰 True Gasless Payments
- • Fee sponsorship - Via fee-bump transactions
- • Trust-minimized - Client signatures preserved
- • Flexible - Works with or without sponsorship
🔐 Native Stellar Features
- • XDR format - Native transaction serialization
- • Replay protection - Protocol-level sequence numbers
- • Native XLM - No token contracts needed
- • Soroban ready - Support for smart contracts
🌐 Browser-First
- • Freighter integration - Seamless signing
- • Beautiful UI - Pre-built paywalls
- • No RPC needed - Client-side simplicity
Key Features
🔒 Security
- • Trust-minimized architecture
- • Redis-backed replay protection
- • Idempotency & caching
- • Full Zod validation
⚡ Performance
- • 2-5 second settlement
- • Optional fee sponsorship
- • Efficient verification
- • Response buffering
🎨 Experience
- • TypeScript first
- • Modular packages
- • Pre-built paywall UI
- • Comprehensive examples
🌍 Ecosystem
- • Freighter wallet integration
- • Express middleware
- • Fetch wrapper
- • Discovery API
Comparison with Other x402 Implementations
| Feature | EVM (Coinbase) | Stellar (Ours) |
|---|---|---|
| Transaction Format | Signature-based | XDR (signed transaction) |
| Fee Sponsorship | Meta-transactions | Fee-bump transactions |
| Settlement Time | ~12 seconds | 2-5 seconds |
| Expiry Mechanism | Timestamp (validBefore) | Ledger sequence |
| Native Asset | Requires ERC-20 | Native XLM |
| Replay Protection | Nonce-based | Sequence numbers |
| Browser Wallet | MetaMask | Freighter |
Network Support
- Stellar Testnet (
stellar-testnet) - 🚧Stellar Mainnet (
stellar-mainnet) - Coming soon
Packages
| Package | Description | Use Case |
|---|---|---|
| x402-stellar | Core library with types, schemas, and facilitator client | Building custom integrations |
| x402-stellar-client | Client SDK for signing payments (Keypair + Freighter) | Client applications |
| x402-stellar-fetch | Fetch wrapper that auto-pays 402 responses | Simple client integrations |
| x402-stellar-express | Express middleware for protecting routes | Node.js/Express servers |
| facilitator | Stellar x402 facilitator server | Payment verification & settlement |
Roadmap
See ROADMAP.md for our development plans.
Upcoming
- Mainnet support
- Additional client SDKs
- More example integrations
Contributing & License
Contributions are welcome! This project is open source under the MIT License.
Built with ❤️ for the Stellar ecosystem.
