Trust by construction

Verifiable racing

Most online games are a black box: you submit moves, a server tells you the result, you trust it. Lucky Races inverts that — the rules of every race are public, the inputs are on-chain, and the outcome is a deterministic function. Anyone with the inputs can re-run the race and confirm the result.

What “deterministic” means here

A Lucky Races result is the output of a single function:

race_result = race_engine(
  initial_seed,        // committed at race start
  track_id,            // chosen at lobby creation
  racer_ids[],         // chosen by each player
  turns[player][turn], // the cards each player locks in
)

No hidden RNG, no “server says you lost”, no engine-side mutation. The same inputs always produce the same finish positions, the same lap times, the same item drops. Replays are byte-exact reproductions of the live race because the engine is the same code in both places.

How you verify a race

  1. Pull the race’s on-chain inputs (seed, track, racers, turns) from the diamond. Anyone can call getRaceInputs(raceId).
  2. Run the same race engine off-chain. The reference implementation lives in raceReplayEngine.ts — a TypeScript engine that mirrors the on-chain Solidity exactly.
  3. Compare the result. If the finish positions match, the race is verified. The replay UI does this automatically; the “Verified” badge on a replay means the off-chain engine reproduced the on-chain finish.

Verify any race in one click

Drop a race ID into the verification page below and we run the full re-execution in your browser. Result is shown alongside the on-chain outcome — green ✓ when they match, red diff when they don’t.

Why this matters