安装与下载
1 ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install lion-screen-before-pay
2 手动安装
将技能文件夹复制到以下位置之一
~/.openclaw/skills/
{'/skills/'}
优先级:工作区 › 全局 › 内置
3 提示词安装
将此提示词复制到 Openclaw 即可自动安装。
请帮我使用 Clawhub 安装 skill-lion-screen-before-pay。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
更倾向于下载?
获取包含原生技能文件的ZIP压缩包。
基本信息
lion-screen-before-pay
安装指南
- ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install lion-screen-before-pay - 手动安装
将技能文件夹复制到以下位置之一
全局模式
~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置 - 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 lion-screen-before-pay。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
更倾向于下载?
获取包含原生技能文件的ZIP压缩包。
下载技能 (.zip)
什么是
LION 支付前筛选为代理支付添加了合规关卡:在支付 x402 资源之前,代理读取其 payTo 钱包并请求 LION 筛选。PASS 允许支付继续;WARN 或 BLOCK 要求中止。这有助于解决 x402 中的一个空白,即验证支付机制但未验证交易对手的身份或风险。
对于先前筛选过的钱包,代理使用付费复查,而不是将旧的 PASS 视为永久有效。LION 根据当前的裁决及其是否更改,返回 GO、HOLD 或 STOP 动作。这些 Openclaw Skills 工作流程无密钥、默认故障关闭,并提供可离线验证的签名收据。
应用场景
在 x402 资源响应 HTTP 402 之后且在签署其支付之前筛选
payTo
地址。
当钱包筛选返回
WARN
BLOCK
时中止支付。
在再次支付之前复查先前遇到的交易对手,包括在使用包装器时跨进程重启。
@lionx402/guard
包装器、AgentCash 集成或 LION 的 MCP 服务器将筛选添加到代理支付流程中。
保留签名的筛选和复查收据,以确保可审计性和离线验证。
工作原理
请求目标资源而不付款。当它响应 HTTP 402 时,从 base64 编码的 PAYMENT-REQUIRED 头中读取 payTo 地址,仅在缺少头部时使用 JSON 主体。
调用 LION 针对该地址的钱包筛选端点。该筛选在 Base 上花费 0.001 USDC,本身是一个 x402 请求,使用配置的 cdp-x402 买家流程支付。
检查返回的裁决。仅在为 PASS 时继续;在 WARN 或 BLOCK 时中止。不要将 CLEAR 视为有效裁决。
保留签名的响应主体及其证明。收据可以针对 LION 发布的 Ed25519 密钥进行离线验证。
再次向同一交易对手付款时,调用 0.01 美元的交易对手复查端点,而不是购买另一次性筛选。使用 GO 继续;在 HOLD 或 STOP 时中止。
保留最新的复查收据,以便下一次调用可以将裁决和命中标志与先前的签名检查进行比较。不要在不复查的情况下无限期缓存 PASS。
配置指南
The direct workflow requires a funded and configured cdp environment, curl, jq, and Python 3. Set PAYTO to the wallet you are about to pay and ACCOUNT to the configured CDP account name. The screening request is keyless and does not require a LION account or API key.
PAYTO=0x...
ACCOUNT=your-cdp-account
LION="https://lionx402.com/api/x402/wallet-screen-json?address=$PAYTO"
请求筛选并捕获其 x402 挑战。
HDR=$(curl -sD - -o /tmp/lion_screen_body.json "$LION" | awk 'tolower($1)=="payment-required:" { gsub(/\r/,""); print $2; exit }')
解码 PAYMENT-REQUIRED 头;仅在缺少头部时使用主体。
if [ -n "$HDR" ]; then
REQ=$(printf '%s' "$HDR" | python3 -c 'import sys,base64,json; s=sys.stdin.read().strip().replace("-","+").replace("_","/"); s+="="*((4-len(s)%4)%4); print(json.dumps(json.loads(base64.b64decode(s))["accepts"][0], separators=(",", ":")))')
else
REQ=$(jq -c '.accepts[0]' /tmp/lion_screen_body.json)
fi
使用 CDP 账户构建并签署 x402 支付授权。
addr=$(cdp evm accounts by-name name=$ACCOUNT | jq -r .address)
payload=$(cdp util x402 build --from "$addr" --payment-requirements "$REQ")
D=$(echo "$payload" | jq -c .domain)
T=$(echo "$payload" | jq -c .types)
P=$(echo "$payload" | jq -r .primaryType)
M=$(echo "$payload" | jq -c .message)
sig=$(cdp evm accounts sign typed-data "$addr" \
"domain:=$D" "types:=$T" "primaryType=$P" "message:=$M" | jq -r .signature)
header=$(cdp util x402 encode --payment-requirements "$REQ"
--signature "$sig" --authorization "$M" --x402-version 2)
支付筛选费用,除非裁决为 PASS,否则默认故障关闭。
RESULT=$(curl -s -H "X-PAYMENT: $header" -H "PAYMENT-SIGNATURE: $header" "$LION")
verdict=$(echo "$RESULT" | jq -r '.verdict // .receipt.verdict')
if [ "$verdict" != "PASS" ]; then
echo "BLOCKED ($verdict): $(echo "$RESULT" | jq -c '.flags')"
exit 1
fi
echo "$RESULT" | jq -c '.' > last_wallet_screen.json
仅在 PASS 之后,继续支付原始目标资源。
For a repeat payment, use https://lionx402.com/api/x402/counterparty-recheck-json?address=
and proceed only when its action is GO. The optional compliance bundle costs $0.05 and is intended for cases where the wallet screen is insufficient. Alternative integrations include npm i @lionx402/guard, the lion-guard-agentcash command, or the MCP server at https://lionx402.com/api/mcp.
数据架构
LION 返回钱包筛选的裁决和签名证明。复查响应还包含更改跟踪和收据元数据。
字段 含义
verdict PASS、WARN 或 BLOCK;钱包筛选决定。
ofac.snapshot_as_of 数字货币地址快照的财政部发布日期。从收据中读取此值。
ofac.total_listed_addresses / ofac.addresses_in_snapshot 相关响应提供的地址计数数字段;不要从此技能中硬编码计数。
flags 存在时与结果关联的筛选信号。
attestation 签名的收据数据,包括 Ed25519 签名。
action 复查决定:GO、HOLD 或 STOP。
changed 在第一次存储的检查上为 false;当裁决或命中标志更改时为 true。
prior_receipt_id 先前收据的 ID,或在没有收据时为 null。
receipt_id 当前复查收据的标识符。
The direct example saves the screen response to last_wallet_screen.json. The optional @lionx402/guard wrapper remembers addresses in ~/.lion/screened-payto.json, including across process exits. To verify a receipt offline, recompute SHA-256 over the canonical body excluding attestation, then verify the Ed25519 signature using the signer published at https://lionx402.com/.well-known/lion-compliance-key.json. The @lionx402/receipt-verifier helper is available; LION also documents a ?verify_helper=1 option for paid routes.
高级特性
故障关闭支付关卡:
如果钱包筛选裁决不完全是
PASS
,则直接流程在不支付目标的情况下退出。
重复交易对手复查:
支付 0.01 美元再次检查同一个钱包,并根据
GO
、
HOLD
STOP
采取行动,包括裁决或命中标志是否更改。
嵌入式包装器:
withLionGuard(payFetch)
payTo
,在支付前进行筛选,除非结果可接受,否则抛出
LionGuardBlockedError
。重复地址使用复查流程且仅在
GO
时继续。
AgentCash 集成:
npx
和参数
--yes --package @lionx402/guard lion-guard-agentcash
配置其 MCP 服务器命令,在支付目标之前筛选 fetch 调用。
MCP 代理工具:
连接到
https://lionx402.com/api/mcp
;调用
lion_wallet_screen
进行初始筛选,调用
lion_counterparty_recheck
再次检查同一钱包。
离线收据验证:
在验证时无需依赖 LION 回调即可验证签名响应。
可选的更深层筛选:
仅当 0.001 美元的钱包筛选不够时才请求 0.05 美元的合规包。筛选使用公共来源信号,不构成法律意见。
name: lion-screen-before-pay description: Before your agent sends USDC to an x402 payTo, screen that address with LION's $0.001 OFAC wallet screen. PASS proceeds. WARN or BLOCK aborts. The same wallet again is the $0.01 recheck. GO proceeds. HOLD or STOP aborts.
lion-screen-before-pay
x402 verifies the payment, never who you are paying. An agent will happily send USDC to a payTo that belongs to a sanctioned, fraudulent, or honeypot counterparty. Screen first, pay second.
When to use
Whenever the agent is about to pay an x402 resource — or onboard/transact with any wallet, domain, or company. Screen the payTo before signing the payment.
The gate (one keyless call, $0.001 USDC on Base)
GET https://lionx402.com/api/x402/wallet-screen-json?address=
address = the wallet you are about to pay.
Response: { "verdict": "PASS" | "WARN" | "BLOCK", "ofac": { "snapshot_as_of", "total_listed_addresses" }, "attestation" }.
Proceed on PASS. Abort on WARN or BLOCK. Do not look for CLEAR.
The $0.05 compliance bundle is optional, and only when this screen is not enough: GET https://lionx402.com/api/x402/compliance-bundle-json?address=
&receipt=1.
Workflow
Hit the target resource without paying. On 402, read payTo from the PAYMENT-REQUIRED header (base64 JSON, accepts[0].payTo). Use the JSON body only if that header is absent.
Screen it — pay the $0.001 wallet screen for that payTo (it is itself an x402 call; pay it with the cdp-x402 buyer flow below).
Decide: verdict == "PASS" → proceed to pay the target. WARN or BLOCK → ABORT.
Keep the signed body. It verifies offline (no callback) against LION's published key.
Screening the gate (reuses the cdp-x402 buyer flow)
PAYTO=0x... # the counterparty you're about to pay
LION="https://lionx402.com/api/x402/wallet-screen-json?address=$PAYTO"
# The challenge is the PAYMENT-REQUIRED header. Use the JSON body only when that header is absent.
HDR=$(curl -sD - -o /tmp/lion_screen_body.json "$LION" | awk 'tolower($1)=="payment-required:" { gsub(/\r/,""); print $2; exit }')
if [ -n "$HDR" ]; then
REQ=$(printf '%s' "$HDR" | python3 -c 'import sys,base64,json; s=sys.stdin.read().strip().replace("-","+").replace("_","/"); s+="="*((4-len(s)%4)%4); print(json.dumps(json.loads(base64.b64decode(s))["accepts"][0], separators=(",", ":")))')
else
REQ=$(jq -c '.accepts[0]' /tmp/lion_screen_body.json)
fi
addr=$(cdp evm accounts by-name name=$ACCOUNT | jq -r .address)
payload=$(cdp util x402 build --from $addr --payment-requirements "$REQ")
D=$(echo "$payload" | jq -c .domain); T=$(echo "$payload" | jq -c .types)
P=$(echo "$payload" | jq -r .primaryType); M=$(echo "$payload" | jq -c .message)
sig=$(cdp evm accounts sign typed-data $addr \
"domain:=$D" "types:=$T" "primaryType=$P" "message:=$M" | jq -r .signature)
header=$(cdp util x402 encode --payment-requirements "$REQ"
--signature "$sig" --authorization "$M" --x402-version 2)
RESULT=$(curl -s -H "X-PAYMENT: $header" -H "PAYMENT-SIGNATURE: $header" "$LION")
verdict=$(echo "$RESULT" | jq -r '.verdict // .receipt.verdict')
if [ "$verdict" != "PASS" ]; then
echo "BLOCKED ($verdict): $(echo "$RESULT" | jq -c '.flags')"; exit 1 # fail-closed: do NOT pay
fi
echo "$RESULT" | jq -c '.' > last_wallet_screen.json # keep the proof
# verdict PASS -> now pay the original target resource.
Second call — did the verdict flip? ($0.01)
The $0.001 screen is one-shot. The next time this agent pays the same counterparty, recheck instead of buying another dossier. The receipt includes the Treasury OFAC snapshot date (ofac.snapshot_as_of) and the address count (ofac.addresses_in_snapshot). Entity names are a curated index, not the full SDN name file. The response also says whether the verdict changed since the last signed recheck.
GET https://lionx402.com/api/x402/counterparty-recheck-json?address=
GET https://lionx402.com/api/x402/counterparty-recheck-json?address=
&domain=
action: GO | HOLD | STOP. STOP when the verdict is BLOCK. HOLD when the verdict is WARN or changed is true. GO only when PASS and changed is not true.
ofac.snapshot_as_of and ofac.addresses_in_snapshot: the Treasury publication date of the digital-currency address list, and how many addresses are in it. Read these from the receipt. Do not take a count from this skill.
verdict: PASS | WARN | BLOCK (same branch as the wallet screen).
changed: false on the first stored check, true when the verdict or hit flags flipped.
prior_receipt_id: the previous receipt, or null.
receipt_id + attestation: the new Ed25519 receipt. Keep it. The next recheck compares against it.
Abort on STOP or HOLD. Proceed only on GO. Do not cache a PASS forever without this call.
Drop-in alternatives
Wrapper: npm i @lionx402/guard. withLionGuard(payFetch) reads payTo from the header, pays the $0.001 screen, and throws LionGuardBlockedError unless the verdict is PASS. The same address again, including after the process exits, pays the $0.01 recheck and proceeds only on GO. Remembered addresses are in ~/.lion/screened-payto.json.
AgentCash: AgentCash has no pre-pay hook. Set the MCP server command to npx and the args to --yes --package @lionx402/guard lion-guard-agentcash, instead of npx agentcash@latest. A fetch call is screened before the target is paid.
MCP agents: add https://lionx402.com/api/mcp. First call lion_wallet_screen. The same wallet again is lion_counterparty_recheck.
Verify the receipt offline (no trust in LION at verify time)
Recompute SHA-256 over the canonical body (minus attestation), Ed25519-verify attestation.signature against the signer at:
https://lionx402.com/.well-known/lion-compliance-key.json
Helper: @lionx402/receipt-verifier, or append ?verify_helper=1 to any LION paid route.
Notes
Keyless — no LION account or API key. The first screen is $0.001. The same wallet again is the $0.01 recheck. Do not cache a PASS forever.
The $0.001 call is the OFAC address snapshot, not the full compliance pack.
Fail-closed by default. Mechanical screening from public sources (OFAC SDN, Wikidata, DexScreener/GoPlus, DoH/crt.sh) — not legal advice.
District One 创始公民身份