x402 is a pay-per-view video streaming platform that uses crypto micropayments. Think of it like paying a few cents to watch a video, but instead of ads or subscriptions, you pay directly with cryptocurrency.
Traditional video monetization sucks:
- Ads: Annoying, invasive, and you're the product
- Subscriptions: Pay monthly even if you watch one video
- Paywalls: All-or-nothing access
With x402, you:
- Connect your wallet (like MetaMask)
- Pay a small fee (typically $0.01-$1 in USDC)
- Watch the video - that's it!
No accounts, no subscriptions, no tracking. Just simple, direct payments.
You → Pay $0.50 → Creator gets $0.50 → You watch video
The magic happens using the x402 protocol - an open standard for HTTP payments. When you request a paid video, the server says "pay me first" (HTTP 402), your wallet signs the payment, and boom - you're watching.
New here? Start with these:
- QUICK_START.md - Get running in 5 minutes
- VIDEO_PAYMENT_FLOW.md - Understand the user experience
Setting up your own instance:
- X402_INTEGRATION_COMPLETE.md - Full technical overview
- RAINBOWKIT_SETUP.md - Wallet connection setup
- reverse_proxy.md - Proxy server configuration
Want to understand the internals:
- SESSION_BASED_PAYMENT.md - How payments create sessions
- X402_IMPLEMENTATION.md - Technical implementation details
- ADDRESS_CHECKSUM_FIX.md - Ethereum address handling
- MIGRATION_SUMMARY.md - Migration notes
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Browser │ ──► │ x402 Proxy │ ──► │ Mux CDN │
│ (Wallet) │ │ (Payments) │ │ (Videos) │
└─────────────┘ └─────────────┘ └─────────────┘
How a video request flows:
- Manifest loads (free) - Video metadata and segment list
- First segment - Server asks for payment (402 response)
- Wallet signs - You approve the USDC payment
- Session created - Cookie stores your access
- Video plays - All segments load using session
| Term | What it means |
|---|---|
| x402 | The payment protocol (HTTP 402 = Payment Required) |
| Segment | A chunk of video (~2-10 seconds each) |
| Session | Your paid access, stored as a cookie |
| USDC | The stablecoin used for payments ($1 = 1 USDC) |
| Base | The Ethereum L2 network we use (fast & cheap) |
✅ Working: Session-based payments, video playback, wallet integration
✅ Tested: Full payment flow on Base Sepolia testnet
⏳ Coming: Production deployment, analytics, creator dashboard