A full end-to-end demo of agentic commerce on Arc blockchain.
An AI agent discovers paywalled content, pays 0.01 USDC via x402, and receives it β autonomously, on-chain, no human approval. The merchant dashboard updates in real time as payments land.
π 2nd Place β Agentic Commerce on Arc Hackathon (January 2026) π Live demo: https://arc-merchant-production.up.railway.app π Roadmap: ROADMAP.md
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Agent (e.g., Claude Code) β
β with Circle wallet + MCP tools β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β x402 payment ($0.01 USDC)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Arc Merchant β
β βββββββββββββββββββββββ ββββββββββββββββββββββββββββββ β
β β x402 Paywall API βββββΆβ Merchant Dashboard β β
β β /api/article/:slug β β - Real-time payments β β
β βββββββββββββββββββββββ β - Revenue tracking β β
β β - On-chain balance β β
β ββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Arc Blockchain β
β USDC settlement β’ Circle Wallets β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The buyer side (your chosen autonomous AI agent framework) manages wallets and signs x402 payments.
The seller side (next.js) provides paywalled content endpoints and a real-time dashboard showing payments as they arrive.
- Content behind x402 paywall β Articles at
/api/article/:slugrequire payment - AI agent requests content β Gets HTTP 402 Payment Required with price
- Agent pays via Circle wallet β Signs x402 payment, sends USDC
- Facilitator server settles on-chain β Verifies signature, submits to Arc L1
- Content delivered β Agent receives the article
- Dashboard updates β Merchant sees payment in real-time, can track receipts, sales, autonomous treasury, etc
This project contains both sides of the x402 payment flow:
The src/tools/ SDK lets AI agents manage wallets and pay for content:
src/tools/core.ts β Tool definitions (Zod + execute functions)
src/tools/adapters/ β MCP, SDK adapters
src/servers/mcp.ts β MCP server for Claude Code
The facilitator settles payments on-chain when agents pay for your content:
src/servers/facilitator.ts β Receives signed payments, settles on Arc blockchain
src/app/api/article/ β x402-protected content endpoints
src/app/page.tsx β Merchant dashboard
Use this if: You're a merchant accepting x402 payments for content.
The facilitator is required β it's what actually moves USDC on-chain. Think of it like your own payment processor.
npm installCopy .env.local.example to .env.local and fill in:
# Circle API credentials (https://console.circle.com)
CIRCLE_API_KEY=
CIRCLE_ENTITY_SECRET=
# Facilitator wallet (create via arc_create_wallet, then add ID here)
CIRCLE_FACILITATOR_WALLET_ID=
# Google AI (for Vercel AI SDK with Gemini)
GOOGLE_GENERATIVE_AI_API_KEY=
# Google AI (for @google/genai SDK)
GEMINI_API_KEY=npm run setup-circleThis generates and registers your Entity Secret with Circle (updates CIRCLE_ENTITY_SECRET).
Create a Circle wallet to use as your facilitator (settles payments on-chain):
npm run wallet createThis outputs a wallet ID. Add it to .env.local:
CIRCLE_FACILITATOR_WALLET_ID=<your-wallet-id># Terminal 1: Facilitator (settles payments)
npm run facilitator
# Terminal 2: Next.js (dashboard + paywalled API server)
npm run devOpen http://localhost:3000 to see the merchant dashboard.
In Claude Code with the arc-agent-payments MCP server:
"Pay for http://localhost:3000/api/article/arc-blockchain-guide"
Watch the dashboard update in real-time.
arc-merchant/
βββ src/tools/ # Framework-agnostic AI tools (SDK core)
β βββ core.ts # Tool definitions (Zod schemas + execute)
β βββ adapters/
β βββ mcp.ts # MCP adapter (Claude Code)
β βββ vercel.ts # Vercel AI SDK adapter
β βββ google-genai.ts # Google GenAI SDK adapter
βββ src/app/
β βββ page.tsx # Merchant dashboard
β βββ api/
β βββ article/[slug]/ # x402-protected content
β βββ stats/ # Dashboard data
βββ src/lib/
β βββ arc.ts # Arc chain config
β βββ circle-wallet.ts # Circle SDK
β βββ x402.ts # x402 facilitator
β βββ stats.ts # Payment tracking
βββ src/servers/
β βββ facilitator.ts # Payment settlement server
β βββ mcp.ts # MCP server for AI agents
βββ src/agents/
β βββ vercel-agent.ts # AI agent using Vercel AI SDK
β βββ google-agent.ts # AI agent using Google GenAI SDK (Gemini 3)
βββ scripts/
βββ setup-circle-entity.ts # Circle entity secret setup
βββ wallet-cli.ts # Wallet management CLI
βββ agent-vercel-demo.ts # Demo: Vercel AI SDK agent
βββ agent-google-demo.ts # Demo: Google GenAI agent
Manage Circle wallets without AI:
npm run wallet create # Create a new wallet
npm run wallet list # List all wallets
npm run wallet balance <id> # Get wallet balance
npm run wallet fund <address> # Request testnet tokensFramework-agnostic tools for AI agents to manage Circle wallets and pay for content via x402.
| Tool | Description |
|---|---|
arc_list_wallets |
List all Circle wallets |
arc_get_wallet |
Get details for a specific wallet |
arc_create_wallet |
Create a new Circle wallet |
arc_get_balance |
Check USDC/EURC balances |
arc_pay_for_content |
Pay for x402 paywalled content |
arc_transfer |
Direct USDC transfer |
arc_request_testnet_tokens |
Fund wallet from Circle faucet |
arc_get_transaction |
Get transaction details |
claude mcp add arc-mcp-server -- npm run mcpThe core tools are framework-agnostic. Import from src/tools/core.ts and create your own adapter:
import { arcTools } from './src/tools/core';
// Each tool has: name, description, inputSchema (Zod), execute (async function)
const result = await arcTools.arc_list_wallets.execute({});Two ready-to-use agents for autonomous payments:
Uses Google's official @google/genai SDK with the latest gemini-3-flash-preview model:
npm run agent:google "Pay for http://localhost:3000/api/article/arc-blockchain-guide"import { runGoogleAgent } from './src/agents/google-agent';
const result = await runGoogleAgent("List my wallets and pay for the article");
console.log(result.text);Uses Vercel AI SDK (works with Gemini, OpenAI, Anthropic, etc.):
npm run agent:vercel "Check my wallet balance"import { runAgent } from './src/agents/vercel-agent';
import { openai } from '@ai-sdk/openai';
// Default: Gemini 2.5 Flash
const result = await runAgent("Pay for the article");
// Or use any Vercel AI SDK model
const result = await runAgent("Pay for the article", {
model: openai('gpt-4o')
});- Arc β Circle's L1 blockchain with native USDC gas
- Circle Developer-Controlled Wallets β Secure wallet infrastructure
- x402 β Web-native micropayment protocol (HTTP 402)
- Zod β Schema validation (with native JSON Schema conversion for MCP)
- Next.js β Dashboard and API
- Vercel AI SDK β Model-agnostic (Gemini, OpenAI, Anthropic, etc.)
- MCP β Model Context Protocol for Claude Code integration
- USDC β Stablecoin payments
Built for the Agentic Commerce on Arc Hackathon (January 2026)