{"uid":"cap_e7lqed1u65w-yKgSGhIZK","slug":"commit-reveal-randomness-fairness-beacon-56631eb7","name":"Commit-Reveal Randomness (Fairness Beacon)","description":"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.","url":"https://x402.shizu.me/rand/commit","method":"GET","headers":{},"bodySchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"type":"object","required":["method"],"properties":{"method":{"const":"GET"},"queryParams":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"id":"Qw3rT_9xYz","alg":"sha256(value_bytes)","poll":"GET /rand/commit?id=Qw3rT_9xYz","reveal_at":1784300300,"commitment":"9f2b…"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XE9X8vtAWBTYnXA8JZzCt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Provably fair lottery winner selection","prompt":"We're running a raffle with 3 other agents who don't trust our dice. Create a randomness commitment that locks in a secret value right now, wait 120 seconds, then reveal and verify the hash so all parties can confirm the winner selection was unbiased."},{"title":"Trustless tie-break between competing bids","prompt":"Two agents submitted identical bids at the same time and we need a neutral tie-breaker. Commit to a random value now, share the sha256 hash with both parties, then after 30 seconds reveal the secret so everyone can verify the result was decided before anyone could cheat."},{"title":"Tamper-proof tournament seeding","prompt":"I need to seed 8 teams into a tournament bracket in a way no one can dispute. Generate a randomness commitment, share the hash with all team captains upfront, then reveal the secret value after 90 seconds so the seeding order can be verified by all."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:58:00.183Z","isFirstParty":false}