# Ethereum Function Selector & Event Topic Decoder

> Ethereum Function Selector & Event Topic Decoder is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Translates a 4-byte function selector or 32-byte event topic hash into its human-readable Solidity signature by looking it up in the 4byte.directory database.

## Facts

- Endpoint: POST https://api.vextorium.com/decodificar-firma-pago?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ethereum-function-selector-event-topic-decoder-b3899409
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_58Xgf_Vwdpg0BqpbY8DjH

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 ethereum-function-selector-event-topic-decoder-b3899409 -d '<json body>'
```

Example prompt: Can you tell me what Solidity function or event corresponds to the selector 0xa9059cbb? I'm trying to understand what a transaction is calling on an ERC-20 contract.

## When to prefer this

Use this endpoint when an AI agent needs to interpret raw Ethereum transaction calldata or event logs and must identify what function or event a hex hash represents. Prefer this over manual ABI lookups when the full ABI is unavailable and the selector or topic needs to be reverse-engineered. Ideal for transaction monitoring, fraud detection, DeFi analytics, or any workflow where human-readable contract interaction context is needed from raw on-chain data.

## Known failure modes

- Unknown selector — hash not found in 4byte.directory returns empty or null firmas array
- Invalid hex format — input not matching 4-byte (0x + 8 hex chars) or 32-byte (0x + 64 hex chars) format returns error
- Multiple ambiguous matches — some selectors map to more than one signature, all candidates returned
- Network timeout connecting to 4byte.directory upstream
- Payment authorization failure for x402 micropayment

## How this service works

Translates a 4-byte function selector (e.g. 0xa9059cbb) or a 32-byte event topic into its human-readable signature (e.g. transfer(address,uint256)). Essential for an agent reading or verifying transactions. Live from 4byte.directory.

## Output

Returns a JSON object with the decoded signature(s) as an array of possible human-readable strings (e.g. 'transfer(address,uint256)'), the type (function or event), a code, the source (4byte.directory), the number of possible matches, and an optional note if multiple candidates 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "firma"
     ],
     "properties": {
      "firma": {
       "type": "string",
       "description": "Function selector (0x + 8 hex) or event topic (0x + 64 hex)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": [
      "object",
      "null"
     ],
     "properties": {
      "nota": {
       "type": [
        "string",
        "null"
       ]
      },
      "tipo": {
       "type": [
        "string",
        "null"
       ]
      },
      "codigo": {
       "type": [
        "string",
        "null"
       ]
      },
      "firmas": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": [
         "null",
         "string"
        ]
       }
      },
      "fuente": {
       "type": [
        "string",
        "null"
       ]
      },
      "posibles": {
       "type": [
        "number",
        "null"
       ]
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "nota": "Un mismo código puede casar con varias firmas (colisiones); la más antigua suele ser la real. Fuente: 4byte.directory.",
  "tipo": "funcion",
  "codigo": "0xa9059cbb",
  "firmas": [
   "transfer(address,uint256)",
   "many_msg_babbage(bytes1)",
   "transfer(bytes4[9],bytes5[6],int48[11])",
   "func_2093253501(bytes)",
   "join_tg_invmru_haha_fd06787(address,bool)",
   "workMyDirefulOwner(uint256,uint256)"
  ],
  "fuente": "4byte.directory",
  "posibles": 6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ethereum-function-selector-event-topic-decoder-b3899409/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
