Skip to main content

Provably Fair Gaming

At EZFlip, we believe in complete transparency. Our provably fair system ensures that every game outcome is random, unbiased, and independently verifiable.

What is Provably Fair?

Provably fair is a cryptographic method that allows players to verify that game outcomes were determined fairly and weren't manipulated by the casino. Our system uses multiple layers of randomness:

  1. Server Seed — A secret random string generated using cryptographically secure random number generation (CSPRNG)
  2. Client Seed — A random string you can customize
  3. Nonce — A counter that increments with each bet
  4. Random.org Integration — External random number generation for additional verification (used in Coin Flip and Jackpot)

How Seeds Are Generated

Server Seed Generation

EZFlip generates server seeds using Go's crypto/rand package — the same cryptographically secure random number generator used in security-critical applications:

// Simplified representation of our seed generation
func GenerateServerSeed(length int) (seed string, hash string) {
randomBytes := crypto/rand.Read(length) // CSPRNG
seed = hex.Encode(randomBytes)
hash = sha256(seed)
return seed, hash
}

The server seed is:

  • Generated using CSPRNG (Cryptographically Secure Pseudo-Random Number Generator)
  • Hex encoded for storage and display
  • Hashed with SHA-256 to create the commitment hash

Client Seed Generation

Your client seed is also generated securely:

  • Uses the same CSPRNG as server seeds
  • Base64 encoded for display
  • You can customize it to add your own randomness

How It Works

Before the Game

  1. Server Seed Generation: EZFlip generates a random server seed using CSPRNG
  2. Hash Commitment: We show you a SHA-256 hash of the server seed (proof of commitment)
  3. Client Seed: You can set your own client seed or use the default
  4. Nonce: Starts at 0 and increments with each bet
  5. Next Server Seed Hash: We also pre-commit the next server seed hash for transparency
The Key Principle

Because we commit to the server seed hash before you place your bet, we cannot change the outcome after seeing your wager. The hash proves the seed existed before your bet.

During the Game

The outcome is calculated using the server seed, client seed, and nonce:

Outcome = HMAC_SHA256(serverSeed, clientSeed + nonce)

The resulting hash determines the game outcome based on game-specific formulas.

After the Game

  1. Rotate your server seed to reveal the previous one
  2. Verify that hashing the revealed seed matches the hash shown before
  3. Recalculate the outcome yourself to confirm fairness

Random.org Integration

For Coin Flip and Jackpot games, we use Random.org's API for additional external randomness:

How It Works

  1. Ticket Creation: We request a ticket ID from Random.org
  2. Signed String Generation: Random.org generates a cryptographically signed random string
  3. Winner Selection: The signed string determines the game outcome
  4. Verification: Random.org provides cryptographic signatures that can be independently verified

Why Random.org?

  • External Randomness: Provides randomness that's independent of our systems
  • Auditable: Random.org maintains records that can be audited
  • Cryptographically Signed: Each random value comes with a verifiable signature
  • Trusted Third Party: Random.org is a well-established service used by lotteries and scientific research

Game-Specific Formulas

Coin Flip

Coin Flip uses Random.org for winner selection:

  1. We request a signed random string from Random.org
  2. The string is hashed using SHA-256
  3. The result determines the winner based on weighted selection
// Winner selection
const hash = sha256(signedString);
const randomValue = parseInt(hash.substring(0, 16), 16);
const winner = randomValue % totalWeight; // Determines winning side

Jackpot

Jackpot also uses Random.org with ticket-weighted selection:

// Each 0.01 SOL = 1 ticket
const totalTickets = pot / 0.01;
const winningTicket = randomValue % totalTickets;
// Player holding that ticket wins

Crash (Coming Soon)

Crash will use on-chain seed combination:

// Crash point calculation
const hash = sha256(serverSeed + clientSeed);
const h = parseInt(hash.substring(0, 13), 16);
const e = Math.pow(2, 52);

if (h % 20 === 0) {
// ~5% chance of instant crash
crashPoint = 1.00;
} else {
crashPoint = Math.floor((100 * e - h) / (e - h)) / 100;
}

Verification Process

Step 1: Access Your Seeds

  1. Go to your Profile or the Provably Fair page
  2. You'll see:
    • Current Client Seed
    • Current Server Seed Hash
    • Current Nonce
    • Next Server Seed Hash

Step 2: Rotate Seeds (to reveal previous server seed)

  1. Click "Rotate" or "New Server Seed"
  2. Your current server seed is revealed
  3. A new server seed is generated for future games

Step 3: Verify the Hash

Confirm the revealed server seed matches its hash:

const crypto = require('crypto');
const serverSeed = 'your-revealed-server-seed';
const hash = crypto.createHash('sha256').update(serverSeed).digest('hex');
console.log(hash); // Should match the hash shown before your games

Step 4: Recalculate Outcomes

Use the seeds to recalculate any game outcome and verify it matches the result you received.

Seed Pair Details

Each user has an active seed pair containing:

ComponentDescription
Client SeedYour personal randomness input (customizable)
Server SeedOur secret random string (revealed after rotation)
Server Seed HashSHA-256 hash of server seed (shown before games)
Next Server Seed HashPre-committed hash for next rotation
NonceCounter that increments with each bet

Customizing Your Client Seed

You can change your client seed at any time:

  1. Go to ProfileFair or Seeds
  2. Enter your custom client seed
  3. Click Save

Using a custom client seed adds your own randomness to the outcome, giving you additional confidence in fairness.

Third-Party Verification

You can verify outcomes using external tools:

Online Tools

Random.org Verification

For Coin Flip and Jackpot, Random.org provides:

  • Ticket records
  • Signed random values
  • Verification tools on their website

Frequently Asked Questions

What is CSPRNG?

CSPRNG (Cryptographically Secure Pseudo-Random Number Generator) is a random number generator suitable for cryptographic use. Go's crypto/rand uses the operating system's secure random source, making it unpredictable and suitable for security applications.

Why use both CSPRNG and Random.org?

  • CSPRNG provides fast, local randomness for seed generation
  • Random.org provides external, auditable randomness for game outcomes
  • Combined, they offer multiple layers of verifiable fairness

Can EZFlip predict outcomes?

No. The system is designed so that:

  1. Server seed is committed (hashed) before your bet
  2. Random.org provides external randomness we don't control
  3. You can add your own randomness via client seed

What if I don't rotate my seeds?

You can still play normally. The server seed hash proves the seed was committed before your bets. Rotation just reveals it for verification.

Are all games provably fair?

Yes. Every game on EZFlip uses our provably fair system. You can verify any game outcome after playing.


Summary

ComponentPurpose
CSPRNGGenerates unpredictable server and client seeds
Server Seed HashProves commitment before your bet
Client SeedAdds your personal randomness
NonceEnsures unique outcomes per bet
Random.orgExternal randomness for Coin Flip & Jackpot
SHA-256Hash function for verification

Our provably fair system ensures:

✅ Outcomes are determined before you bet
✅ We cannot manipulate results after seeing your wager
✅ External randomness from Random.org adds extra verification
✅ You can independently verify every game
✅ The system is mathematically transparent


Have questions about our provably fair system? Join our Discord and ask!