# 4-Byte Function Selector Decoder

> 4-Byte Function Selector Decoder is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Resolves a 4-byte Ethereum function selector or calldata prefix to candidate human-readable ABI function signatures via 4byte.directory

## Facts

- Endpoint: GET https://402.com.tr/api/x402/decode-selector
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/4-byte-function-selector-decoder-4dc1340a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_efB1IcnNRI-MdWJQ0Pq0z

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 4-byte-function-selector-decoder-4dc1340a
```

Example prompt: What function does the Ethereum selector 0xa9059cbb map to? Decode it and give me the matching ABI signatures.

## When to prefer this

Use this endpoint when you have a raw 4-byte function selector or calldata from an Ethereum transaction and need to identify the human-readable function name and signature. Prefer this over manual ABI lookups when the contract ABI is unavailable, or when auditing unknown transactions before signing. It is the fastest path from raw calldata to a readable function name.

## Known failure modes

- Selector not found in 4byte.directory database — returns empty results for novel or obscure functions
- Invalid selector format (non-hex, wrong length) — returns 400 error
- Network or upstream 4byte.directory unavailability — returns 5xx error
- Hash collision returns multiple conflicting signatures — caller must disambiguate from context

## 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.

## Output

Returns one or more candidate human-readable Solidity function signatures (e.g. 'transfer(address,uint256)') that match the given 4-byte selector, sourced from the 4byte.directory registry. Multiple candidates may be returned if hash collisions exist.

## 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
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/4-byte-function-selector-decoder-4dc1340a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
