Guides

RNG certification for gaming: what labs test and how

Quip Network
·3 min read

A gaming RNG gets certified when an independent test lab, such as GLI or eCOGRA, reviews its source code and seeding, then runs statistical tests on its output. The lab measures the results against the technical standard of the regulator in each market, and the UK and Ontario standards both demand uniform, unpredictable output with correct scaling to the game's range.

The lab's checklist

eCOGRA describes itself as "an independent test lab with no affiliation to the gambling platform." Its RNG certification page lists these stages:

  • source code review
  • statistical analysis of the RNG's output over many iterations
  • seed generation
  • algorithm testing
  • the hardware and software environment the RNG runs in

GLI's RNG guide adds detail to the general analysis. Its evaluations typically assess the RNG's period and range, investigate seeding and re-seeding, and inspect background cycling. Depending on the type of RNG, they also include the DIEHARD battery of tests and outcome distribution tests. GLI says its method covers pseudorandom and true RNGs alike.

Neither page gives sample sizes or pass thresholds. Of the two regulators below, only Ontario names its tests and a confidence level.

UK and Ontario requirements side by side

The UK Gambling Commission sets its rules in section 2 of its technical requirements. The Alcohol and Gaming Commission of Ontario (AGCO) sets its rules in section 5 of its standards.

Requirement UK Gambling Commission AGCO (Ontario)
Distribution Uniform over the entire output range (2.1a) Each number equally likely across the range (5.1.1)
Prediction Unpredictable even with full knowledge of the algorithm or hardware (2.1b) Unpredictable (5.1.1), with a mechanism to stop anyone working out the seeds (5.1.4)
Patterns No repeating cycle, and two instances must not synchronise (2.1c) No detectable pattern or correlation with earlier output (5.1.3)
Seeding Seeding and re-seeding add no predictability (2.1d) Seed reinitialized if corrupted (5.1.5)
Scaling Scaled output still meets 2.1a to d (2.1e), and every number in the smaller range is equally probable (2.3) Output range matches the game's range (5.1.2)
Named tests Generally accepted statistical tests, none named (2.1) Frequency, runs and serial correlation tests, inside a 99% confidence interval (5.1.2)
Physical RNGs Materials resist decomposition, and the random items keep their physical properties (2.2) Items such as balls equal in size and mass, resistant to degradation, and replaced within any defined life cycle (5.1.10)
Failures Outside section 2 An interrupted selection is preserved, and dependent functions stay off until a failure is fixed (5.1.6, 5.1.7)

A worked frequency test for roulette

A frequency test counts how often each outcome comes up. A common way to run one is the chi-square goodness-of-fit test. For each outcome, the tester takes the gap between the observed and expected counts, squares it, divides by the expected count, and adds up the results (NIST handbook). A European wheel has 37 pockets, so the test has 36 degrees of freedom. At 99% confidence, the cutoff for 36 degrees of freedom is 58.619 (NIST table). A statistic above 58.619 fails.

Quip calculated the figures below from byte counts. They test two mappings from random bytes to a pocket, both covered in the casino RNG post:

  1. One byte, byte % 37. Pockets 0 to 33 each get 7 of the 256 byte values, and pockets 34 to 36 get 6. Over 370,000 spins, a pocket in the first group expects about 10,117 hits, and a pocket in the second group expects about 8,672. A correct wheel expects 10,000 for every pocket. Those gaps alone add about 576 to the statistic. Chance contributes about 36 more on average, so a lab would expect a total near 612, far above 58.619. On average, the statistic crosses the cutoff once the sample grows past about 14,500 spins.
  2. Four bytes, floor(f × 37). Seven pockets get one extra input out of about 116 million. With this mapping, the statistic would cross the cutoff on average only after about 2 × 10^18 spins.

UK rule 2.3, which requires equal probability after scaling, addresses the error in the first mapping.

Certification after launch

eCOGRA calls RNG assessment "an ongoing process." Labs may run spot checks or re-certify at regular intervals, and may keep monitoring an RNG after certifying it. Its page gives no fixed interval (eCOGRA). GLI also describes continuous monitoring and re-testing without naming a schedule (GLI).

Randomness for on-chain games

Games running as smart contracts take their random numbers from an oracle. QVRF, Quip Network's randomness service, delivers values from measurements on quantum hardware and lists gaming and lotteries among its uses. A contract requests random values and receives them later through a callback (QVRF docs). Quip publishes a commitment to the values on chain before delivery, so the operator could withhold a value but could not swap one without detection (QVRF docs).

The first version of QVRF has these limits:

  • Centralized. Quip operates both the randomness generator and the delivery service (QVRF docs).
  • Off-chain verification. Verifiers check a sample of the quantum measurements after delivery, outside the chain (QVRF docs). On-chain verification contracts are in development and will let a contract check a transcript directly (quip.network/qvrf).
  • No lab certification yet. quip.network/qvrf names no testing-lab certification for QVRF.

The on-chain randomness post compares the oracle methods by who can bias each one.

Next step

To check whether QVRF's trust model suits a game, read the QVRF docs, then request access at quip.network/qvrf.

Share
Filed underGuides
Newsletter

Don't miss an update

Get new posts and project updates delivered to your inbox. No spam, unsubscribe anytime.