微算力 · API 导航与自营网关
API 接入 EN
未登录登录
💰

AI Agent的加密钱包与微支付中枢

LLM Wallet - x402 stabelcoin payments on Polygon · v1.0.0
这个包缺安装入口,装上也不会生效 缺 SKILL.md 或 frontmatter 不完整(BAD_NAME)。我们仍保留下载,方便你自行查看内容。
AI 增强 安全 A 级 作者 akshatgada 公开目录收录
2.4k 下载 1 安装 7.5k 收藏 10 浏览

简介

专为AI Agent设计的加密货币钱包管理工具,支持USDC稳定币在Polygon网络上的x402微支付协议,实现安全、可控的付费API调用。

原始描述

Manage crypto wallets and make x402 micropayments with USDC stablecoins on Polygon

通过你的 Agent 添加

安装目录:llm-wallet-x402-stabelcoin-payments-on-polygon/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/llm-wallet-x402-stabelcoin-payments-on-polygon/
Codex CLI~/.codex/skills/llm-wallet-x402-stabelcoin-payments-on-polygon/
DeepSeek Harness~/.agents/skills/llm-wallet-x402-stabelcoin-payments-on-polygon/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

LLM Wallet 是一款面向 AI Agent 的加密货币钱包管理 Skill,基于 Coinbase 开发的 x402 支付协议实现。该 Skill 本身为纯文档型指导工具,通过标准化命令帮助用户完成钱包创建、余额查询、支付限额设置、交易历史追踪等核心功能。用户可通过 llm-wallet create 创建 HD 钱包,llm-wallet balance 查看 USDC 余额,llm-wallet pay 执行微支付操作。Skill 特别强调安全流程:每次支付前必须通过 check-payment 预检,获取用户明确批准后方可执行。对于高频使用的付费 API,支持 register-api 注册为可复用工具,简化后续调用流程。

显著优点

安全性设计是该 Skill 的核心亮点。默认使用 Polygon 测试网(polygon-amoy),避免真实资金风险;内置 AES-256-GCM 钱包加密;支持 per-transaction 和 daily 双维度支付限额;强制用户确认机制防止意外扣款。协议层面依托 Coinbase 开发的 x402 标准,该协议专为 HTTP 402 Payment Required 场景设计,将区块链支付与 Web API 无缝集成。功能层面支持动态 API 注册,将付费端点转化为可复用工具,提升 Agent 的自动化能力。所有交易均带时间戳记录,便于审计追踪。

潜在缺点与局限性

作为纯文档型 Skill,其本身不具备代码执行能力,实际功能依赖外部 Node.js 包 llm-wallet-mcp,需用户自行安装评估,增加了供应链安全风险敞口。当前仅支持 USDC 稳定币和 Polygon 生态,币种与链的扩展性有限。测试网与主网的切换依赖环境变量配置,误配置可能导致真实资金损失。此外,x402 协议尚处早期普及阶段,支持的付费 API 生态相对有限,可能面临"有钱包无场景"的困境。网络拥堵时 Polygon 链上确认时间波动,可能影响实时支付体验。

适合的目标群体

主要面向三类用户:一是构建付费 API 消费能力的 AI Agent 开发者,需要为 Agent 赋予自主支付能力;二是 x402 生态的早期探索者,希望体验区块链原生支付协议;三是需要微支付场景解决方案的 Web3 项目方,可基于该 Skill 快速集成 USDC 支付能力。不适合完全没有区块链基础的用户,也不建议大额资金管理场景使用。

使用风险

资金风险:尽管默认测试网,但主网切换后任何配置错误或恶意 API 都可能导致资金损失,务必验证网络设置。供应链风险:外部依赖 llm-wallet-mcp 包的漏洞或恶意更新可能威胁钱包安全,建议在隔离环境首次运行。私钥管理:WALLET_ENCRYPTION_KEY 的泄露将导致钱包完全失控,需遵循"永不提交版本控制"原则。网络验证:facilitator URL 需二次确认官方来源,警惕钓鱼网站窃取凭证。限额绕过:环境变量覆盖机制若被恶意利用可能突破支出限制,建议通过系统级权限控制环境变量访问。

技能正文


name: llm_wallet description: Manage crypto wallets and make x402 micropayments with USDC stablecoins on Polygon homepage: https://github.com/x402/llm-wallet-mcp metadata: {"openclaw": {"emoji": "💰", "requires": {"bins": ["node"]}, "install": [{"id": "node", "kind": "node", "package": "llm-wallet-mcp", "bins": ["llm-wallet-mcp"], "label": "Install LLM Wallet MCP (node)"}]}}

LLM Wallet - Crypto Wallet & x402 Micropayments

Use llm-wallet commands to manage crypto wallets and make micropayments to paid APIs using USDC stablecoins on Polygon blockchain.

Default Network: Polygon Testnet (polygon-amoy) - safe for testing Facilitator: https://x402-amoy.polygon.technology

Quick Start

# Create wallet
llm-wallet create

# Check balance
llm-wallet balance

# Set spending limits (recommended)
llm-wallet set-limit --per-tx 0.10 --daily 5.00

# View transaction history
llm-wallet history

Wallet Management

