cd /news/artificial-intelligence/show-hn-i-built-an-m2m-payment-loop-… · home topics artificial-intelligence article
[ARTICLE · art-100977] src=github.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Show HN: I built an M2M payment loop where AI Agents pay for data via x402

A developer has built a machine-to-machine (M2M) payment loop where AI agents pay for data via the x402 v2 protocol, successfully completing a 0.005 USDC transaction on the Base blockchain (Chain ID 8453) for China's National Bureau of Statistics GDP data. The API server at api.060504.shop offers 96 assets and 8 MCP tools, with endpoints priced from $0.003 to $9.99 USDC, and the settled transaction is recorded in block #49848412. The system uses EIP-3009 gasless transfer authorization, enabling AI agents to autonomously purchase data without human intervention.

read3 min views3 publishedAug 18, 2026
Show HN: I built an M2M payment loop where AI Agents pay for data via x402
Image: Michielbdejong (auto-discovered)

AI Agent 链上签名支付 0.005 USDC,后端验证结算,国家统计局 GDP 数据交付完成。M2M (Machine to Machine) 微支付商业闭环已落地跑通。

Item Value
API Base https://api.060504.shop
Payment Protocol x402 v2 (EIP-3009, USDC on Base)
Wallet 0x1630c8E0833c367F39f0ca909b6b67f5159d7A00
Chain Base (Chain ID 8453)
Settled TX Block #49848412, 0.005 USDC
Assets 96
MCP Tools 8 (4 free + 3 paid + 1 payment)
API Paths 12
Endpoint Method Price Description
/health
GET Free Health check
/openapi.json
GET Free OpenAPI spec (12 paths)
/catalog.json
GET Free 96 assets catalog
/llms.txt
GET Free LLM-readable API docs
/.well-known/mcp/server-card.json
GET Free MCP server identity card
/v1/api/industry
POST $0.005 USDC China NBS statistics (GDP, CPI, PPI)
/v1/api/policy
POST $0.005 USDC China government policy search
/v1/api/company
POST $0.003 USDC China enterprise credit info
/v1/fetch/dynamic
POST $0.008 USDC Dynamic web content fetch
/v1/assets/{id}
GET $0.01-$9.99 USDC Asset delivery
1. Agent calls POST /v1/api/industry (no payment header)
2. Server returns 402 Payment Required (x402 v2 challenge)
   - x402Version: 2
   - paymentRequirements: {scheme, network, asset, payTo, maxAmountRequired, ...}
3. Agent signs EIP-3009 TransferWithAuthorization (no gas needed)
4. Agent retries with X-Payment header
5. Server verifies signature → settles on-chain → returns 200 + data
6. On-chain: 0.005 USDC transferred to wallet

Transaction Hash:0xef8d49e88cb58651e9bf30465597b50863dcc363f6e1f227779292149818ae28

Method: Transfer With Authorization (EIP-3009, gasless)** Amount**: 0.005 USDC** Block**: #49848412** Token**: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

)From:0xc4217BD72b4dea480ed4879fcec530d92637C800

Recipient:0x1630c8E0833c367F39f0ca909b6b67f5159d7A00

Scheme: EIP-3009 (gasless transfer authorization)

Verify on Basescan (Base Mainnet):

Transaction: https://basescan.org/tx/0xef8d49e88cb58651e9bf30465597b50863dcc363f6e1f227779292149818ae28
Wallet: https://basescan.org/address/0x1630c8E0833c367F39f0ca909b6b67f5159d7A00

MCP Server provides 8 tools for AI agents:

discover_capabilities

  • List all API endpointsdiscover_china_data_apis

  • List China Data APIs with pricingget_capability_info

  • Get details for specific capabilityget_payment_instructions

  • Step-by-step x402 payment guide

query_industry_statistics

($0.005) - NBS statisticssearch_china_policies

($0.005) - Government policy searchquery_company_credit

($0.003) - Enterprise credit info

purchase_capability

  • Initiate x402 payment for any endpoint
curl https://api.060504.shop/health
curl https://api.060504.shop/openapi.json
curl https://api.060504.shop/llms.txt

curl -X POST https://api.060504.shop/v1/api/industry \
  -H "Content-Type: application/json" \
  -d '{"keyword":"GDP"}'

python examples/agent_client.py
API Source Compliance
Industry data.stats.gov.cn Rate limited 3s/req, respects robots.txt
Policy sousuo.
AI Agent / User
    │
    ├── GitHub Pages (frontend catalog)
    │
    └── API Server (api.060504.shop)
            │
            ├── China Data APIs (3 endpoints)
            ├── x402 Payment (USDC on Base, EIP-3009)
            └── MCP Server (8 tools)

Backend: FastAPI + Uvicorn (Python)** Service**: Windows NSSM (NETWORK SERVICE account)** Payment**: x402 v2 protocol, USDC on Base** MCP**: Model Context Protocol (SSE & stdio)** Frontend**: GitHub Pages** Data**: Chinese government public platforms

  • v1.0 (2026-08-07): Initial deployment, 76 assets
  • v2.0 (2026-08-16): 5 new guides, cleanup, 94 assets
  • v3.0 (2026-08-16): China Data APIs + MCP Server, 96 assets
  • v3.1 (2026-08-17): x402 end-to-end payment verified, 0.005 USDC settled

Commercial. All data sourced from public government platforms.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @x402 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-i-built-an-m…] indexed:0 read:3min 2026-08-18 ·