> For the complete documentation index, see [llms.txt](https://trueodds.gitbook.io/trueodds/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trueodds.gitbook.io/trueodds/dice-game/randomness.md).

# Randomness

*Randomness will be the heartbeat that powers this huge, scalable, decentralized cloud - upon where everything runs.*

***Dominic Williams***

## The Random Beacon

Other game-of-choice protocols outsource their randomness to off-chain random beacons. For example, Ethereum's dApp Etheroll uses the third party [Provable](https://provable.xyz/) as their source of randomness.

True Odds instead utilizes the Random Beacon, a key aspect on the Internet Computer's consensus protocol and in its architecture as a whole, as a source of randomness. Thus, **True Odds is the first, fully 100% on-chain game-of-chance protocol** in history.

We highly suggest the reader to watch the following lecture by Timo Hanke and Dominic Williams for more information on how it works:&#x20;

{% embed url="<https://www.youtube.com/watch?ab_channel=DecypherMedia&t=2213s&v=xf1dql4Zoqw>" %}
For practical purposes only, we will try to keep this documentation as contained inside True Odds functionality as possible.
{% endembed %}

## Throwing the Dice

We use the Motoko base library [Random.mo](https://github.com/dfinity/motoko-base/blob/master/src/Random.mo) written by DFINITY to obtain a fresh `32-byte` array of entropy directly from the Random Beacon.&#x20;

`let entropy1 : Blob = await Random.blob();`&#x20;

This is used to obtain a seed used in the random number generation. At the current date, we are also using the `rangeFrom(p : Nat8, seed : Blob)` as to get numbers in the range $$\[0 \quad ... \quad2^p - 1]$$.

## House Edge

The betting limit will be set at 5 ICP at first, during the first few weeks of the protocol.

The house edge $$m$$ starts at 5% until the pool reaches 5000 ICP, then its lowered to 2%. It can be calculated using the following formula

$$m=100 \* (1 - \dfrac{1}{6}r)$$​

Where  $$r$$ is the current payout rate.\
\
Each twenty-four hours, 50% the Δ (delta, difference), between the current pool balance and the previous day pool balance snapshot will be sent out of the pool, to the True Odds reserves. The reserve is a pool which contains the ICP used to fund True Odds expansion and operational costs. The True Odds team has complete sovereignty and control over these funds.
