A movie streaming platform powered by x402 micropayments for secure, instant, and seamless payments. Users can pay and watch movies directly through the x402 payment gateway, while the backend handles API interactions for reliable transaction processing and subscription management on Base.
- Express.js server with x402 payment middleware
- Paywalled endpoints for premium video content
- Secure payment verification
- Integrated with Base Sepolia testnet for easy testing
- Modern UI & Smooth Animations – Professional gradient design
- Responsive Landing Page – Hero section, feature cards, and "How It Works" guide
- Payment Processing Page – Real-time status with animated loader
- Premium Content Page – Clean video player interface with payment confirmation
- Consistent Navigation – Navbar with x402 branding and quick links
- Professional Footer – Social links, navigation, and resources
- Font Awesome Icons – Visual enhancements throughout
- SEO Optimized – Meta tags for OpenGraph & Twitter Cards
- Favicon Support – Custom branding with SVG favicon
- Node.js (v22 or higher)
- A EVM-compatible wallet with Base Sepolia USDC
-
Clone this repository:
git clone https://github.com/dexoryn/x402-micropayments.git cd x402-micropayments -
Install dependencies:
npm install
3.Set environment variables: Rename .env.local to .env and update:
WALLET_ADDRESS=your_ethereum_wallet_address
NODE_ENV=development
PORT=402
-
Get Base Sepolia USDC for testing:
- Visit https://faucet.circle.com/
- Select Base Sepolia and request test USDC
- Request test USDC
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:4021
- The server uses the
x402-expressmiddleware to protect the/authenticateendpoint - Users must complete a payment to access protected content.
- Upon successful payment, users are redirected to /video-content to watch premium videos.
- Video price: Update the
priceparameter inapi/index.js - Video content: Replace the video source in
public/video-content.html - Mainnet deployment: Update the network configuration in
api/index.jsand use proper CDP API keys