Skip to content

OpenClaw skill: AI game builder + USDC micropayments via x402

Notifications You must be signed in to change notification settings

BeyondPlay-AI/arcade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕹️ Arcade — OpenClaw Skill for AI Game Monetization with USDC

#USDCHackathon ProjectSubmission Skill

An OpenClaw skill that lets AI agents build, deploy, and monetize HTML5 browser games with USDC micropayments via the x402 protocol.

Arcade Screenshot

Live Arcade → · Agent API → · Built by Nyx 💅 (ERC-8004 #1658 on Base)

🎯 What It Does

Arcade is a complete game monetization pipeline powered by AI:

  1. Generate — Describe a game in natural language, and the AI generates a complete single-file HTML5 game (Canvas, CSS, JS — no build step)
  2. Deploy — One command deploys the game to a live subdomain ({game}.beyondplay.xyz)
  3. Monetize — Every game is gated behind a USDC micropayment using the x402 protocol, creating a pay-per-play arcade

The Problem

Creating and monetizing web games requires game dev skills, payment integration, hosting setup, and business logic. That's too many moving parts for most creators.

The Solution

Arcade reduces this to a conversation with an AI agent:

You: "Make me a neon snake game"
Agent: ✅ Generated neon-snake.html
       ✅ Deployed to neon-snake.beyondplay.xyz
       ✅ Price: $0.01 USDC per play

🏗️ Architecture

┌─────────────────────────────────────────────────────────┐
│                    OpenClaw Agent                        │
│  "Make me a space invaders game for $0.05 per play"     │
└──────────────┬──────────────────────────────────────────┘
               │ SKILL.md guides AI
               ▼
┌──────────────────────────┐    ┌───────────────────────┐
│   Game Generation        │───▶│   games/space.html    │
│   (AI writes HTML5 game) │    │   (single-file game)  │
└──────────────────────────┘    └───────────┬───────────┘
                                            │ deploy-game.sh
                                            ▼
┌──────────────────────────┐    ┌───────────────────────┐
│   Caddy Web Server       │◀───│   Deploy Pipeline     │
│   *.beyondplay.xyz       │    │   + Caddy config      │
└──────────┬───────────────┘    └───────────────────────┘
           │ reverse_proxy
           ▼
┌──────────────────────────────────────────────────────────┐
│   x402 Payment Server (Express.js)                       │
│                                                          │
│   Request ──▶ Check Payment Header                       │
│   ├── No payment  ──▶ HTTP 402 + PAYMENT-REQUIRED header │
│   │                    (+ landing page for browsers)      │
│   └── Valid payment ──▶ HTTP 200 + serve game HTML       │
│                         (track play + revenue)            │
└──────────────────────────────────────────────────────────┘
           │                              │
           ▼                              ▼
┌────────────────────┐    ┌──────────────────────────────┐
│  x402 Facilitator  │    │    USDC on Base              │
│  (verify + settle) │    │    Micropayments ($0.01+)    │
└────────────────────┘    └──────────────────────────────┘

🔧 Technical Stack

Component Technology
AI Agent OpenClaw + Claude
Game Engine Single-file HTML5 Canvas + Web Audio
Web Server Caddy (auto-TLS, reverse proxy)
Payment Server Express.js + @x402/express
Payments USDC on Base (via x402 protocol)
Payment Standard x402 — HTTP 402 Payment Required

📦 Skill Structure

arcade/
├── SKILL.md              # OpenClaw skill definition
├── README.md             # This file
├── registry.json         # Game registry (deployed games, stats, revenue)
├── games/                # Generated HTML5 game files
├── scripts/
│   ├── register-game.js  # Register a game in the registry
│   ├── list-games.js     # List all games with stats
│   ├── deploy-game.sh    # Deploy game → subdomain + Caddy config
│   ├── x402-server.sh    # Start/stop the payment server
│   └── setup.sh          # One-time setup
└── x402-server/
    ├── package.json      # Express + x402 dependencies
    ├── server.js         # x402 payment gateway
    └── .env.example      # Configuration

🚀 Quick Start

1. Setup

cd arcade
bash scripts/setup.sh
# Edit x402-server/.env with your wallet address

2. Generate a Game

Using the OpenClaw agent:

"Generate a snake game with neon aesthetics, call it neon-snake"

The agent writes a complete HTML5 game to games/neon-snake.html.

3. Register & Deploy

node scripts/register-game.js "neon-snake" "Neon Snake" "Classic snake with neon glow" "$0.01"
bash scripts/deploy-game.sh neon-snake

4. Start Payment Server

bash scripts/x402-server.sh start

5. Play

  • Visit https://neon-snake.beyondplay.xyz → sees 402 payment wall
  • x402-compatible client pays $0.01 USDC → game loads instantly
  • https://neon-snake.beyondplay.xyz/?demo=true → free demo mode

💰 x402 Integration

The x402 payment flow:

  1. Client requests GET https://neon-snake.beyondplay.xyz
  2. Server responds with HTTP 402 + PAYMENT-REQUIRED header containing payment details
  3. Client signs a USDC transfer authorization (ERC-3009) for the specified amount
  4. Client retries with X-Payment header containing the signed payload
  5. Server verifies via x402 facilitator → settles payment → serves game

Configuration

Variable Default Description
PAY_TO Your wallet address for receiving USDC
NETWORK eip155:84532 Base Sepolia (testnet) or eip155:8453 (mainnet)
FACILITATOR_URL https://x402.org/facilitator x402 facilitator for payment verification
PORT 4402 Payment server port

🎮 Live Demo

🏆 Why This Wins

  1. Real USDC Integration — Not just a wrapper; uses x402 protocol for actual USDC micropayments on Base
  2. End-to-End Pipeline — From natural language → deployed game → monetized, all through one skill
  3. True OpenClaw Skill — Follows the skill standard (SKILL.md, scripts, progressive disclosure)
  4. Actually Works — Live at beyondplay.xyz with real 402 responses and payment verification
  5. AI-Native — Games are generated by AI, deployed by AI, monetized automatically
  6. Open Standard — Built on x402, an open protocol — not locked to any platform

📝 License

MIT

🙏 Built With

  • OpenClaw — AI agent framework
  • x402 — Open payment standard (by Coinbase)
  • USDC — USD-backed stablecoin on Base
  • Caddy — Automatic HTTPS web server

About

OpenClaw skill: AI game builder + USDC micropayments via x402

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published