PayClaw: 智能体间 USDC 支付 - Openclaw Skills

作者:互联网

2026-03-26

AI教程

什么是 PayClaw?

PayClaw 为在 OpenClaw 生态系统中运行的自主智能体提供了一个强大的金融框架。通过利用 Circle 开发者控制的钱包,此技能允许智能体参与去中心化商业,使它们能够在无需人工干预的情况下拥有和管理资金。这是任何开发者 Openclaw Skills 工具包中至关重要的补充,弥合了自主任务执行与财务结算之间的鸿沟。

该技能在 Arc 测试网以及 Base 和 Polygon 等其他主流网络上支持原生 USDC 交易。它解决了智能体流动性的关键问题,允许 AI 实体支付其自身的 API 成本、雇用其他智能体执行专门的子任务,并通过内置的托管系统参与安全的、基于条件的财务协议。

下载入口:https://github.com/openclaw/skills/tree/main/skills/rojasjuniore/payclaw

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install payclaw

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 payclaw。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

PayClaw 应用场景

  • 自主 API 支付:允许智能体实时支付第三方服务或计算资源费用。
  • 智能体间雇用:允许主智能体雇用子智能体并为特定的交付成果支付报酬。
  • 安全任务托管:锁定项目资金,并在智能体确认任务完成后自动释放。
  • 去中心化薪酬:管理从国库智能体到多个工人智能体的自动化 USDC 分配。
PayClaw 工作原理
  1. 开发者安装该技能并配置 Circle API 密钥以启用钱包管理。
  2. 生成智能体专用的钱包,为 AI 提供唯一的链上身份和地址。
  3. 智能体使用发现目录通过名称或地址查找其他智能体或服务提供商。
  4. 对于复杂任务,智能体创建托管合约,锁定 USDC 资金直到满足特定条件。
  5. 完成后,资金将释放到接收者的钱包,若未满足条件则退还给发送者。

PayClaw 配置指南

通过 hub 安装技能并将其链接到本地环境:

clawhub install payclaw
cd ~/.openclaw/skills/payclaw
npm install && npm run build && npm link

配置您的凭据并初始化智能体钱包:

# 使用您的 Circle API 密钥初始化
payclaw setup --api-key YOUR_CIRCLE_API_KEY

# 为您的智能体创建主钱包
payclaw wallet create "AgentName"

# 使用测试网水龙头为钱包充值
payclaw faucet

PayClaw 数据架构与分类体系

PayClaw 使用以下结构组织财务数据和元数据,使其成为交易管理中最有条理的 Openclaw Skills 之一:

数据对象 属性 存储 / 来源
钱包 名称, 地址, 余额, 链 ID Circle 基础设施
托管 托管 ID, 金额, 接收者, 条件, 状态 链上 (Arc 测试网)
交易 交易哈希, 金额, 备注, 时间戳 区块链账本
智能体目录 智能体名称, 公开钱包地址 PayClaw 注册表
name: payclaw
version: 1.0.0
description: "Agent-to-Agent USDC payments. Create wallets, send/receive payments, escrow between agents. Built for the USDC Hackathon on Moltbook."
metadata: {"openclaw": {"emoji": "??", "homepage": "https://github.com/rojasjuniore/payclaw"}}

PayClaw ??

Agent-to-Agent USDC Payments for OpenClaw.

Built for the USDC Hackathon on Moltbook.

What It Does

PayClaw enables any OpenClaw agent to:

  • ?? Create a USDC wallet (Circle Developer-Controlled Wallets)
  • ?? Receive payments from other agents or humans
  • ?? Send payments to any wallet address
  • ?? Escrow funds between agents for trustless transactions
  • ?? Works on Arc Testnet (USDC native L1)

Why It Matters

Agents need money to work.

Today, if your agent needs to:

  • Pay for an API call
  • Hire another agent
  • Receive payment for a task
  • Hold funds in escrow for a deal

...there's no easy way to do it. PayClaw solves this.

Installation

clawhub install payclaw
cd ~/.openclaw/skills/payclaw
npm install && npm run build && npm link

Setup

# Configure with Circle API key
payclaw setup --api-key YOUR_CIRCLE_API_KEY

# Create your agent's wallet
payclaw wallet create "MyAgent"

# Get testnet USDC
payclaw faucet

Commands

Wallet Management

payclaw wallet create [name]     # Create new wallet
payclaw wallet list              # List all wallets
payclaw wallet balance           # Check balance
payclaw wallet address           # Show wallet address

Payments

payclaw pay 
# Send USDC payclaw request [memo] # Generate payment request payclaw history # Transaction history

Escrow (Agent-to-Agent)

payclaw escrow create   [--condition "task completed"]
payclaw escrow list              # List active escrows
payclaw escrow release       # Release funds to recipient
payclaw escrow refund        # Refund to sender

Agent Discovery

payclaw agents list              # List agents with PayClaw wallets
payclaw agents find        # Find agent's wallet address
payclaw agents register          # Register your agent in directory

Usage Examples

Pay Another Agent

# Find agent's wallet
payclaw agents find "DataBot"
# Output: 0x1234...5678

# Send payment
payclaw pay 0x1234...5678 10 --memo "For data analysis task"
# Output: ? Sent 10 USDC to DataBot (0x1234...)
#         TX: 0xabc...def

Create Escrow for Task

# Client creates escrow
payclaw escrow create 50 0xFreelancerWallet --condition "Deliver logo design"
# Output: ?? Escrow created: ESC-001
#         Amount: 50 USDC
#         Recipient: 0xFreelancer...
#         Condition: Deliver logo design

# After task completion, client releases
payclaw escrow release ESC-001
# Output: ? Released 50 USDC to 0xFreelancer...

Receive Payment

# Generate payment request
payclaw request 25 --memo "API access for 1 month"
# Output: ?? Payment Request
#         To: 0xYourWallet...
#         Amount: 25 USDC
#         Memo: API access for 1 month
#         
#         Share this with payer:
#         payclaw pay 0xYourWallet 25 --memo "API access for 1 month"

Agent Integration

// In your OpenClaw skill
import { PayClaw } from 'payclaw';

const payclaw = new PayClaw();

// Check if payment received
const balance = await payclaw.getBalance();

// Send payment
await payclaw.send('0x...', 10, 'For task completion');

// Create escrow
const escrow = await payclaw.createEscrow(50, '0x...', 'Task condition');

Supported Chains

  • Arc Testnet (default) - Circle's native USDC L1
  • Base Sepolia
  • Polygon Amoy
  • Ethereum Sepolia

Security

  • Private keys never leave Circle's infrastructure
  • Gas-free transactions via Circle Gas Station
  • Testnet only for hackathon (no real funds)

Architecture

┌─────────────────┐     ┌─────────────────┐
│  OpenClaw Agent │────?│    PayClaw      │
└─────────────────┘     └────────┬────────┘
                                 │
                                 ▼
                        ┌─────────────────┐
                        │  Circle Wallets │
                        │    (Testnet)    │
                        └────────┬────────┘
                                 │
                                 ▼
                        ┌─────────────────┐
                        │   Arc Testnet   │
                        │     (USDC)      │
                        └─────────────────┘

Hackathon Track

Best OpenClaw Skill - This skill extends OpenClaw agents with native USDC payment capabilities, enabling a new paradigm of agent-to-agent commerce.

  • GitHub: https://github.com/rojasjuniore/payclaw
  • Moltbook: https://moltbook.com/u/JuniorClaw
  • Built by: IntechChain

License

MIT


Built for the OpenClaw USDC Hackathon on Moltbook ??