# Commit-Reveal Randomness (Fairness Beacon)

> Commit-Reveal Randomness (Fairness Beacon) is a paid API for AI agents from x402.shizu.me, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Generates a cryptographically committed random value that can be revealed and verified later, enabling provably fair draws, tie-breaks, and ordering between mutually distrusting parties.

## Facts

- Endpoint: GET https://x402.shizu.me/rand/commit
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/commit-reveal-randomness-fairness-beacon-56631eb7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e7lqed1u65w-yKgSGhIZK

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 commit-reveal-randomness-fairness-beacon-56631eb7
```

Example prompt: Create a commit-reveal randomness beacon that will be revealable in 60 seconds — share the commitment id and sha256 hash with all parties now, then reveal the secret value after the delay so everyone can verify it was fixed before the draw.

## When to prefer this

Choose this endpoint when two or more parties distrust each other's random number generators and need a cryptographic proof that a random value was fixed before anyone acted on it. It is ideal for on-chain or agent-to-agent lotteries, fair ordering, tournament seeding, and tie-breaking. Prefer this over plain /rand when auditability and commitment proofs matter. Use plain /rand for one-shot entropy where no counterparty verification is needed.

## Known failure modes

- Requesting reveal before reveal_at timestamp — returns error indicating value not yet available
- Invalid or unknown id on GET — returns not found error
- Network timeout before commitment is stored — caller must retry to get a valid id
- Commitment id already revealed — subsequent GET calls may return the same value (idempotent reveal)
- Micropayment failure or insufficient USDC balance — x402 payment rejection before request is processed

## How this service works

Randomness that is provably fixed before anyone acts on it. POST {reveal_after?: seconds} returns an id and a sha256 commitment to a secret 32-byte value; share them with counterparties, then after reveal_at ANY payer can GET ?id= to read the value and verify it hashes to the commitment. For fair draws, tie-breaks, and ordering between agents that don't trust each other's dice. Plain one-shot entropy: /rand.

## Output

On POST/commit: returns a unique id and a sha256 hash (commitment) to a secret 32-byte random value, plus a reveal_at timestamp. On GET with ?id=: returns the original secret value so any party can hash it themselves and confirm it matches the prior commitment, proving the value was fixed before the reveal window.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      }
     },
     "required": [
      "id"
     ]
    }
   },
   "required": [
    "method"
   ]
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "Qw3rT_9xYz",
  "alg": "sha256(value_bytes)",
  "poll": "GET /rand/commit?id=Qw3rT_9xYz",
  "reveal_at": 1784300300,
  "commitment": "9f2b…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/commit-reveal-randomness-fairness-beacon-56631eb7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.shizu.me](https://www.zero.xyz/host/x402.shizu.me/llms.txt)
