Verifiable Randomness Documentation

Verifiable Randomness Systems

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

Unbiased Coin Toss

A coin toss is the simplest possible random event: two outcomes with equal probability.

In practice, many digital coin toss implementations are not actually 50/50.

This document explains:

The Assumption: “It’s Just 0 or 1”

Developers often assume:

If the RNG is good, then:

random % 2

must produce a fair result.

This assumption is not always correct.

Even when the bias is small, it becomes meaningful in:

A tiny bias repeated millions of times becomes measurable.

Where Bias Appears

Bias enters when the underlying random source:

Examples of problematic sources:

The Modulo Problem (Even With “Good” Random)

If the entropy space is not an exact multiple of 2, then:

Example:

If values range from 0–9 (10 values)

10 mod 2 = 0 → safe

But if values range from 0–255 (256 values)

256 mod 2 = 0 → still safe

Now consider truncated entropy:

0–254 (255 values)

255 mod 2 = 1

Now one side appears slightly more often.

This happens frequently when:

Cryptographic Coin Toss Design

A correct coin toss should:

Deterministic Derivation Pattern

Given a final randomness seed: seed

We derive entropy using: hash(seed : counter)

The counter ensures:

Converting Entropy Into a Coin Toss

Correct method:

  1. Take 64 bits of entropy
  2. Use rejection sampling if needed
  3. Map to two outcomes

Simplified approach:

value = entropy % 2

But only if the entropy range is a power of two.

Safer approach:

  1. Use full 64-bit space
  2. Reject values outside the largest multiple of 2

This guarantees:

Mapping Outcomes

Common mappings:

or

The important part is:

Why Deterministic Coin Toss Matters

In adversarial systems:

A deterministic coin toss provides:

Anyone with the seed can recompute the result.

Real-World Failure Modes

Observed issues in production systems:

Verifiable Coin Toss Requirements

A coin toss suitable for trust-sensitive environments must provide:

Without these, the result is:

Why This Matters More Than It Seems

A coin toss is often used as the root decision for:

If the root decision is biased:

Key Takeaway

A fair digital coin toss (as generated by BlockRand) is not about generating 0 or 1.

It is about:

In adversarial or financial systems, a coin toss must be treated as a cryptographic protocol, not a UI animation.