Skip to content

monad-developers/x402-workshop

Repository files navigation

Monad x402 Workshop

A workshop and demo site for x402, an open payment protocol that enables instant, automatic stablecoin payments directly over HTTP.

What is x402?

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.

How it works

  1. Client requests a resource from the server
  2. Server responds with 402 Payment Required and payment instructions
  3. Client constructs and sends a payment payload via the PAYMENT-SIGNATURE header
  4. Server verifies payment via the facilitator and returns the requested resource

Features

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

Getting Started

Prerequisites

  • Node.js 18+
  • A wallet with Monad Testnet USDC (for the demo)

Installation

npm install

Development

npm run dev

Open http://localhost:3000 to view the site.

Environment Variables

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=

Resources

Tech Stack

License

MIT

About

x402 workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published