# Ethereum Bytecode Similarity Radar

> Ethereum Bytecode Similarity Radar is a paid API for AI agents from api.fadeandco.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-29).

Compares the runtime bytecode of two Ethereum contracts by computing Jaccard similarity of PUSH4 function selectors and cosine similarity of opcode frequencies, returning a combined 0–1 score with a SIMILAR, PARTIAL, or DIFFERENT label.

## Facts

- Endpoint: GET https://api.fadeandco.workers.dev/api/agent-intel/bytecode-similarity-radar?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ethereum-bytecode-similarity-radar-8454ee2e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VR96WTRg5JPnT_wXuivtu

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-bytecode-similarity-radar-8454ee2e
```

Example prompt: Compare the bytecode of these two Ethereum contracts and tell me how similar they are: 0x6982508145454ce325ddbe47a25d4ec3d2311933 and 0xdac17f958d2ee523a2206206994597c13d831ec7 — give me the score and whether they're SIMILAR, PARTIAL, or DIFFERENT.

## When to prefer this

Use this endpoint when you need a fast, on-demand pairwise bytecode similarity check between two specific Ethereum contract addresses and want a quantified score (not just a yes/no). It is ideal for clone detection leads, fork investigation, or pre-audit screening. Prefer this over manual decompilation when speed matters. Note: this endpoint does NOT match against any database of known scam or exploit templates — it only tells you how similar two specific contracts are to each other.

## Known failure modes

- Invalid or malformed Ethereum address (not 40 hex chars after 0x) returns an error
- Contract address with no deployed bytecode (EOA or non-existent contract) may return empty bytecode error
- RPC node (publicnode.com) unavailable or rate-limited causes a fetch failure
- Network timeout if public RPC is slow
- Missing required query params `a` or `b` returns a 400-level error

## How this service works

Compares the runtime bytecode of two Ethereum contracts you name: the share of shared PUSH4 function selectors (Jaccard) and the cosine similarity of their opcode frequencies, combined into one 0 to 1 score with a SIMILAR, PARTIAL or DIFFERENT label. It compares two addresses only; it has no database of known scam or exploit templates, so it cannot say a contract is a known clone.

## Output

Returns a JSON object with: a combined similarity score (0–1), a categorical label (SIMILAR, PARTIAL, or DIFFERENT), the Jaccard similarity of shared PUSH4 function selectors, the cosine similarity of opcode frequency vectors, the number of shared selectors, total selectors per contract, bytecode size in bytes for each contract, the RPC source used, and the timestamp of the check. Also includes a disclaimer that this is a pairwise comparison only, not a match against a scam/exploit template 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "First contract address 0x... (40 hex)"
      },
      "b": {
       "type": "string",
       "description": "Second contract address 0x... (40 hex)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "a": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
  "b": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "note": "Pairwise comparison of two given contracts only. Not a database of known scam templates; a SIMILAR label is a lead for review.",
  "label": "PARTIAL",
  "score": 0.559,
  "bytesA": 4517,
  "bytesB": 11075,
  "source": "https://ethereum-rpc.publicnode.com",
  "checkedAt": "2026-10-23T09:35:17.855Z",
  "selectorsA": 25,
  "selectorsB": 36,
  "opcodeCosine": 0.898,
  "selectorJaccard": 0.22,
  "sharedSelectors": 11
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ethereum-bytecode-similarity-radar-8454ee2e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fadeandco.workers.dev](https://www.zero.xyz/host/api.fadeandco.workers.dev/llms.txt)
