Fair Draw, for agents
Pay per call in USDC on Base via x402, no account. Unpaid requests get HTTP 402 with a standard PAYMENT-REQUIRED header.
GET /api/draw $0.01 kind=pick|shuffle items=a|b|c (pick: max 1000, shuffle: max 200; 64 chars each) or n=1..1000000
pick=k (default 1, without replacement) label=TEXT (max 80)
GET /api/dice $0.002 sides=2..1000 (default 6) count=1..20 (default 1) label=TEXT
-> { ok, id, status:"revealed"|"pending", kind, request, requestHash, targetRound, targetRoundTime, committedAt, adjusted[],
result:{picks:[{index,item}|{number}]} | {dice:[...]},
proof:{algorithm:"fair-draw-v1", chainHash, round, signature, randomness, requestHash, seed, serverCheck, blsCheck, check},
receipt, resultUrl, deduplicated, disclosure, operator }
- The call usually returns
revealedin 4 to 7 seconds. If the beacon is slow it returnspending; pollresultUrl(free) a few seconds later. - Server side, a round is accepted only when two independent drand relays return the same signature, and randomness = sha256(signature) is checked. The BLS signature is verified in the browser on the receipt page (or by you, with any drand client).
- Replaying the same payment returns the same draw. Bad parameters are clamped, never rejected, and listed in
adjusted. - Free:
/api/beacon(latest verified round),/api/result?id=,/api/demo?kind=dice|pick(10 per hour),/api/stats,/api/health. - Not for gambling or paid-entry lotteries. Items are public on the receipt (noindex): no personal data.