Create Wallet

llm-wallet create [--label <name>]

Creates a new HD wallet with encryption. Returns wallet address.

Example:

llm-wallet create --label "agent-wallet"

Import Wallet

llm-wallet import --private-key <key> [--label <name>]

Import existing wallet from private key.

Check Balance

llm-wallet balance

Shows USDC balance and native token balance on current network.

Transaction History

llm-wallet history

View all transactions and payments made from this wallet.

Spending Limits

Set Limits

llm-wallet set-limit --per-tx <amount> --daily <amount>

Set per-transaction and daily spending caps in USDC.

Example:

llm-wallet set-limit --per-tx 0.10 --daily 5.00

Check Limits

llm-wallet get-limits

View current spending limits and daily usage.

x402 Payments

Make Payment

llm-wallet pay <url> [--method GET|POST] [--body <json>]

Make x402 micropayment to a paid API endpoint.

⚠️ IMPORTANT: Always ask user for approval before making payments!

Example:

# Ask user: "I need to make a payment to https://api.example.com/weather. Cost: $0.001 USDC. Approve?"
llm-wallet pay "https://api.example.com/weather?location=London"

Workflow:

  1. Check if payment is needed: llm-wallet check-payment <url>
  2. Show user: URL, estimated cost, current limits
  3. Wait for user approval
  4. Execute: llm-wallet pay <url>
  5. Confirm completion and show transaction ID

Check Payment (Pre-flight)

llm-wallet check-payment <url>

Checks if wallet can afford payment without executing it.

Dynamic API Registration

Register API

llm-wallet register-api <url> --name <tool_name>

Register a paid API endpoint as a reusable tool.

Example:

llm-wallet register-api "https://api.example.com/weather" --name weather_api

List Registered APIs

llm-wallet list-apis

Show all registered API tools.

Call Registered API

llm-wallet call-api <tool_name> [--params <json>]

Execute a registered API tool. Requires approval if payment needed.

Example:

# Ask user for approval first if cost > 0
llm-wallet call-api weather_api --params '{"location": "London"}'

Unregister API

llm-wallet unregister-api <tool_name>

Remove a registered API tool.

Seller Tools (Advanced)

Verify Payment

llm-wallet verify-payment --header <x-payment-header> --requirements <json>

Verify incoming payment from a buyer (seller-side).

Create Payment Requirements

llm-wallet create-requirements --price <amount> --pay-to <address> --url <resource-url>

Generate payment requirements for a protected resource.

Safety Rules

  1. Network Default: Always uses polygon-amoy (testnet) unless configured otherwise
  2. Approval Required: Always ask user before making payments
  3. Spending Limits: Check limits before payment attempts
  4. Transaction Logging: All payments are logged with timestamps
  5. Encryption: Wallets are encrypted with AES-256-GCM

Configuration

Environment Variables

  • WALLET_ENCRYPTION_KEY - Wallet encryption key (32+ chars, auto-generated if missing)
  • WALLET_NETWORK - Network selection (default: polygon-amoy | polygon)
  • FACILITATOR_URL - Custom facilitator URL (auto-configured)
  • WALLET_MAX_TX_AMOUNT - Per-transaction limit override
  • WALLET_DAILY_LIMIT - Daily limit override

Network Info

Common Workflows

First Time Setup

# 1. Create wallet
llm-wallet create --label "my-agent"

# 2. Set spending limits
llm-wallet set-limit --per-tx 0.10 --daily 5.00

# 3. Check balance (will be 0 initially)
llm-wallet balance

# 4. Fund wallet with testnet USDC
# User needs to: visit https://faucet.polygon.technology/

Making a Payment

# 1. Pre-check payment
llm-wallet check-payment "https://api.example.com/weather?location=London"

# 2. Show user: URL, cost estimate, current limits
# 3. Ask user: "Approve payment of $0.001 USDC to https://api.example.com/weather?"

# 4. If approved, execute payment
llm-wallet pay "https://api.example.com/weather?location=London"

# 5. Confirm and show transaction ID
llm-wallet history

Registering a Paid API

# 1. Register the API
llm-wallet register-api "https://api.example.com/translate" --name translate_api

# 2. List available APIs
llm-wallet list-apis

# 3. Call the API (with approval)
llm-wallet call-api translate_api --params '{"text": "hello", "to": "es"}'

# 4. View payment in history
llm-wallet history

Error Handling

  • Insufficient Balance: Show error and guide user to faucet (testnet) or funding instructions (mainnet)
  • Payment Rejected: Transaction reverted, check error message for details
  • Limit Exceeded: Show current limits and daily usage, suggest increasing limits
  • Network Timeout: Retry with exponential backoff (max 3 attempts)

References

See references/ folder for:

  • x402-protocol.md - x402 payment protocol overview
  • wallet-setup.md - Detailed wallet setup guide
  • examples.md - More usage examples

Notes

  • All amounts are in USDC (6 decimals)
  • Default network is testnet for safety
  • Testnet USDC has no real value
  • Always verify network before mainnet usage
  • Keep encryption key secure (never share or commit)

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

crypto-walletblockchainpolygonusdcmicropaymentsx402-protocoldefiapi-payments

同类 Skill