# How it works?

### Economic model

To join the process of creating random numbers, participants will lock native tokens( token of the chain Unpredictable DAO deployed to) into the Unpredictable DAO. After that, users, smart contracts or dapps using the random number generator will pay fees to the DAO, which are then distributed to all DAO participants, along with their originally locked tokens. In the future, we will change this native token to the token of Unpredictable DAO, but for now, applying the native token is quite convenient for our consumers such as: Dapps, smart contract in paying gas fee and our fees by just one native token.

<figure><img src="https://lh3.googleusercontent.com/7rfzVB-uQZUKY-KQQPB8OccnOUjz4FzW82mPw1AOh25to5krL3pnvgqUMS_J0iMGToSaw0gE0YtBnQbNatcjQd7AI6mseREvixMAHaAAzI_w6muaFMN8gSDUdixCdWGnAF82jIOXNfmImdkTtdDEeXzOc8qQ-dlzsNOJVjtLrk1wR2M6R5ImQ7IsrqKdaQ" alt=""><figcaption><p>Economic model</p></figcaption></figure>

### Technical model

In the first round, participants lock an amount of money in the contract and submit a hash with the formula keccak256(value + dummy).

In round 1, we submit a keccak256 hash generated from value and dummy, with the value being the data that goes into random number generation, and the dummy is for entropy. The reason for a keccak256 hash is to hide the actual value which can only be revealed later in round 2. Dummy is also a special property, we can see that if only keccak256(value) is used, a person might pre-calculate hashes for a lot of numbers, so he can guess which hash stands for which number, so we need the dummy to make the value completely unpredictable. To prevent fraud, in round 1, participants’ funds are locked and only returned if he reveals in round 2, if he doesn’t, their fund will be divided into rewards for other participants. This system is created to fight against attacks where attackers might submit a hash in round 1 but don’t reveal it in round 2.

In the second round, which happens during 7 blocks, participants will reveal value and dummy, then, funds will be returned to participants, and the number constantly changes each time new participants submit their hash. The reason why a seven-block timespan is needed is for bias and censorship resistance. It is unlikely that a single validator/miner can finalize 7 blocks in a row, so the transaction is passed to multiple block producers which should not be biased.

In the third round, after 7 blocks, the safest random numbers will be generated after merging the previous numbers with XOR. If dapps still worry about the safety of our random number generator they can wait to get the random number in this third round.

**In practice, we will have our own bots that will automatically submit random numbers so there should always be a random number available for any application in use.**
