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:
- Server Seed — A secret random string generated using cryptographically secure random number generation (CSPRNG)
- Client Seed — A random string you can customize
- Nonce — A counter that increments with each bet
- 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
- Server Seed Generation: EZFlip generates a random server seed using CSPRNG
- Hash Commitment: We show you a SHA-256 hash of the server seed (proof of commitment)
- Client Seed: You can set your own client seed or use the default
- Nonce: Starts at 0 and increments with each bet
- Next Server Seed Hash: We also pre-commit the next server seed hash for transparency
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
- Rotate your server seed to reveal the previous one
- Verify that hashing the revealed seed matches the hash shown before
- 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
- Ticket Creation: We request a ticket ID from Random.org
- Signed String Generation: Random.org generates a cryptographically signed random string
- Winner Selection: The signed string determines the game outcome
- 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:
- We request a signed random string from Random.org
- The string is hashed using SHA-256
- 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
- Go to your Profile or the Provably Fair page
- 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)
- Click "Rotate" or "New Server Seed"
- Your current server seed is revealed
- 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:
| Component | Description |
|---|---|
| Client Seed | Your personal randomness input (customizable) |
| Server Seed | Our secret random string (revealed after rotation) |
| Server Seed Hash | SHA-256 hash of server seed (shown before games) |
| Next Server Seed Hash | Pre-committed hash for next rotation |
| Nonce | Counter that increments with each bet |
Customizing Your Client Seed
You can change your client seed at any time:
- Go to Profile → Fair or Seeds
- Enter your custom client seed
- 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:
- Server seed is committed (hashed) before your bet
- Random.org provides external randomness we don't control
- 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
| Component | Purpose |
|---|---|
| CSPRNG | Generates unpredictable server and client seeds |
| Server Seed Hash | Proves commitment before your bet |
| Client Seed | Adds your personal randomness |
| Nonce | Ensures unique outcomes per bet |
| Random.org | External randomness for Coin Flip & Jackpot |
| SHA-256 | Hash 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!