V

Verifiable Random Tools · Dice

by Verifiable Random Tools

POSTBaseArbitrumPolygon

$0.005

per call · USD Coin on Base

Verifiable Random dice — unbiased dice rolls bound to a future drand round the server waits for (typically 3-6s) and verifies locally, with a reproducible proof transcript.

Endpoint

POST https://verifiable-random.use.x402atlas.com/dice

3

Calls / 30d

2

Unique payers / 30d

Sep 1

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://verifiable-random.use.x402atlas.com/dice", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "algorithm_version": "drand-hkdf-sha256-v1",
    "client_seed": "campaign-42",
    "count": 3,
    "sides": 20,
    "target_round": 0
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://verifiable-random.use.x402atlas.com/dice" \
  -H "Content-Type: application/json" \
  -d '{"algorithm_version":"drand-hkdf-sha256-v1","client_seed":"campaign-42","count":3,"sides":20,"target_round":0}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "algorithm_version": "drand-hkdf-sha256-v1",
  "beacon": {
    "chain_hash": "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971",
    "network": "quicknet",
    "randomness": "1466a6cd24e327188770752f6134001c64d6efcc590ccc26b721611ad96f165a",
    "round": 1,
    "scheduled_time": "2023-08-23T15:09:27Z",
    "scheme": "bls-unchained-g1-rfc9380",
    "signature": "b55e7cb2d5c613ee0b2e28d6750aabbb78c39dcc96bd9d38c2c2e12198df95571de8e8e402a0cc48871c7089a2b3af4b"
  },
  "example_only": true,
  "operation": "dice",
  "processed_at": "2023-08-23T15:09:27Z",
  "request_hash": "b204a373d565d666efc9c4f9d522878082c35a8eb654d5da470bc2360aaaa374",
  "result": {
    "maximum": 19,
    "minimum": 11,
    "total": 44,
    "values": [
      14,
      19,
      11
    ]
  },
  "selection_mode": "example_only",
  "target_round": 1
}

Payment details

Pay to0x8c128f1ee62bb5e47867cfbae2ad89be325df1b2
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Arbitrum, Polygon
Schemesexact

Is this your API?

Pin it to the top of Games & Fun and the homepage with a featured placement.

Get featured →

More from Verifiable Random Tools & similar services