Skip to content

BMM-Certified RNG

Certification Chain

The Math Engine uses a BMM-certified random number generator for all game-determining randomness. The certification chain is preserved through an isolated PHP microservice:

text
+---------------+       HTTP POST /rng       +----------------------+
|  Game Engine  | -------------------------> | PHP RNG Microservice |
+---------------+                            |      (Certified)     |
                                             +----------+-----------+
                                                        |
                                                        v
                                             +-----------------------+
                                             | Certified RNG Wrapper |
                                             +----------+------------+
                                                        |
                                                        v
                                             +----------------------+
                                             | PHP random_int(...)  |
                                             +----------+-----------+
                                                        |
                                                        v
                                             +----------------------+
                                             |      OS CSPRNG       |
                                             |    /dev/urandom,     |
                                             |      getrandom       |
                                             +----------------------+

Why This Architecture

ConcernSolution
BMM CertificationThe PHP RNG wrapper is pre-certified by BMM Testlabs
Audit TrailEvery random number passes through the certified class path, no shortcuts
PerformanceThe gateway calls the PHP service via HTTP; the PHP process is persistent (no cold start)
IsolationThe RNG service runs as a separate container, independent scaling and monitoring

HTTP Bridge Specification

PropertyValue
ProtocolHTTP/1.1 POST
Endpoint/rng
Content-Typeapplication/json
Request Format{"method":"getInteger","min":10000,"max":99999}
Response Format{"number":42781}
Retry Strategy3 attempts with exponential backoff (100ms, 200ms, 400ms)
Timeout5000ms

What the RNG Is Used For

The certified RNG generates the client_seed, a single integer in the range [10000, 99999], once per game round. This seed is one of three inputs to the provably fair hash chain.

The engine never generates its own random numbers for game outcomes. The Fisher-Yates shuffle used during deterministic replay verification is seeded from known values, not from OS entropy.

Statistical Verification

The RNG was internally re-verified on June 1, 2026. A batch of 1,000,000 random numbers was generated and subjected to 29 statistical tests across 3 standard suites. The results matched the original BMM Testlabs certification values, with all tests returning a p-value ≥ 0.01 (99% confidence interval).

Empirical Tests (7)

#TestWhat It Measures
1Frequency (Monobit)Proportion of 0s vs 1s in bitstream
2Serial CorrelationCorrelation between consecutive values
3Runs (Wald-Wolfowitz)Runs of consecutive identical bits
4GapDistance between occurrences of a target digit
5Coupon CollectorDraws until all values in a range appear
6SubsequencesUniformity within blocks
7PokerChi-square test on k-tuple patterns

Diehard Tests (7)

#TestWhat It Measures
1Binary Rank 32×32Rank of 32×32 binary matrices over GF(2)
2Binary Rank 6×8Rank of 6×8 binary matrices
3Birthday SpacingsClustering detection (birthday paradox)
4BitstreamOverlapping 20-bit word counts
5Count The 1'sDistribution of 1s in bytes
6Runs (Diehard)Ascending and descending runs
7SqueezeOverlapping sums uniformity

NIST SP 800-22 Tests (15)

#TestNIST SectionWhat It Measures
1Approximate Entropy§2.2Frequency of overlapping m-bit patterns
2Block Frequency§2.2Proportion of 1s within M-bit blocks
3Cumulative Sums§2.13Random walk maximum excursion
4Discrete Fourier Transform§2.6Periodic features in bit sequence
5Frequency (Monobit)§2.1NIST variant of monobit test
6Linear Complexity§2.10LFSR length needed to generate sequence
7Longest Run of Ones§2.4Longest run of 1s within M-bit blocks
8Non-Overlapping Template§2.7Occurrences of non-periodic patterns
9Overlapping Template§2.8Occurrences of patterns (allows overlap)
10Random Excursions§2.14Visits to states in cumulative sum walk
11Random Excursions Variant§2.15Variant of excursions test
12Binary Matrix Rank§2.5Rank of disjoint sub-matrices
13Serial§2.11Frequency of overlapping m-bit patterns
14Runs§2.3NIST variant of runs test
15Universal (Maurer's)§2.12Compressibility of sequence

Threshold

All tests use p-value ≥ 0.01 as the passing criterion, per NIST SP 800-22 §1.1.2 and BMM Testlabs standards. A p-value below 0.01 indicates the sequence is non-random with 99% confidence.

Certification Documents

The official BMM Testlabs Certification Report (which includes the Certificate of Compliance and the full Statistical Analysis Report) is available upon request.