# Plainchain Verifiable Random Number Generator

> Plainchain Verifiable Random Number Generator is a paid API for AI agents from plainchain.appin60.com, paid per call via x402, $0.001042/call, status unknown (last checked 2026-10-14).

Returns a cryptographically verifiable random number derived from on-chain block hash, with optional dice and coin-flip results, on Base, Arbitrum, Ethereum, or Optimism.

## Facts

- Endpoint: GET https://plainchain.appin60.com/v1/random?utm_source=zero.xyz
- Price: $0.001042/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/plainchain-verifiable-random-number-generator-e6cd4c74
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yt6bjb8CzaBBGTaYdhmTq

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 plainchain-verifiable-random-number-generator-e6cd4c74
```

Example prompt: Roll a 20-sided die using on-chain randomness from Base — I need a verifiable result for a raffle I'm running with ID 'summer2025'.

## When to prefer this

Choose this endpoint when you need cryptographically verifiable, on-chain randomness that can be independently audited via block hash — ideal for lotteries, raffles, games, or any scenario where tamper-proof fairness is required. Prefer it over pseudo-random generation when the result must be publicly verifiable. It supports multiple EVM chains (Base, Arbitrum, Ethereum, Optimism) and requires no API key, paying per call in USDC via x402.

## Known failure modes

- Invalid chain identifier returns an error
- max or sides value out of allowed range (sides must be 2-1000, max must be >= 1) returns a validation error
- Payment failure via x402 (insufficient USDC balance or wrong network) results in 402 response
- Network/RPC issues on the target chain may cause delayed or failed block hash retrieval

## How this service works

Gas, balances, token data, address type, approvals, transaction decoding, x402 receipt verification and verifiable randomness on Base, Arbitrum, Ethereum and Optimism. No API key: pay $0.001-$0.01 per call in USDC on Base via x402.

## Output

A JSON object containing: a random integer (int) in the requested range, the max value used, a coin flip string ('heads' or 'tails'), a dice roll integer, the block number and block hash from which the randomness is derived, the chain name, and the number of dice sides — all sourced from on-chain data for verifiability.

## 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": [],
     "properties": {
      "max": {
       "type": "string",
       "description": "integer range 1..max (default 100)"
      },
      "salt": {
       "type": "string",
       "description": "optional salt, e.g. a raffle id"
      },
      "chain": {
       "type": "string",
       "description": "base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"
      },
      "sides": {
       "type": "string",
       "description": "dice sides, 2-1000 (default 6)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "int": 57,
  "max": 100,
  "coin": "heads",
  "dice": 4,
  "block": 36581662,
  "chain": "Base",
  "sides": 6,
  "blockHash": "0x9c1e..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/plainchain-verifiable-random-number-generator-e6cd4c74/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from plainchain.appin60.com](https://www.zero.xyz/host/plainchain.appin60.com/llms.txt)
