Verifiable Randomness Documentation

Verifiable Randomness Systems

View the Project on GitHub blockrand-api/blockrand-js

Deterministic Replay: Verifying Results After the Fact

Why Verification Always Happens Too Late

In real systems, verification rarely happens before an outcome.
It happens when:

At that moment, explanations are useless.
What matters is whether the outcome can be reproduced exactly.
This is where deterministic replay becomes essential.

What Is Deterministic Replay?

Deterministic replay means:

Given the same inputs, the system will always produce the same output.

No matter:

If replay produces a different result, fairness is broken.

Why Random Systems Must Be Deterministic

This sounds contradictory:
“How can randomness be deterministic?”

The answer:
Randomness is generated, but outcomes are derived deterministically from it.

Once inputs are fixed:

There must be exactly one possible result.

The Replay Question That Matters

A provably fair system must answer:

“Could the operator have produced a different result using the same committed inputs?”

If the answer is yes, the system is not fair.
Deterministic replay ensures the answer is always no.

What Must Be Replayable

For verification to work, the following must be reproducible:

  1. Entropy derivation
  2. Random number generation
  3. Range mapping
  4. Ordering logic
  5. Outcome selection

If even one step is opaque or stateful, replay fails.

Inputs vs Hidden State

Deterministic replay requires zero hidden state.

Bad examples of hidden state:

Hidden state creates alternate timelines.
Alternate timelines destroy verifiability.

The Canonical Replay Model

A replayable system looks like this:

Inputs → Hash → Entropy → Algorithm → Result

Why Logs Are Not Enough

Many operators say:
“We logged everything.”

Logs are not proofs.

Problems with logs:

Deterministic replay proves that no alternative outcome was possible.

Deterministic Replay vs Audits

Audits verify:

Replay verifies:

A system may pass an audit and still fail replay.
Replay is stronger.

Cross-Platform Consistency

A correct replay must produce identical results across:

This requires:

Floating point breaks replay.

Common Replay Breakers

Floating-Point Math

Different platforms produce slightly different results.
Even tiny drift invalidates replay.

Non-Canonical Sorting

Sorting without explicit rules:

Partial Entropy Use

Using only part of a hash:

Replay in Practice

A verifier should be able to:

  1. Collect published inputs
  2. Run reference code
  3. Obtain identical outputs

If verification requires contacting the operator:

The system is not provably fair.

Why Replay Changes Dispute Resolution

Without replay:

With replay:

There is nothing to argue about.

Deterministic Replay Is Binary

Replay does not degrade gracefully.

Either:

or:

“Almost the same” is failure.

Real-World Failure Pattern

Most systems fail replay because:

Replay requires discipline.

Design Rule of Thumb

If you cannot write a pure function that produces the result, your system is not replayable.

Pure in → pure out.

Key Takeaway

Deterministic replay is the backbone of provable fairness.
It transforms randomness from:

“Trust us, it was fair”

into:

“Here is the only result that could exist.”

If an outcome cannot be replayed exactly, it cannot be proven fair — no matter how good the RNG looks.