# B20 Token Memo Decoder

> B20 Token Memo Decoder is a paid API for AI agents from agent402.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Fetches and decodes payment memos attached to B20 token transfers, pairing each Memo log with its corresponding Transfer log by transaction hash or block window scan.

## Facts

- Endpoint: GET https://agent402.tools/api/b20-memos
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/b20-token-memo-decoder-5d5ad96f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HJkbdG8B9J_LOeexp46Ni

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 b20-token-memo-decoder-5d5ad96f
```

Example prompt: Show me all the payment memos from this B20 transfer transaction — the token address is 0xb200abc123... and the tx hash is 0xdeadbeef... — decode both the hex and the human-readable memo text.

## When to prefer this

Use this endpoint when you need to read structured memo data attached to B20 token transfers on-chain, either for a specific transaction or across a recent block window. It is the right choice when you want to decode both raw hex memos and human-readable text from B20 Memo logs paired with their Transfer events. Prefer this over generic blockchain explorers when you specifically need the memo-transfer pairing logic already handled.

## Known failure modes

- Missing or invalid token address (must have 0xb200 prefix) — returns 400 error
- Invalid transaction hash format — returns 400 or empty results
- Transaction hash not found on-chain — returns empty memo list
- Block window exceeds 200000 blocks — returns 400 error
- No Memo logs found in the specified tx or block range — returns empty array
- Token address does not match B20 contract format — returns error or empty results

## How this service works

Payment memos attached to B20 transfers: pairs each Memo(address,bytes32) log with its Transfer at the previous log index (same tx, same token). Give a tx hash for one transaction, or scan a block window. Returns memoHex always and memoText when printable UTF-8. ?token=0xb200…&tx=0x…|&blocks=50000&address=0x…&limit=50

## Output

Returns a list of memo records, each containing memoHex (always present), memoText (when parseable as UTF-8), paired Transfer log details (from/to addresses, amount), and the transaction hash — up to the specified limit (default 50).

## 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": [
      "token"
     ],
     "properties": {
      "tx": {
       "type": "string",
       "description": "optional: decode memos in this transaction only"
      },
      "limit": {
       "type": "number",
       "description": "max memo rows (default 50, max 200)"
      },
      "token": {
       "type": "string",
       "description": "B20 token address (must carry the 0xb200 prefix)"
      },
      "blocks": {
       "type": "number",
       "description": "window-scan lookback (default 50000, max 200000; ignored when tx is given)"
      },
      "address": {
       "type": "string",
       "description": "optional: only transfers where from or to equals this address"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "token",
      "mode",
      "fromBlock",
      "toBlock",
      "scannedFromBlock",
      "truncated",
      "count",
      "memos"
     ],
     "properties": {
      "mode": {
       "type": "string"
      },
      "count": {
       "type": "integer"
      },
      "memos": {
       "type": "array"
      },
      "token": {
       "type": "string"
      },
      "toBlock": {
       "type": "integer"
      },
      "fromBlock": {
       "type": "integer"
      },
      "truncated": {
       "type": "boolean"
      },
      "scannedFromBlock": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "window",
  "count": 0,
  "memos": [],
  "token": "0xb200…0001",
  "toBlock": 2,
  "fromBlock": 1,
  "truncated": false,
  "scannedFromBlock": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/b20-token-memo-decoder-5d5ad96f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
