DatDuck is Provably Fair

  1. Introduction
  2. The Formula
  3. Roulette

At DatDuck we believe providing honest and fair game results is a priority of every platform.

Our system is Provably Fair, which means you do not need to trust us. Instead, you can verify each round's result to be fair and we have no way of influencing the outcome.

The Formula

Our Provably Fair formula is based around EOS cryptocurrency blockchain. The outcome of a game is unknown until the bets are placed, this guarantees no party can predict the result. The formula combines input from 3 independent inputs with cryptographically secure SHA-256 HMAC hash.

The following inputs are used to generate the Result Hash:

  1. Round ID - used as salt for the operation, ensuring each result is totally random even in extremely rare case when one of other parameters is reused
  2. Private Seed - cryptographically secure random value generated when the round is started, before any bets are placed. The SHA-256 hash of Private Seed, known as Private Hash, is displayed to the users all the time, assuring it's value doesn't change.
  3. Public Seed - the hash of an EOS block generated after the round is closed. Once the round stops accepting the bets, our system chooses a block number which will be generated in the near future, which is displayed to all players as Public Hash. Once the EOS block is mined, it's hash is used as an input, which guarantees no party knows all inputs prior to closing the bets.

You can use the following JavaScript code to calculate Result Hash from the input parameters:

import { createHmac } from 'crypto'

function createHash(roundId, privateSeed, publicSeed) {
  return createHmac('sha256', privateSeed).update(`${roundId}-${publicSeed}`).digest('hex');
}

Roulette

Roulette is a game with 15 possible rolls. We generate the roll from Result Hash by taking first 4 bytes, dividing by 15 and checking the remainder. This can be achieved using very simple JavaScript code:

function getRouletteRoll(resultHash) {
  return parseInt(resultHash.substring(0, 8), 16) % 15;
}

To translate Roulette Roll into Roulette Color, execute the following code:

function colorFromRoll(roll) {
  if (roll === 0) return 'GREEN';
  if (roll % 2) return 'CT';
  return 'TT';
}
0
Scroll to latest messages
Login with Steam