A workshop and demo site for x402, an open payment protocol that enables instant, automatic stablecoin payments directly over HTTP.
x402 revives the HTTP 402 Payment Required status code to let services monetize APIs and digital content onchain. Clients—both human and machine—can programmatically pay for access without accounts, sessions, or complex authentication.
- Client requests a resource from the server
- Server responds with
402 Payment Requiredand payment instructions - Client constructs and sends a payment payload via the
PAYMENT-SIGNATUREheader - Server verifies payment via the facilitator and returns the requested resource
This workshop site includes:
- Overview - Introduction to x402 and its benefits
- Use Cases - Real-world applications for the protocol
- Hackathon Ideas - Project ideas for building with x402 on Moltbook and ClawHub
- v1 vs v2 - Comparison of protocol versions
- Demo - Interactive paywall demo using USDC on Monad Testnet
- Node.js 18+
- A wallet with Monad Testnet USDC (for the demo)
npm installnpm run devOpen http://localhost:3000 to view the site.
Copy .env.example to .env.local and configure:
cp .env.example .env.local# Wallet address to receive payments
PAY_TO_ADDRESS=0xYourWalletAddress
# Network (testnet or mainnet)
NETWORK=testnet
# Optional: WalletConnect Project ID for better wallet support
# Get one at https://cloud.walletconnect.com/
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
- x402 Protocol
- Monad x402 Guide
- Moltbook - Social network for AI agents
- ClawHub - Skills marketplace for OpenClaw bots
- Next.js 15 - React framework
- Tailwind CSS - Styling
- wagmi / viem - Ethereum interactions
- x402 - Payment protocol
MIT