> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinematic.run/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These are the customer docs for kinematic, a name written in lowercase except at the start of a sentence. Kinematic provides provably fair casino games, served to a casino's site by a game server: a Cloudflare Worker that the kinematic dashboard deploys into the casino's own Cloudflare account.
> Never put SESSION_SECRET or WALLET_SECRET in code, prompts, logs, commits or chat. Read them from environment variables and ask the person you work with to set them. The dashboard's Integration page shows each secret once.
> Values such as lucky-star, luckystar.example, og-rgs-lucky-star.luckystar.workers.dev, games.luckystar.example and player_48213 are examples. Use the casino's own casino ID, game server origin, element tag, session issuer and currencies: the Instructions for your coding agent on the dashboard's Integration page hold them, or ask the person you work with.
> To debug, start at https://docs.kinematic.run/troubleshooting and https://docs.kinematic.run/reference/errors. The wallet contract is at https://docs.kinematic.run/api/wallet.openapi.yaml.
> Sandbox bets are recorded on Solana devnet. Live game servers record nothing on Solana until the audited mainnet program is deployed.

# Provably fair

> Each outcome comes from your casino's VRF key, the player's signed bet and a seed revealed only after acceptance, and players check every step in the Provably fair dialog.

Every outcome is the output of a verifiable random function (VRF): your casino's VRF key evaluated over the player's own signed bet and a seed that the player's browser keeps secret until your game server has accepted the bet. The game engine turns that output into the result. Anyone with the bet's records and the published engine can recompute it.

## The guarantees

* **Neither you nor kinematic chose the outcome.** The VRF output is the only valid output for the player's signed bet and seed under the key the acceptance named, and the engine computes the result from it.
* **Your casino could not know the outcome before it accepted the bet.** The seed stays in the browser until the signed acceptance arrives, and the acceptance fixes the key, the game rules, the engine build and the terms. A refusal after acceptance is itself signed: the bet then ends refunded, never lost.
* **The player authorized the bet and each action.** Every bet and action carries the player's signature with a key kept in their browser.

## Your VRF key

Your game server generates its VRF key the first time it needs one, and keeps the secret in its own storage in your Cloudflare account. No route returns it, nothing logs it, and nobody can set or read it, kinematic included.

The game server publishes every key it has used, with its validity window, at `GET <game server>/v1/catalog` under `vrf.keys` and in every signed game manifest. A rotation lists the next key two minutes before it takes over, so every browser knows it in advance. Retired keys stay listed: each bet stays verifiable under the key its acceptance named.

## What players check

The element's **Provably fair** button opens a dialog in your theme with three tabs.

**Proofs** checks each of the player's bets in the browser, one row per check:

* the player's signature on the bet and on each action,
* your game server's signatures on each record, and the links between records,
* the acceptance came before the reveal and names the bet, its seed hash and its key,
* the revealed seed matches the hash the player signed,
* the VRF proof verifies under your key, and the output derives from it,
* the engine build that settled the bet recomputes the same result,
* once recorded, the bet's Solana transaction contains this bet.

A bet still in play shows as waiting for its outcome, not as verified.

**Odds** shows the game's return to player and the chance of every payout, computed in the browser from your signed payout table at the settings on screen. Its check rows confirm that the table matches the engine's code and carries your game server's signature. See [Return to player](https://docs.kinematic.run/concepts/return-to-player.md).

**Client seed** lets the player add their own text to every later bet's seed, and lists your VRF keys with each key's ID checked in the browser.

## Solana records

In sandbox, your game server records every bet whose proof is disclosed on Solana devnet, after the bet settles. Live game servers record nothing on Solana until the audited mainnet program is deployed.

A record is a transaction of the `og-vrf-record` program, signed by your game server's own Solana address. Before it records a bet, the program checks the VRF proof against the key your game server registered for that time. Anyone can then read from the chain that your key produced a valid proof for that bet, and which receipt your game server committed to, at the transaction's time. The dialog's Proofs tab links the transaction and checks that it matches the bet.

A record adds a public, timestamped commitment. It does not prove that every bet was recorded, that the record's time is the bet's time, or that a payout reached a wallet.

## What the proofs do not prove

* That a winning round's payout reached the player's wallet. A credit can be late; your wallet's ledger is the record of payment.
* That the operator is solvent, who the player is in the real world, or that the server's clock is fair.
* That every bet the server received was accepted. A server can refuse a bet before it accepts it.
* That a server which stops answering after a reveal paid the win. Such a bet is abandoned after 24 hours and its stake refunded.

One risk sits with the casino: an insider who holds the casino's VRF key and colludes with a player who shares their seed before betting could know outcomes in advance. Protect access to your Cloudflare account as you would any system that decides money.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.