跳到主要内容
知仓学习社ZHICANG

x402

x402 agentic payments (Coinbase's HTTP 402 protocol). Custody-free tools to pay x402-protected endpoints (build the EIP-3009 transferWithAuthorizati…

不碰外部(只输出文字)无严重或高危命中internet-court/internet-court-skill

它会碰到什么

扫了多少2 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

x402 Payments skill

x402 turns HTTP 402 Payment Required into a real payment rail for agents: a

server replies 402 with what it wants paid; the client signs an off-chain

authorization and retries with an X-PAYMENT header; a facilitator broadcasts

it. Settlement uses EIP-3009 transferWithAuthorization (e.g. USDC on Base) —

the facilitator can only broadcast the signed authorization, never alter the

amount or destination.

Custody-free: the plugin builds the EIP-712 the payer signs and assembles

the header; it never holds a key.

Tools

| Tool | Purpose |

|---|---|

| chaingpt_x402_decode | Decode a 402 body or X-PAYMENT header into human terms (amount/token/recipient/expiry) before paying. |

| chaingpt_x402_build_payment | Build the UNSIGNED EIP-3009 typed data; pass a signature back to get the final X-PAYMENT header. |

| chaingpt_x402_facilitator | Call a facilitator: supported / verify / settle. |

| chaingpt_x402_create_requirements | Server side: generate the PaymentRequirements + 402 body to monetize your endpoint. |

| chaingpt_x402_fetch | The whole client loop in one tool: fetch a URL; on 402 it decodes the challenge and (given from) emits the unsigned typed data; re-call with xPaymentHeader to complete the paid request. |

Pay an endpoint (client flow)

Fast path — one tool drives the loop:

  1. chaingpt_x402_fetch url=<resource> from=<payer> → on 402 you get the decoded price/payee AND the unsigned EIP-3009 typed data.
  2. Sign the typed data in the payer's wallet.
  3. chaingpt_x402_build_payment from=<payer> requirements=<from step 1> signature=0x… → the X-PAYMENT header.
  4. chaingpt_x402_fetch url=<resource> xPaymentHeader=<header> → the paid response.

Manual path (same primitives, finer control): _decode_build_payment → sign → _build_payment +signature → retry yourself.

Monetize your endpoint (server flow)

chaingpt_x402_create_requirements network=base amount=0.01 payTo=<you> → serve

the returned JSON with HTTP 402. Verify/settle incoming payments via a

facilitator (chaingpt_x402_facilitator).

Known EIP-3009 tokens: USDC on base and base-sepolia. For other tokens pass

full PaymentRequirements (with asset + extra.name/extra.version).

0 ChainGPT credits.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。