Fairness Hi-Lo
Hi-Lo Game
Hi-Lo is a round-based card game where players play against the house. The main idea of the game is to guess the next card. The card deck consists of following 25 cards: Joker, 2 red, 2 black, 3 red, 3 black, 4 red, 4 black, 5 red, 5 black, 6 red, 6 black, 7 red, 7 black, 8 red, 8 black, 9 red, 9 black, J red, J black, Q red, Q black, K red, K black, A red, A black. Please note that cards hierarchy starts from 2 as the lowest card and goes up to Ace as the highest one. Some of bet options have a predefined chance and payout multiplier and some (hi and lo) are calculated dynamically based on the result (card) of the previous round.
Randomization
In order to allow players to verify round results, we generate a chain of seeds for each game type. Each seed in a chain is SHA256 hash of a previous one which allows maintaining chain integrity over time. The game utilizes seeds from the chain in reverse order, that means knowing the seed of Nth round you can generate seeds for any number of previous rounds. The chain may consist of various amounts of seeds. We encode and publish the SHA256 hash of the last seed in the chain to Ethereum transaction’s data and use block hash as SALT. We can’t predict block hash, so by doing so results are uniformly distributed which means we can’t generate a chain of seeds with some specific distribution.
# | Seeds number | Salt | Publish link | Date |
---|
1 | 100000 | 0xa60fd285f3b85cd24e01edf84048a5dec60af472054a62705ecb52274c1c0e75 | https://etherscan.io... | 2019-10-01 13:28:25 |
2 | 500000 | 0xf420dfbdae36e62605f674c96c1af0d46d0a17a3ef5fc476b791c2badcaf8bc8 | https://etherscan.io... | 2019-10-11 14:33:35 |
Tower.bet Hi-Lo randomization #1 SHA-256 of last seen chain can be checked in ETH transaction under an Input Data section. Make sure to view Input Data in UTF-8.
Result generation
To generate a number in the range [0, 24] we combine round seed with salt. Then calculate SHA256 hash of that combination. That gives us a string of 64 hexadecimal numbers.
Then we take the first 4 characters of that hash and convert it into a decimal number ranging from 0 to 65535 (16 ^ 4 - 1). If it is less than 65525, we use the remainder from division by 25 and use it as an outcome. Otherwise, we repeat using the next 4 characters. We are able to repeat the process up to 16 times. The outcome of this algorithm is a sequential number (position) of the result card in the deck.
Sample code
const saltedSeed = CryptoJS.SHA256(seed + salt).toString();
let pos = 0;
do {
lucky = parseInt(saltedSeed.substr(pos, 4), 16);
pos += 4;
} while (lucky > 65525);
const number = lucky % 25;
Verification
We're publishing the game's hash immediately after the game round ends. You can use round’s seed and SALT to verify that the bet result was not modified as well as verify that the seed was present in the original chain during randomization. There is a public verification script you can use to verify results, source code available and open. https://codepen.io/tower-bet/full/XWWPJvX
Fairness Crash
Crash Game
The multiplier counter starts at the beginning of each round. It starts at 1.0x and will gradually increase until it crashes at a random multiplier. If you cash out before the multiplier crashes, you will win your bet multiplied by the number of the multiplier at the time of cash out. If you do not cash out before the multiplier counter crashed, you lose.
Randomization
In order to allow players to verify round results, we generate a chain of seeds for each game type. Each seed in a chain is SHA256 hash of a previous one which allows maintaining chain integrity over time. The game utilizes seeds from the chain in reverse order, that means knowing the seed of Nth round you can generate seeds for any number of previous rounds.
The chain may consist of various amounts of seeds. We encode and publish the SHA256 hash of the last seed in the chain to Ethereum transaction’s data and use block hash as SALT. We can’t predict block hash, by doing so results are uniformly distributed which means we can’t generate a chain of seeds with some specific distribution.
# | Seeds number | Salt | Publish link | Date |
---|
1 | 500000 | 0x0a6d1e71f65e0ac8817baad4aec39d036fdd33c7f4f4f0989419cb6f18fffd81 | https://etherscan.io... | 2019-12-12 03:23:34 |
Result generation
To generate result multiplier we calculate the SHA256 hash of seed via HMAC algorithm using SALT as a key. That gives us a string of 64 hexadecimal numbers.
Then we take the first 6 characters of that hash and convert it into a decimal number ranging from 0 to 16777215 (16 ^ 6 - 1). This decimal number is uniformly distributed. Then we convert this decimal number to float, uniformly distributed in the range (0, 1] by formula: “floatNum = intNum / 16^6”.
Then, we get the result multiplier by formula “multiplier = 0.99 / (1 - floatNum)”. If the result is less than 1, it means that the crash game fails right on start, and all participants lose the game. Also, we round down multiplier result to 2 decimal digits after the floating-point dot.
Sample code
const bits = 24;
const hmac = CryptoJS.HmacSHA256(seed, salt);
seedHash = hmac.toString(CryptoJS.enc.hex);
seedHash = seedHash.slice(0, bits / 4);
const int = parseInt(seedHash, 16);
let float = int / Math.pow(2, bits);
let multiplier = 99 / (1 - float);
multiplier = Math.max(1, Math.floor(multiplier) / 100);
Verification
We're publishing the game's hash immediately after the game round ends. You can use round’s seed and SALT to verify that the bet result was not modified as well as verify that the seed was present in the original chain during randomization. There is a public verification script you can use to verify results, source code available and open. https://codepen.io/tower-bet/full/XWWPJvX
Fairness Cogwheel
Cogwheel Game
Cogwheel is a round-based game where players play against the house. The main idea of the game is to guess the color of the sector of next round. The cogwheel consists of 54 sectors of 4 colors: 26 Green 2x, 17 Blue 3x, 10 Red 5x, 1 Golden 50x.
Randomization
In order to allow players to verify round results, we generate a chain of seeds for each game type. Each seed in a chain is SHA256 hash of a previous one which allows maintaining chain integrity over time. The game utilizes seeds from the chain in reverse order, that means knowing the seed of Nth round you can generate seeds for any number of previous rounds.
The chain may consist of various amounts of seeds. We encode and publish the SHA256 hash of the last seed in the chain to Ethereum transaction’s data and use block hash as SALT. We can’t predict block hash, by doing so results are uniformly distributed which means we can’t generate a chain of seeds with some specific distribution.
Result generation
To generate a number in the range [0, 53] we combine round seed with salt. Then calculate SHA256 hash of that combination. That gives us a string of 64 hexadecimal numbers.
Then we take the first 4 characters of that hash and convert it into a decimal number ranging from 0 to 65535 (16 ^ 4 - 1). If it is less than 65502, we use the remainder from division by 54 and use it as an outcome. Otherwise, we repeat using the next 4 characters. We are able to repeat the process up to 16 times. The outcome of this algorithm is a sequential number (position) of the sector on the wheel.
Sample code
const saltedSeed = CryptoJS.SHA256(seed + salt).toString();
let pos = 0;
do {
lucky = parseInt(saltedSeed.substr(pos, 4), 16);
pos += 4;
} while (lucky > 65502);
const number = lucky % 54;
Verification
We're publishing the game's hash immediately after the game round ends. You can use round’s seed and SALT to verify that the bet result was not modified as well as verify that the seed was present in the original chain during randomization. There is a public verification script you can use to verify results, source code available and open. https://codepen.io/tower-bet/full/jOExbbg
Fairness Wheel
Wheel Game
The Wheel is a single-player game. The main idea of the game is to guess the color of the sector of the next roll. The Wheel has 3 difficulty modes: Low - 3x, Medium - 5x and High - 53x. Each consists of 54 sectors.
Low has 4 kinds of the sector:
- x0 – 18 sectors that aren't painted
- x1.2 – 25 sectors that are Green
- x2 – 10 sectors that are Blue
- x3 – 1 sector that is Red
Medium has 5 kinds of the sector:
- x0 – 27 sectors that aren't painted
- x1.5 – 14 sectors that are Green
- x2 – 9 sectors that are Blue
- x3 – 3 sectors that are Red
- x5 – 1 sector that is Golden
High has 2 kinds of the sector:
- x0 – 53 sectors that aren't painted
- x5 – 1 sector that is Golden
Randomization
In order to verify your bets, a pair of Server Seed and Client Seed is used to calculate a sector number.
A process of creating a new pair of Server Seed and Client Seed is called randomization. It's possible to make randomization anytime.
Knowing Server Seed, Client Seed and Nonce it's possible to calculate bet result. To prevent a player from result prediction, Server Seed is hidden, and a SHA-256 hash of the seed is shown instead. After the next randomization, previous Server Seed is revealed and a player is able to verify the bet. Also, a player can make sure that Server Seed wasn't changed by comparing their hashes before and after randomization.
Between each randomization you need to place at least 3 bets.
Result generation
To generate a number in the range [0, 53] we combine server seed, user seed, and nonce Then calculate SHA256 hash of that combination. That gives us a string of 64 hexadecimal numbers.
Then we take the first 4 characters of that hash and convert it into a decimal number ranging from 0 to 65535 (16 ^ 4 - 1). If it is less than 65502, we use the remainder from the division by 54 and use it as an outcome. Otherwise, we repeat using the next 4 characters. We are able to repeat the process up to 16 times. The outcome of this algorithm is a sequential number (position) of the sector on the wheel.
Sample code
const hash = CryptoJS.SHA256(serverSeed + clientSeed + nonce).toString();
const maxChunkNum = Math.pow(16, ChunkSize);
const upperBoundary = maxChunkNum - maxChunkNum % 54;
let pos = 0;
let lucky = 0;
do {
lucky = parseInt(hash.substr(pos, ChunkSize), 16);
pos += ChunkSize;
} while (lucky > upperBoundary);
const result = lucky % 54;
Verification
We're publishing server seed after next randomization, and players can verify bet using previous Server Seed and Client Seed and nonce that related with a bet. Note that the Nonce count starts from 0 and reset after each randomization. There is a [public verification script | https://codepen.io/tower-bet/full/zYGzyOj] you can use to verify results, source code available and open.
Fairness Slots
Slots Game
Slots is a single-player game that gives a chance to win an amount many times larger than the size of the bet. The goal of the game is to collect a winning combination of symbols by rotating the reel. The better the combination, the greater the gain.
The rules for slots are simple. You choose the size of your bet and click BET to start the game. Then wait for the reels to spin and stop. If you get a winning combination you'll get a payout. There are also bonus games that are unlocked via combinations that award additional prizes.
Randomization
In order to verify your bets, a pair of Server Seed and Client Seed is used to calculate a sector number.
A process of creating a new pair of Server Seed and Client Seed is called randomization. It's possible to make randomization anytime.
Knowing Server Seed, Client Seed and Nonce it's possible to calculate bet result. To prevent a player from result prediction, Server Seed is hidden, and a SHA-256 hash of the seed is shown instead. After the next randomization, previous Server Seed is revealed and a player is able to verify the bet. Also, a player can make sure that Server Seed wasn't changed by comparing their hashes before and after randomization.
Between each randomization you need to place at least 3 bets.
Result generation
To generate a number in the range [0, 2 ^ 256] we combine server seed, user seed, and nonce.
Then calculate SHA256 hash of that combination.
That gives us a string of 64 hexadecimal numbers.
Then we convert it into an integer number ranging from 0 to 115792089237316195423570985008687907853269984665640564039457584007913129639936 (2 ^ 256).
Then we use arithmetical codding algorithm to receive the state of a slot mashine.
The outcome of this algorithm is 5 reels with 4 symbols on each.
Sample code
const hash = CryptoJS.SHA256(serverSeed + clientSeed + nonce).toString();
const number = new BigNumber(hash, 16).toFixed();
const slotWindow = getWindow(number);
Verification
We're publishing server seed after next randomization, and players can verify bet using previous Server Seed and Client Seed and nonce that related with a bet.
Note that the Nonce count starts from 0 and reset after each randomization.
There is a public verification script you can use to verify results, source code available and open.
Fairness Dice
Randomization
In order to verify your bets, a pair of Server Seed and Client Seed is used to calculate a result number.
A process of creating a new pair of Server Seed and Client Seed is called randomization. It's possible to make randomization anytime.
Knowing Server Seed, Client Seed and Nonce it's possible to calculate bet result. To prevent a player from result prediction, Server Seed is hidden, and a SHA-256 hash of the seed is shown instead. After the next randomization, previous Server Seed is revealed and a player is able to verify the bet. Also, a player can make sure that Server Seed wasn't changed by comparing their hashes before and after randomization.
Between each randomization you need to place at least 3 bets.
Result generation
To generate a number in the range [0, 99999] we combine server seed, user seed, and nonce Then calculate SHA256 hash of that combination. That gives us a string of 64 hexadecimal numbers.
Then we take the first 5 characters of that hash and convert it into a decimal number ranging from 0 to 1048575 (16 ^ 5 - 1). If it is less than a million, we use the remainder from the division by 100K and use it as an outcome. Otherwise, we repeat using the next 5 characters. We are able to repeat the process up to 12 times. The outcome of this algorithm is a roll number.
const hash = CryptoJS.SHA256(serverSeed + clientSeed + nonce).toString();
let pos = 0;
let lucky = 0;
do
{ lucky = parseInt(hash.substr(pos, 5), 16); pos += 5; }
while (lucky > 1000000);
const result = lucky % 100000;
Fairness Limbo
Limbo Game
The Limbo is a single-player game. Fundamentally, it's a game of luck which main idea to guess the multiplier of the next roll. All outcomes are randomly generated, as explained below. The maximum payout in Limbo is 1,000,000x of your bet. The house edge of the game is just 1%.
Randomization
In order to verify your bets, a pair of Server Seed and Client Seed is used to calculate a result multiplier.
A process of creating a new pair of Server Seed and Client Seed is called randomization. It's possible to make randomization anytime.
Knowing Server Seed, Client Seed and Nonce it's possible to calculate bet result. To prevent a player from result prediction, Server Seed is hidden, and a SHA-256 hash of the seed is shown instead. After the next randomization, previous Server Seed is revealed and a player is able to verify the bet. Also, a player can make sure that Server Seed wasn't changed by comparing their hashes before and after randomization.
Between each randomization you need to place at least 3 bets.
Result generation
To generate a random multiplier we combine server seed, user seed, and nonce. Then calculate SHA256 hash of that combination. That gives us a string of 64 hexadecimal numbers.
Then, we take the first 5 characters of that hash and convert it into a decimal number ranging from 0 to 1048575 (16 ^ 5 - 1). This decimal number is uniformly distributed. Then we convert this decimal number to float, uniformly distributed in the range (0, 1] by formula: “floatNum = intNum / 16^5”.
Then, we get the result multiplier by formula “multiplier = 0.99 / (1 - floatNum)”. If the result is less than or equals 1, it means that the game round does not have any possible winning target because the minimum payout playable is 1.01x. Also, we round down multiplier result to 2 decimal digits after the floating-point dot.
Sample code
const bits = 20;
const maxMultiplier = 1_000_000
const hash = CryptoJS.SHA256(serverSeed + clientSeed + nonce).toString();
const numberHex = hash.slice(0, bits / 4);
const number = parseInt(numberHex, 16);
const float = number / Math.pow(2, bits);
let multiplier = 99 / (1 - float);
multiplier = Math.max(1, Math.floor(multiplier) / 100);
multiplier = Math.min(multiplier, maxMultiplier)
Verification
We're publishing server seed after next randomization, and players can verify bet using previous Server Seed and Client Seed and nonce that related with a bet. Note that the Nonce count starts from 0 and reset after each randomization. There is a public verification script you can use to verify results, source code available and open.