---
name: revert.wtf
description: revert.wtf provides two EVM debugging utilities: one resolves 4-byte function or error selectors to human-readable signatures, and another diagnoses raw EVM or JSON-RPC error payloads into structured root causes and remediation steps. Together they help agents and developers make sense of opaque on-chain failures.
host: revert.wtf
---

# revert.wtf

revert.wtf is a narrow, developer-focused host targeting EVM debugging workflows. It serves agents that encounter unknown selectors in calldata or revert data, and agents that receive raw transaction errors and need structured diagnosis. It does not provide ABI decoding, on-chain state queries, transaction simulation, or general blockchain data access.

## When to use this host

Use revert.wtf when an agent needs to decode an unknown 4-byte selector from calldata, revert data, or event logs, or when it needs structured diagnosis of a raw EVM or JSON-RPC error. Do not use it for full ABI decoding of calldata arguments or return values, for reading on-chain state, for simulating transactions, or for fetching transaction receipts. For full ABI encoding and decoding, use a dedicated ABI utility or ethers/viem libraries. For on-chain data, use an RPC provider or indexer host.

## Capabilities

### Selector Resolution

Resolves an opaque 4-byte EVM selector to its human-readable function or error signature, including the source and a confidence score. Foundational for understanding what a piece of calldata or revert payload is referring to.

- **`resolve-evm-selector`** — Resolves a 4-byte EVM function or error selector to its human-readable signature, name, and source.

### EVM Error Diagnosis

Accepts a raw EVM transaction error or JSON-RPC error payload and returns structured analysis including normalized error data, root causes, likely causes, next steps, and retry or gas-increase guidance.

- **`explain-evm-error`** — Accepts a raw EVM or JSON-RPC error payload and returns structured explanations with root causes, likely causes, next steps, and retry guidance.

## Workflows

### Revert Selector Decode and Explain

*Use when an agent receives a raw revert payload containing an unknown 4-byte selector and needs both the human-readable signature and a full structured diagnosis of what went wrong.*

1. **`resolve-evm-selector`** — Extract the 4-byte selector from the revert data and resolve it to a human-readable error signature and name.
2. **`explain-evm-error`** — Pass the full raw revert payload to get structured root cause analysis, likely causes, next steps, and retry guidance, now interpretable in context of the resolved signature.

## Skill reference

### `resolve-evm-selector`

**EVM Selector Resolver** — Resolves a 4-byte EVM function or error selector to its human-readable signature, name, and source.

*Use when:* Use when an agent needs to decode an unknown 4-byte EVM selector (e.g. from a revert reason, calldata, or event log) into its corresponding function or error signature.

*Not for:* Do not use for full ABI decoding of calldata or return values; this only resolves the 4-byte selector to a signature, not the full argument payload.

**Inputs:**

- `selector` (string, required) — 4-byte EVM selector as a 0x-prefixed hex string.

**Returns:** Returns a JSON array with one object containing the selector, its resolved signature (e.g. Error(string)), name, source, and confidence level.

**Example:** `{"selector": "0x08c379a0"}`

---

### `explain-evm-error`

**x402 Explainer** — Accepts a raw EVM or JSON-RPC error payload and returns structured explanations with root causes, likely causes, next steps, and retry guidance.

*Use when:* Use when an agent or user receives an EVM transaction error, JSON-RPC error, or revert message and needs structured diagnosis including root cause, actionable next steps, and whether retrying or increasing gas will help.

*Not for:* Do not use for decoding successful transaction receipts or fetching on-chain state; this endpoint is only for diagnosing error payloads.

**Inputs:**

- `raw` (string, required) — Raw error payload as a JSON-encoded string (e.g. a JSON-RPC error object with code and message fields).

**Returns:** Returns a normalized error breakdown and an explanations array with catalog-matched entries including root cause, likely causes, next steps, and whether retry or gas increase will help.

**Example:** `{"raw": "{\"code\":-32000,\"message\":\"nonce too low\"}"}`

---
