Provably Fair · Zulti Documentation
Zulti Documentation

What is Provably Fair?

Provably fair is a cryptographic system that ensures complete transparency and fairness in our lottery drawings. This technology allows you to independently verify that the results have not been manipulated, rigged, or tampered with in any way, ensuring all participants have an equal chance of winning.

At Zultifree, we believe that trust is earned through transparency. Our provably fair system goes beyond simply asking you to trust us - it gives you the tools to mathematically verify the fairness of every draw, completely independent of us.

How Our Provably Fair System Works

Our provably fair system combines multiple sources of randomness that neither we nor any participant can predict or manipulate. This creates a lottery drawing process that is verifiably random and fair for everyone involved.

The Three Key Components

  • Server Seed - A cryptographic hash created before the draw
  • Ethereum Block Hash - An unpredictable value from the blockchain
  • Deterministic Algorithm - Open-source code that combines these values

Server Seed: Pre-committed Randomness

Before each lottery draw, we generate a random server seed - a complex string of characters. This seed is immediately hashed (encrypted) using SHA-256 , a secure cryptographic function. The hash is publicly displayed before the draw starts.

This is similar to sealing a prediction in an envelope before an event occurs. The hash (unopened envelope) proves we committed to a specific seed value without revealing what it is. After the draw, we reveal the original server seed, and anyone can verify it matches the pre-published hash.

This prevents us from changing the server seed after seeing the Ethereum block hash or lottery results, as any change would produce a completely different hash.

Ethereum Block Hash: Unpredictable External Randomness

For each draw, we use the hash of a Ethereum block that will be created after cutoff. These blocks are produced by the entire Ethereum network through a complex mining/validation process involving thousands of computers worldwide.

This block hash provides a source of randomness that cannot possibly be predicted or manipulated by us or any individual participant. The exact future block number to be used is announced before each lottery begins, ensuring complete transparency.

Even the most powerful mining entities cannot reliably predict or manipulate a specific block hash, making this an ideal external source of randomness.

Deterministic Algorithm: Combining Randomness Sources

The final step in our provably fair system is combining the server seed and the Ethereum block hash using a deterministic algorithm. This algorithm is completely open-source and available for anyone to inspect.

The algorithm works by:

  • Combining the revealed server seed with the Ethereum block hash
  • Processing this combined data through a series of mathematical operations
  • Generating the final lottery numbers

Because the algorithm is deterministic, running the same inputs (server seed and block hash) will always produce the exact same lottery numbers. This allows anyone to verify the results independently.

Verification Process

After each lottery draw, we provide all the information needed for independent verification:

  • The original server seed (previously only shared as a hash)
  • The Ethereum block number and hash from the specified block
  • The winning numbers calculated by our system

To verify the results, you can:

  1. Confirm the revealed server seed produces the same SHA-256 hash that was published before the draw
  2. Check the Ethereum block hash on any Ethereum block explorer
  3. Run the open-source algorithm (see below) with these inputs to confirm it produces the same lottery numbers

Source Code

Our application is written in Elixir and below is the source code for determining winning numbers. While there's a built-in verification tool on each lottery page for easy checking, we encourage users with technical knowledge to examine our code themselves and even run it in their own environment.

# Combine seeds
seeds = server_seed + eth_block_hash

# Seed the random number generator
:rand.seed(:default, :erlang.phash2(seeds))

# Generate lottery numbers
# max_selectable_number is the maximum number that a lottery allows selecting, e.g. 45
# selectable_numbers_count is the count of numbers that you select when entering the lottery
1..max_selectable_number//1
|> Enum.to_list()
|> Enum.shuffle()
|> Enum.take(selectable_numbers_count)
      

Why Provably Fair Matters

Traditional lotteries require participants to trust the operators completely, with limited ability to verify the fairness of drawings. Our provably fair system removes this need for blind trust by providing:

  • Complete Transparency - Every element of the drawing process is visible and verifiable
  • Mathematical Certainty - Cryptographic techniques ensure results cannot be manipulated
  • Independence - The system relies on external randomness that we cannot control
  • Self-Verification - You don't need to trust us; you can verify everything yourself

Common Questions

Can Zultifree manipulate the lottery results?

No. The server seed is committed (hashed) before the draw, and the Ethereum block hash comes from a future block that doesn't exist when the lottery starts. It's cryptographically impossible for us to manipulate the results without detection.

What if Zultifree generates multiple server seeds until they get favorable results?

This is prevented by the pre-commitment system. We publish the hash of our server seed before the draw, committing to a specific value. When combined with the unpredictable Ethereum block hash, even if we tried thousands of server seeds, we couldn't predict which would produce a specific outcome.

Could a powerful miner influence the Ethereum block hash?

While theoretically possible, it would require computational resources that vastly exceed the potential benefit. Even the largest mining pools control only a fraction of the total network hashrate, making manipulation virtually impossible for practical purposes. Additionally, our server seed adds another layer of randomness that even a block producer couldn't predict.