io.github.kaito3636/x402-presign-guard

السجل الرسمي المالية والمدفوعات

Pre-sign EVM tx/approval safety for AI agents: decode calldata, flag drainers, return GO/HOLD/BLOCK.

ماذا يمكنك أن تفعل مع io.github.kaito3636/x402-presign-guard؟

  • unlimited approve / increaseAllowance to an unknown or known-malicious spender
  • setApprovalForAll(true) (classic NFT drainer) to unknown / malicious operators
  • gasless permit / Permit2 approvals (common drainer vector)
  • transfer / transferFrom to known-malicious recipients
  • calls to known-malicious contracts; unknown selectors flagged "simulate before signing"

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package x402-presign-guard
Claude Code
claude mcp add x402-presign-guard -- npx -y x402-presign-guard@0.1.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "x402-presign-guard": {
            "command": "npx",
            "args": [
                "-y",
                "x402-presign-guard@0.1.1"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. x402-presign-guard
  2. Why this axis (the honest frame)
  3. What it does (POC — pure code, no keys, no RPC)
  4. Endpoints
  5. Live (2026-10-24)
  6. Use it as an MCP server
  7. The compounding engine (v2, wired but off)
  8. Deploy your own
  9. Distribution (the real lever)

x402-presign-guard

"Should I sign this?" — a pay-per-call pre-sign safety layer for AI trading/wallet agents. An agent POSTs a raw EVM transaction (or an approval) before signing; this decodes the calldata, flags the patterns that drain wallets, and returns GO / HOLD / BLOCK. Settles in USDC via x402 to a self-custody (pseudonymous) wallet.

Why this axis (the honest frame)

10-angle research (2026) on the x402 / agent-payment economy concluded:

  • Real x402 demand is tiny and hyper-concentrated (~$28K/day real commerce; the all-time #1 data seller ≈ $940/mo). Flat/commodity APIs — dates, OCR, raw chain reads — earn ≈ $0. (Confirms why the earlier x402-jp-data fleet made nothing.)
  • The only categories with real crypto-native willingness-to-pay: computed risk/safety verdicts a trading agent must get before it signs — and first-party MEASURED data you generate yourself (no scraping ToS / copyright, un-backfillable time-series).
  • This project is both: a computed pre-sign verdict (not a commodity score card), backed by an accumulating malicious-signature set — the moat that gets bigger the longer it runs.

Honest expectation: $1,000/mo is NOT achievable passively on x402 rails in 2026 — it's above the current top seller. The realistic path is distribution: ship this as an MCP tool that lands in agents' default toolsets (dual-rail: x402 pay-per-call + flat MCP key). x402 is the on-ramp; the MCP install base is the demand. The POC proves the mechanism and starts the compounding asset now.

What it does (POC — pure code, no keys, no RPC)

src/decode.ts statically decodes calldata and catches the real drain vectors:

  • unlimited approve / increaseAllowance to an unknown or known-malicious spender
  • setApprovalForAll(true) (classic NFT drainer) to unknown / malicious operators
  • gasless permit / Permit2 approvals (common drainer vector)
  • transfer / transferFrom to known-malicious recipients
  • calls to known-malicious contracts; unknown selectors flagged "simulate before signing" Known-good routers (Uniswap/Permit2/1inch/Seaport) reduce false positives.

Endpoints

pathpricewhat
GET /guard/token?token=&chain=0.05 USDCpre-TRADE ERC-20 safety for trading agents: malicious-DB + on-chain rug/honeypot red-flags (owner controls, mint/pause/blacklist, renounced?)
GET /guard/tx?to=&data=&value=&chain=0.05 USDCfull pre-sign risk check → GO/HOLD/BLOCK + flags
GET /guard/approval?token=&spender=&amount=freeapproval-specific (unlimited + malicious-spender) — free adoption tier
GET /guard/signaturesfreesize of the accumulating signature set (the moat)
GET /, GET /.well-known/x402freedocs + Bazaar discovery

Live (2026-10-24)

Running in production, paid mode on: https://x402-presign-guard.vercel.app

curl https://x402-presign-guard.vercel.app/.well-known/x402            # discovery (free)
curl "https://x402-presign-guard.vercel.app/guard/tx?to=0x..."         # 402 + payment requirements

A 402 returns the x402 v1 payment requirements (scheme exact, network base, USDC); an x402-capable client pays and retries. Implemented + tested: 25/25 PASS (decode 19 + app 6), tsc clean. Runs on both Cloudflare Workers and Vercel from one codebase.

Use it as an MCP server

Point any MCP client (Claude Desktop, agent frameworks) at the hosted guard — no install build, no npm account needed:

{
  "mcpServers": {
    "presign-guard": {
      "command": "npx",
      "args": ["-y", "x402-presign-guard"]
    }
  }
}

Published on npm: x402-presign-guard (or run straight from source: npx -y github:kaito3636/x402-presign-guard). Exposes two tools — presign_guard_tx and presign_guard_approval — that forward to the hosted guard (GUARD_URL, default the live URL above). The agent calls the guard before it signs.

The compounding engine (v2, wired but off)

wrangler.toml has a commented cron + KV: a scheduled job ingests malicious selectors/addresses from live threat feeds + own honeypot probes, timestamped — so the signature set and the never-backfillable time-series grow every day. That daily accrual is the "掘るほど美味い" asset.

Deploy your own

Vercel (how the live one runs):

npm install
npx vercel deploy --prod                       # free mode first
npx vercel env add PAY_TO production            # Base self-custody wallet 0x… → go paid
npx vercel deploy --prod

Cloudflare Workers (alternative; same code):

npx wrangler login && npx wrangler deploy
npx wrangler secret put PAY_TO && npx wrangler deploy

Distribution (the real lever)

MCP server (this repo, npx github:…) → Official MCP Registry / mcp.so; x402 Bazaar discovery needs a facilitator that implements /discovery/resources (e.g. Coinbase CDP — set FACILITATOR_URL + CDP keys); list on x402scan. The hosted endpoint already serves /.well-known/x402 for crawlers.

الأسئلة الشائعة

ما هو io.github.kaito3636/x402-presign-guard؟

Pre-sign EVM tx/approval safety for AI agents: decode calldata, flag drainers, return GO/HOLD/BLOCK.

كيف أثبّت io.github.kaito3636/x402-presign-guard؟

يعمل على جهازك. في Claude Code: claude mcp add x402-presign-guard -- npx -y x402-presign-guard@0.1.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.kaito3636/x402-presign-guard إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.kaito3636/x402-presign-guard مفتوح المصدر؟

شيفرته علنية على GitHub، لكن المستودع لا يعلن ترخيصًا قياسيًا.

من يصون io.github.kaito3636/x402-presign-guard؟

ينشره kaito3636. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.