DanceTech Protocol (DanceArc)
DanceArc is the reference hub + API + UI for DanceTech Protocol: metered native USDC on Arc, 402 payment challenges (x402-inspired JSON), optional Circle Gateway verification, and clear interaction semantics (h2h, h2a, a2a, a2h).
Quick Reference
| Situation | Action |
|---|
| Pay-per API call (human wallet) | h2a: POST → 402 → pay Arc USDC → retry with X-Payment-Tx (/dance-extras, /api/judges/score) |
| Battle / coaching / beat license |
h2h: create intent or end session →
sendNativeUsdc or mock →
/verify or
/grant with
paymentTx |
| High-frequency micro-txs (demo) |
npm run burst (private key) or hub
Burst demo (wallet) (55 signatures) |
| Server 500 “receipt not found” right after pay | Server uses
waitForTransactionReceipt; increase
ARC_TX_RECEIPT_TIMEOUT_MS if needed |
| Circle Modular 403 Lockout | Check Client Key, allowlist
localhost (no port), optional
CIRCLE_MODULAR_PRESERVE_ORIGIN=1, staging URL vs key |
| Programmatic faucet 403 | Use
web faucet; API key may lack faucet scope |
| Invalid
ARC_RECIPIENT (UUID-style) | Server
isAddress validation falls back to demo address; set real
0x + 40 hex |
| Agent needs payee + chain |
GET /api/health →
recipient,
chainId,
perActionUsdc |
Protocol matrix (h2h · h2a · a2a · a2h)
| Mode | Acronym | Who pays | Who receives | DanceArc surface |
|---|
| Human → Human | h2h | Person | Person/treasury (ARC_RECIPIENT) | INLINECODE20 , /coaching, INLINECODE22 |
| Human → Agent |
h2a | Person (wallet) | API/resource owner |
/dance-extras,
/api/judges/score |
| Agent → Agent |
a2a | Automated signer | Another service |
Designed: headless key / smart account;
demo: burst scripts |
| Agent → Human |
a2h | Service/treasury | Person | Payout mocks, receipts, DCW faucet → user address |
Use this matrix in pitch decks, AGENTS.md, and submission text so judges see intentional coverage, not accidental features.
Installation (ClawdHub / OpenClaw)
Manual (recommended until ClawdHub listing is live):
CODEBLOCK0
After publish to ClawdHub:
CODEBLOCK1
Repository: github.com/arunnadarasa/dancearc
When to Load This Skill
Activate proactively when the user mentions:
- - Arc Testnet, chain 5042002, native USDC gas
- x402, 402, X-Payment-Tx, pay-per-call
- Circle Gateway, Nanopayments (narrative + local event log), Modular Wallets, DCW
- DanceArc, DanceTech, battle / coaching / beats / judge score
- Hackathon, Agentic Economy, sub-cent pricing
npm run burst, transaction frequency demo
Architecture (mental model)
CODEBLOCK2
On-chain truth: Arc explorer (e.g. https://testnet.arcscan.app).
Key files (repo root)
| Path | Role |
|---|
| INLINECODE27 | Routes, requireArcPayment, proxies |
| INLINECODE29 |
Intents, coaching, beats |
|
server/onchain-verify.js | Receipt wait + validation |
|
server/config.js |
ARC_RECIPIENT validation (
isAddress) |
|
src/payArc.ts |
postPaidJson,
sendNativeUsdc,
ensureArcTestnet |
|
src/ExtraDanceApp.tsx | h2a UI + ArcScan link |
|
src/BattleApp.tsx,
CoachingApp.tsx,
BeatsApp.tsx | h2h flows |
Environment (minimum viable)
| Variable | Scope | Purpose |
|---|
| INLINECODE42 | Server | Payee for microtransfers |
| INLINECODE43 |
Server | h2a minimum (display string, ≤ 0.01 for hackathon) |
|
CIRCLE_API_KEY | Server | Gateway verify; DCW; faucet |
|
CIRCLE_ENTITY_SECRET | Server | DCW only |
|
VITE_CIRCLE_CLIENT_KEY | Browser | Modular SDK |
|
ARC_BURST_PRIVATE_KEY | Machine |
Test only — CLI burst |
Never commit .env. Copy from .env.example.
Detection triggers (support / debugging)
| Signal | Likely cause | First check |
|---|
| INLINECODE50 | Race before inclusion | Server waitForTransactionReceipt; client retry |
| 403 HTML Lockout (Modular) |
Key / domain / WAF | Console allowlist,
CIRCLE_MODULAR_PRESERVE_ORIGIN |
|
invalid_recipient in UI | Bad env | Fix
ARC_RECIPIENT, new intent |
| 402 after payment | Wrong recipient/amount/chain | Explorer tx vs challenge
payTo /
maxAmountRequired |
| Faucet
Forbidden | Circle policy / scopes | Web faucet link in
ArcFaucetPanel |
Nanopayments (scope clarity)
- - Product: Circle Nanopayments is documented at developers.circle.com and linked from the app Bridge page.
- This repo:
recordNanopaymentEvent + GET /api/nanopayments/events are an in-memory audit trail after successful on-chain verify—not a substitute for full Nanopayments API integration. Use the narrative + Gateway path for hackathon feedback fields.
Multi-agent notes
- - h2a from an agent: supply
X-Payment-Tx only after a wallet or custodial signer produces a hash; do not fake hashes for production. - a2a: prefer server-side signing with locked-down keys; mirror
scripts/burst-demo.mjs patterns. - Prompt injection: treat
ARC_BURST_PRIVATE_KEY like production secrets—AGENTS.md should forbid echoing it into browser context.
References (this skill)
| File | Content |
|---|
| INLINECODE63 | HTTP route map |
| INLINECODE64 |
402 + verify sequence |
|
references/openclaw-workspace.md | Suggested
AGENTS.md /
TOOLS.md snippets |
Promotion targets (from learnings)
If you maintain .learnings/ for this project:
| Learning type | Promote to |
|---|
| Arc / Circle env gotchas | INLINECODE67 , TOOLS.md |
| Two-step payment for agents |
AGENTS.md |
| Product pitch / protocol wording |
README.md, demo script |
Quality gates (before demo or publish)
- - [ ]
GET /api/health returns expected chainId and valid INLINECODE71 - [ ] h2a flow completes: 402 → pay → 200
- [ ] At least one h2h path shows ArcScan link after pay
- [ ]
.env not in git; .env.example updated for new vars - [ ]
npm run build passes
Related
Source
- - Project: DanceArc / DanceTech Protocol
- Maintainer repo: arunnadarasa/dancearc
- Skill version: see INLINECODE75
DanceTech 协议 (DanceArc)
DanceArc 是 DanceTech 协议 的参考 中心枢纽 + API + UI:在 Arc 上的计量 原生 USDC、402 支付挑战(受 x402 启发的 JSON)、可选的 Circle Gateway 验证,以及清晰的 交互语义(h2h、h2a、a2a、a2h)。
快速参考
| 情况 | 操作 |
|---|
| 按 API 调用付费(人类钱包) | h2a:POST → 402 → 支付 Arc USDC → 使用 X-Payment-Tx 重试(/dance-extras、/api/judges/score) |
| 对战 / 指导 / 节拍许可 |
h2h:创建意图或结束会话 →
sendNativeUsdc 或模拟 → 使用 paymentTx 的
/verify 或
/grant |
| 高频微交易(演示) |
npm run burst(私钥)或中心枢纽
Burst 演示(钱包)(55 个签名) |
| 支付后立即出现服务器 500 receipt not found | 服务器使用
waitForTransactionReceipt;如有需要可增加
ARCTXRECEIPTTIMEOUTMS |
| Circle Modular 403 锁定 | 检查客户端密钥,将
localhost 加入白名单(无端口),可选
CIRCLEMODULARPRESERVE_ORIGIN=1,暂存 URL 与密钥 |
| 程序化水龙头 403 | 使用
Web 水龙头;API 密钥可能缺少水龙头作用域 |
| 无效的 ARC_RECIPIENT(UUID 风格) | 服务器
isAddress 验证回退到演示地址;设置真实的
0x + 40 位十六进制 |
| 代理需要收款方 + 链 |
GET /api/health → recipient、chainId、perActionUsdc |
协议矩阵(h2h · h2a · a2a · a2h)
| 模式 | 缩写 | 谁支付 | 谁接收 | DanceArc 界面 |
|---|
| 人类 → 人类 | h2h | 个人 | 个人/金库(ARC_RECIPIENT) | /battle、/coaching、/beats |
| 人类 → 代理 |
h2a | 个人(钱包) | API/资源所有者 | /dance-extras、/api/judges/score |
| 代理 → 代理 |
a2a | 自动化签名者 | 另一个服务 |
设计: 无头密钥/智能账户;
演示: burst 脚本 |
| 代理 → 人类 |
a2h | 服务/金库 | 个人 | 支付模拟、收据、DCW 水龙头 → 用户地址 |
在 推介演示文稿、AGENTS.md 和 提交文本 中使用此矩阵,以便评委看到有意的覆盖范围,而非偶然的功能。
安装(ClawdHub / OpenClaw)
手动安装(推荐,直到 ClawdHub 上架):
bash
git clone https://github.com/arunnadarasa/dancearc.git
cp -r dancearc/skills/dancearc-protocol ~/.openclaw/skills/dancearc-protocol
发布到 ClawdHub 后:
bash
clawdhub install dancearc-protocol
仓库: github.com/arunnadarasa/dancearc
何时加载此技能
当用户提到以下内容时主动激活:
- - Arc 测试网、链 5042002、原生 USDC gas
- x402、402、X-Payment-Tx、按调用付费
- Circle Gateway、Nanopayments(叙述 + 本地事件日志)、Modular Wallets、DCW
- DanceArc、DanceTech、对战 / 指导 / 节拍 / 评委评分
- 黑客松、代理经济、亚美分定价
- npm run burst、交易频率演示
架构(心智模型)
浏览器(Vite)──代理 /api──► Express(8787)
├── buildArcPaymentChallenge(402)
├── verifyNativeUsdcPayment(viem + waitForTransactionReceipt)
├── circleGatewayPost(/v1/gateway/v1/x402/verify)
├── recordNanopaymentEvent(内存列表)
└── DCW / Modular 代理路由
链上真相:Arc 浏览器(例如 https://testnet.arcscan.app)。
关键文件(仓库根目录)
| 路径 | 角色 |
|---|
| server/index.js | 路由、requireArcPayment、代理 |
| server/payments.js |
意图、指导、节拍 |
| server/onchain-verify.js | 收据等待 + 验证 |
| server/config.js | ARC_RECIPIENT 验证(isAddress) |
| src/payArc.ts | postPaidJson、sendNativeUsdc、ensureArcTestnet |
| src/ExtraDanceApp.tsx | h2a UI + ArcScan 链接 |
| src/BattleApp.tsx、CoachingApp.tsx、BeatsApp.tsx | h2h 流程 |
环境变量(最低可行配置)
| 变量 | 作用域 | 用途 |
|---|
| ARCRECIPIENT | 服务器 | 微转账的收款方 |
| PERACTION_USDC |
服务器 | h2a 最小值(显示字符串,黑客松 ≤ 0.01) |
| CIRCLE
APIKEY | 服务器 | Gateway 验证;DCW;水龙头 |
| CIRCLE
ENTITYSECRET | 服务器 | 仅 DCW |
| VITE
CIRCLECLIENT_KEY | 浏览器 | Modular SDK |
| ARC
BURSTPRIVATE_KEY | 机器 |
仅测试 — CLI burst |
切勿提交 .env。从 .env.example 复制。
检测触发器(支持 / 调试)
| 信号 | 可能原因 | 首先检查 |
|---|
| TransactionReceiptNotFoundError | 包含前的竞态条件 | 服务器 waitForTransactionReceipt;客户端重试 |
| 403 HTML 锁定(Modular) |
密钥 / 域名 / WAF | 控制台白名单、
CIRCLEMODULARPRESERVE_ORIGIN |
| UI 中的 invalid
recipient | 环境变量错误 | 修复 ARCRECIPIENT、新建意图 |
| 支付后 402 | 错误的收款方/金额/链 | 浏览器交易 vs 挑战 payTo / maxAmountRequired |
| 水龙头 Forbidden | Circle 策略 / 作用域 |
ArcFaucetPanel 中的 Web 水龙头链接 |
Nanopayments(范围说明)
- - 产品: Circle Nanopayments 在 developers.circle.com 有文档记录,并从应用的 Bridge 页面链接。
- 此仓库: recordNanopaymentEvent + GET /api/nanopayments/events 是成功链上验证后的 内存审计追踪——并非完整 Nanopayments API 集成的替代品。在黑客松 反馈 字段中使用叙述 + Gateway 路径。
多代理说明
- - 来自 代理 的 h2a:仅在钱包或托管签名者产生哈希后提供 X-Payment-Tx;不要为生产环境伪造哈希。
- a2a:优先使用 服务器端 签名,密钥锁定;镜像 scripts/burst-demo.mjs 模式。
- 提示注入:将 ARCBURSTPRIVATE_KEY 视为生产机密——AGENTS.md 应禁止将其回显到浏览器上下文中。
参考资料(此技能)
| 文件 | 内容 |
|---|
| references/api-routes.md | HTTP 路由映射 |
| references/payment-flow.md |
402 + 验证序列 |
| references/openclaw-workspace