# Provably Fair

### Overview

Solving Trust Issues in Online Gaming

The underlying concept of [provable fairness](https://en.wikipedia.org/wiki/Provably_fair) is that players have the ability to prove and verify that their results are fair and unmanipulated. This is achieved through the use of a [commitment scheme](https://en.wikipedia.org/wiki/Commitment_scheme) , along with cryptographic hashing.

This is simplified in the following representation:

### Fair results = authoritative third-party + uncontrollable principle + randomness

An authoritative third-party refers to a recognized, reputable, and independent third-party organization that can provide trustworthy random numbers or game results. Neither the third-party nor the clients themselves can control or influence the outcome.

The uncontrollable principle refers to the random numbers or game results generated under uncontrollable factors, such as hash functions on the blockchain. Neither the operator nor the clients can predict, control, or influence these random numbers or game results. This principle ensures the fairness and randomness of the game results.

Randomness refers to the randomness of the random numbers or game results. Randomness is crucial, as it can prevent operators from manipulating the game results. By using authoritative third-party and uncontrollable principles, randomness can be ensured.

### 3rd Party

#### Prediction：[Chainlink](https://data.chain.link/polygon/mainnet/crypto-usd/btc-usd)

Chainlink Oracle is a blockchain-based data source supported by Chainlink. It enables smart contracts to access and use data from the external real world by bringing off-chain data onto the blockchain. Chainlink Oracle utilizes a decentralized node network that plays a critical role in collecting, validating, and submitting data. These nodes collect off-chain data, such as stock prices, weather data, sports scores, and submit it to the blockchain for use by smart contracts. The design of Chainlink Oracle aims to enhance the reliability and security of smart contracts by avoiding unreliable data sources and centralized single points of failure.

#### [TRON Block Hash](https://tronscan.org/#/)     [**Ethereum** Block Hash](https://etherscan.io/)      [**Binance Block Hash**](https://bscscan.com/)

&#x20;block hash is a string of 64 hexadecimal characters. Each character can be a digit from 0-9 or a letter from a-f. This hash value is used to uniquely identify each block on the  block.

A hash value is a function that converts a message of arbitrary length into a fixed-length digest, and it has the characteristics of one-wayness, collision resistance, and avalanche effect. Due to the one-wayness of the hash function, meaning that it is impossible to reverse the output hash value to derive the original input message, the hash value is unpredictable.

#### Taiwan lottery&#x20;

#### British Columbia Lottery Corporation

#### OPAP

#### Georgia Lottery

### Game Events

#### Prediction

"Popular" has used two price sources in our price prediction market, each of which plays a different role in the prediction market.

#### ChainLink Oracle

* Used for the Lock price and End price of each prediction market round. This updates in intervals of 20 seconds.
* Our prediction contract uses the ChainLink Oracle price feed to set the prices used to dictate whether a user has won or not.
* Used for the "Chainlink" chart on the interface.

#### Binance

* Used for real-time price updates on the Popular prediction market interface.&#x20;
* Used for the "TradingView" chart on the interface.

Due to the use of two different price sources, the real-time price updates from Binance and the prices from ChainLink Oracle may have slight differences, but they should not have significant fluctuations.

**TRON1  TRON3  TRON5   Ethereum1   Ethereum3  Ethereum5   Binance1  Binance3  Binance5**

In  lottery, the numbers "1", "3", and "5" represent the lottery running time, i.e. 1 minute, 3 minutes, and 5 minutes respectively. The lottery number is drawn from the last 5 digits (ignoring letters) of the  block hash value.

For example, if the  block hash value is 000000000319f5d15f357b244dc1fe3161fac4c8dba6b7e92a67c9fbadc5f2bb, then the last five digits are 67952, and the winning number is 6-7-9-5-2.

#### Chainlink10

Chainlink10 is a lottery game that runs every 10 minutes. After the sales deadline, a 5-digit random number in the range of 00000-99999 is requested from Chainlink VRF.

**TRON1-Cash5  TRON3-Cash5  TRON3-Cash5  Ethereum1-Cash5   Ethereum3-Cash5   Ethereum5-Cash5   Binance1-Cash5   Binance3-Cash5   Binance5-Cash5**

Cash5 is a type of lottery game. The numbers "1", "3", and "5" respectively represent the lottery running time, i.e. 1 minute, 3 minutes, and 5 minutes. The lottery number is drawn from the last 5 unique characters (ignoring duplicates) of the  block hash value. Each of the numbers 0-9 corresponds to its respective value, while the letters a=10, b=11, c=12, d=13, e=14, and f=15.

For example, if the  blockchain hash value is 000000000319f5d15f357b244dc1fe3161fac4c8dba6b7e92a67c9fbadc5f2bb, the last 5 unique characters are c-5-f-2-b (ignoring the repeated character ). Since c=12, b=11, and f=15, the lottery number would be 12-5-15-2-11.

**TRON1-Sic Bo    TRON3-Sic Bo  TRON5-Sic Bo  Ethereum1-Sic Bo  Ethereum3-Sic Bo   Ethereum5-Sic Bo   Binance1-Sic Bo   Binance3-Sic Bo   Binance5-Sic Bo**

Sic Bo is a type of lottery game where the numbers "1", "3", and "5" represent the duration of the lottery in minutes. The winning numbers are determined by taking the last three letters of the  block hash value, ignoring any numbers. In this game, the letters "a" through "f" correspond to dice 1 through 6, respectively.

For example, if the  block hash value is 000000000319f5d15f357b244dc1fe3161fac4c8dba6b7e92a67c9fbadc5f2bb, then the last three letters are f-b-b, where f corresponds to dice 6 and b corresponds to dice 2. Therefore, the winning number is (dice 6-dice 2-dice 2), which is 662.

#### Taiwan5

Taiwan5 is a lottery game derived from the evolution of Bingo Bingo, issued by the Taiwan Lottery Corporation. In Bingo Bingo, 20 numbers are drawn from a range of 1 to 80 to determine the winning numbers. The winning numbers are then processed according to certain rules to obtain the winning numbers for Taiwan5. The evolution rules are as follows:

1. Arrange the winning numbers in ascending order.
2. Add the numbers from the 4th to the 6th positions and take the units digit of the sum as the result for #1.
3. Add the numbers from the 7th to the 9th positions and take the units digit of the sum as the result for #2.
4. Add the numbers from the 10th to the 12th positions and take the units digit of the sum as the result for #3.
5. Add the numbers from the 13th to the 15th positions and take the units digit of the sum as the result for #4.
6. Add the numbers from the 16th to the 18th positions and take the units digit of the sum as the result for #5.

#### Canada 3.5

Canada 3.5 is a lottery game that evolved from Keno, a lottery issued by the British Columbia Lottery Corporation in Canada. In Keno, 20 winning numbers are drawn from a range of 1 to 80. The winning numbers for Canada 3.5 are derived through a process called evolution.

Here are the evolution rules:

1. Sort the winning numbers in ascending order.
2. Add the numbers from the 4th to the 6th positions and take the units digit of the sum as the result for #1.
3. Add the numbers from the 7th to the 9th positions and take the units digit of the sum as the result for #2.
4. Add the numbers from the 10th to the 12th positions and take the units digit of the sum as the result for #3.
5. Add the numbers from the 13th to the 15th positions and take the units digit of the sum as the result for #4.
6. Add the numbers from the 16th to the 18th positions and take the units digit of the sum as the result for #5.

{% hint style="info" %}
\*Tron adopts a 3-second block time as the confirmation time for winning blocks.

\*Ethereum adopts the block produced at the 11th second of each minute as the confirmation time for winning blocks.

\*Binance Chain adopts a 3-second block time as the confirmation time for winning blocks. If there is no block in 3 seconds, the next available block, such as 4 seconds, will be used for confirmation, and so on.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://popular.gitbook.io/popular/provably-fair.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
