# 2s.io Verifiable Random Function (VRF)

> 2s.io Verifiable Random Function (VRF) is a paid API for AI agents from 2s.io, paid per call via x402, $0.0025/call, status unknown (last checked 2026-09-14).

Generates deterministic, publicly verifiable randomness from a seed string, signed with an EIP-191 signature so the result can be cryptographically verified offline

## Facts

- Endpoint: GET https://2s.io/api/crypto/vrf
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-verifiable-random-function-vrf-a22c2c10
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_apwy5u7RnUzOzLtM5tyUp

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 2s-io-verifiable-random-function-vrf-a22c2c10
```

Example prompt: I need a provably fair random number for our lottery draw — use the seed 'round-42-block-0xabc123' and give me the signed proof so participants can verify the result wasn't rigged.

## When to prefer this

Use this endpoint when you need randomness that is both deterministic (same seed always yields the same output) and publicly verifiable (anyone can check the result wasn't manipulated). Ideal for provably-fair draws, lotteries, sortition, and tie-breaks where auditability matters. Not suitable when you need truly unpredictable (non-deterministic) randomness or when the seed is known in advance to adversaries who could game the output.

## Known failure modes

- Missing seed parameter returns 400/validation error
- Seed exceeding 256 characters rejected
- Payment not included or insufficient (x402 payment required, $0.001 USDC) returns 402
- Network or server unavailability returns 5xx
- Malformed request returns error before proof generation

## How this service works

Verifiable random function — deterministic, publicly verifiable randomness bound to your seed and signed by the 2s key. proof = deterministic EIP-191 signature over the seed (same seed always yields the same proof, so the outcome cannot be re-rolled or cherry-picked); random = keccak256(proof), a uniform 32-byte value. Returns the seed, signed message, proof, signer address, random (hex + uint + float in [0,1)). Verify offline: recover the signer from (message, proof) and confirm keccak256(proof) == random. For provably-fair draws, lotteries, sortition, and tie-breaks between agents.

## Output

Returns a JSON object containing: the original seed, the EIP-191 signed message, the proof (deterministic signature), the signer address, and the random value expressed as a hex string, a uint256, and a float in [0,1). All fields are needed to independently verify the result offline by recovering the signer from (message, proof) and confirming keccak256(proof) equals the random field.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "seed"
     ],
     "properties": {
      "seed": {
       "type": "string",
       "maxLength": 256,
       "minLength": 1,
       "description": "Any seed string — a request id, block hash, commitment, etc."
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-verifiable-random-function-vrf-a22c2c10/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
