# x402 Bazaar — EVM Function Selector Decoder

> x402 Bazaar — EVM Function Selector Decoder is a paid API for AI agents from api.relai.fi, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Resolves a 4-byte Ethereum function selector or calldata to human-readable ABI signatures via 4byte.directory, paid with micro-USDC via x402 protocol

## Facts

- Endpoint: POST https://api.relai.fi/relay/1782567677091/api/x402/decode-selector
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-bazaar-evm-function-selector-decoder-dea9ff2b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HgI2Ay7Np_sGXrQIfXMVH

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 x402-bazaar-evm-function-selector-decoder-dea9ff2b -d '<json body>'
```

Example prompt: Can you decode the Ethereum function selector 0xa9059cbb and tell me what human-readable Solidity function signature it maps to?

## When to prefer this

Use this endpoint when you need to decode an unknown EVM function selector (4-byte hex) back to a human-readable Solidity signature — especially useful when analyzing smart contract calldata, debugging transactions, or building EVM tooling. Prefer this over querying 4byte.directory directly when you want a pay-per-call micropayment model via x402 without API key management.

## Known failure modes

- Unknown selector not present in 4byte.directory returns empty results
- Malformed or non-hex selector returns a 400-style validation error
- Payment not included or insufficient triggers 402 response with USDC payment requirements on Base
- Selector provided with invalid length (not 4 bytes) rejected
- Network issues reaching 4byte.directory upstream cause 502/timeout

## How this service works

Resolves a 4-byte function selector (e.g. 0x70a08231) to candidate human-readable signatures via 4byte.directory. Accepts a bare selector or full calldata. Paid via x402: $0.005 in USDC on Base (eip155:8453) to 0x973a31858f4d2125f48c880542da11a2796f12d6. Returns 402 with payment requirements; pay and retry.

## Output

Returns one or more candidate human-readable function signatures (e.g. 'transfer(address,uint256)') that match the provided 4-byte selector, sourced from the 4byte.directory database.

## 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"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "selector"
     ],
     "properties": {
      "selector": {
       "type": "string",
       "description": "Function selector"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-bazaar-evm-function-selector-decoder-dea9ff2b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relai.fi](https://www.zero.xyz/host/api.relai.fi/llms.txt)
