# Base Calldata Decoder & Pre-Sign Risk Analyzer

> Base Calldata Decoder & Pre-Sign Risk Analyzer is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Decodes raw EVM calldata (or a Base transaction hash) into human-readable function signature, typed arguments, plain-English summary, and a risk verdict before signing.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/decode-calldata?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-calldata-decoder-pre-sign-risk-analyzer-109f5db2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NhTuQNZ0SHrF7vXK35HdH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability base-calldata-decoder-pre-sign-risk-analyzer-109f5db2
```

Example prompt: Before I sign this transaction, decode the calldata 0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff and check the target contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 — tell me what function is being called, what the arguments are, and whether it's safe to sign.

## When to prefer this

Use this endpoint when an AI agent or wallet needs to explain or risk-assess raw EVM calldata before signing on Base — especially for ERC20 approvals, permit calls, NFT approvals, or any unfamiliar selector. Prefer this over generic block explorers when you need structured, machine-readable output with explicit risk flags suitable for programmatic gating of transaction signing.

## Known failure modes

- Unrecognized 4-byte selector — returns unknown function with no decoded args
- Invalid or malformed calldata hex — 400-level error or partial decode
- Base transaction hash not found or not yet indexed — hash lookup fails
- ABI round-trip collision detected — ambiguous selector flagged
- Contract at `to` address not a token — symbol/decimals lookup returns null
- Calldata too short (less than 4 bytes) — selector cannot be resolved

## How this service works

What am I about to sign? Pre-sign calldata decoder for Base: data=0x.. (selector+args) [&to=0x.. token/contract for symbol+decimals] or hash=0x.. (decode an existing tx). Resolves the 4-byte selector (builtin + openchain + 4byte, collision-checked by ABI round-trip), returns function signature, typed args, plain-English summary, risk none|low|medium|high, flags (unlimited_approval, unknown_spender, approve_all_nfts, offchain_permit, permit2_allowance, batched_calls, inner_approval,...

## Output

Returns a JSON object containing: the resolved function signature and 4-byte selector, typed and decoded arguments, a plain-English summary of what the transaction does, a risk rating (none/low/medium/high), a verdict string (e.g. CAUTION), an array of risk flags (unlimited_approval, unknown_spender, approve_all_nfts, offchain_permit, permit2_allowance, batched_calls, inner_approval), spender address and label, amount (numeric or 'unlimited'), guidance text, the token/contract label and decimals if a `to` address was provided, and the signature resolution source (builtin, openchain, or 4byte).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "to": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "description": "Optional target contract (token) for symbol/decimals + label"
      },
      "data": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{8,}$",
       "examples": [
        "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
       ],
       "description": "Calldata hex (selector + ABI args). Required unless hash given"
      },
      "hash": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{64}$",
       "description": "Optional Base tx hash: decode its input instead of data"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "args": [
   {
    "type": "address",
    "value": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
   },
   {
    "type": "uint256",
    "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
   }
  ],
  "risk": "medium",
  "chain": "base",
  "flags": [
   "unlimited_approval"
  ],
  "amount": "unlimited",
  "spender": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
  "summary": "lets Uniswap Permit2 move ALL USDC from the signer",
  "verdict": "CAUTION",
  "function": "approve(address,uint256)",
  "guidance": "Review the decoded args; simulate with /crypto/base-rpc?method=eth_call before signing.",
  "selector": "0x095ea7b3",
  "unlimited": true,
  "spender_label": "Uniswap Permit2",
  "signature_source": "builtin"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-calldata-decoder-pre-sign-risk-analyzer-109f5db2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
