Problems with randomness and our solution

In traditional centralized applications, services where many people are present don't provide enough clarity and fairness. The centralized provider can definitely lie about randomness, cheat, and adjust results based on his bias, so we have come to a conclusion that we need a workable, unbiased, decentralized random number generator.

Environments like blockchains are decentralized but completely deterministic and isolated, thus making randomness fairly difficult to achieve. Some solutions were carried out for this problem. The common naive decision would normally be to use pseudorandom functions combined with changing properties on the blockchain to generate somewhat random numbers. This is often not a good idea because pseudorandom numbers often "look random" but are predictable or/and easily manipulated by block producers through censorship or block data modifications. So pseudorandom functions are definitely not the way to go, another solution is to use oracles. However, there are caveats in using oracles, with the main one being the lack of decentralization. Many existing oracles are either centralized or controlled by a limited group of node operators, which leads to centralization.

Blockchains and many applications running on them currently can not safely implement randomness in their smart contracts. Unpredictable DAO solves the randomness problem by creating a system where everyone can participate in the process of generating random numbers. The smart contracts using Unpredictable DAO service pay an amount of tokens, which will be distributed to all participants. For a technical explanation, check out our pitch video right above where we talked about the technology behind Unpredictable DAO.

How it works

So how does unpredictable DAO solve the problem?

Overall, Unpredictable DAO creates unbiased, unpredictable, and on-chain randomness for other dapps and systems to enhance their security, decentralization, and transparency. The dapps, systems, or users using service from Unpredictable DAO will pay fees, which will be distributed to Unpredictable DAO members having taken part in the running procedure of Unpredictable DAO.

Technical model

The random number generation process will be divided into 3 rounds.

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

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 randomly changes each time new participants submit their hash.

In the third round, a random number will be generated after merging the previous numbers with XOR.

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.

In round 2, 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 round 3, values are XOR-ed together since this is by far the cheapest operation we can get for random number generation.

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.

Economic model

To join the process of creating random numbers, participants will lock native tokens 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.

According to this model, if the number of participants taking part in this process increases, the average reward for each member decreases. When the average reward of Unpredictable DAO drops lower than the interest that people can earn from other sources such as staking or Yield farming from DEX, more people will move out, which makes the average reward raised again, and more people will come back to participate in this process. Thus, the number of participants joining the process of creating randomness and the reward distributed to them are modified automatically. In the development of Unpredictable DAO, we are also going to finalize other mechanisms for staking tokens, locking tokens, and distributing rewards,…to ensure the fairness and stability of Unpredictable DAO.

Auto-stake

We have also built a client for automatic participation of Unpredictable DAO, consider it as a “staking mechanism” where DAO participants lock their money and the bot submit random number for them. Kindly check it out on the web app!

How Unpredictable DAO can contribute to Evmos’s ecosystem

  • Unpredictable DAO aims to connect with a massive number of dapps on Evmos and Cosmos to provide on-chain randomness, which can not be tampered with or manipulated, leveraging the security and fairness of the Evmos and Cosmos ecosystem.
  • Unpredictable DAO introduces a new way to make passive income, where people can lock their native tokens to take part in the process of generating random numbers and earning rewards.
  • Unpredictable DAO driven by the community is always hearing suggestions from the community(especially from Unpredictable DAO members) in order to expand use cases and contributions of Unpredictable DAO in the Evmos and Cosmos ecosystem.

Specific use case of Unpredictable DAO

DAO participants

  • Giving rewards for DAO participants taking part in the process of generating randomness.
  • Giving the governance for DAO participants to modify How Unpredictable DAO works

NFT games and metaverse

  • Making the game more fair and unmanipulated in the processes of generating Maps, generating Loot Box Contents, distributing loot items, placing Items on Maps, etc.
  • Randomly creating and distributing gaming NFT, characteristics of NFT, etc.
  • Bring true fairness to gambling games.

NFT project

  • Randomly assigning NFT Traits or assigning NFT Traits using given probability.
  • Fairness in distributing NFT, giving users access to verifiable proof that the NFT assets they get are generated and distributed using tamper-proof randomness.
  • Launchpad.
  • Whitelisting Users for IDO Allocations in Launchpad.

DEFI

  • Staking with random rewards (like Moonpot).
  • Lottery ticket with fairness.
  • Airdrop platform
  • Transparently distributing airdrops.

Problems with existing solutions

  • Relying on dynamic properties of the blockchain: A common naive solution that developers would think of is to rely on changing attributes from the blockchain such as blocks’ data (timestamp, hash, etc) or dynamic state properties like balances. These approaches would often make the result in favor of block producers, since they can change block’s data easily, and they can manipulate transactions’ order to gain state changes that would give out the "random" result they prefer.

  • Using VRFs from oracles: One of the most preferred solutions is to use centralized services that provide randomness for smart contracts, notably Chainlink VRFs. The problem with this approach is pretty clear, operators from the oracle can easily manipulate the randomness given.

How Unpredictable DAO differs

  • Unpredictable DAO requires 2 rounds to create a random number, with the first round used to submit masks of real values, so block producers can not pre-calculate the random number, and the second round revealing the submitted values but with a time delay to render block producers’ censorship obsolete. Overall, Unpredictable DAO can not be manipulated by block producers like the first solution mentioned.

  • Unpredictable DAO’s random number generator is decentralized with many participants joining to create a random number, whereas something like Chainlink VRFs is controlled by a small set of node operators.

Challenges we ran into

Secure randomness is already hard to implement, but secure randomness on blockchains is much, much more difficult to achieve. The Unpredictable DAO team has run into numerous impractical ideas and failed implementations, only then to bring out the current Unpredictable DAO that we are happy with throughout all of our hard work.

Accomplishments that we're proud of

Again, randomness on a deterministic environment like blockchains is not easy to create, and it is almost impossible to implement such a system that is secure, decentralized, fully accessible on-chain, unpredictable and non manipulatable. We are really proud that Unpredictable DAO can solve the problem, and from that, we also wish it can bring much more possibilities to applications and smart contracts from Cosmos and the blockchain industry in general.

What we learned

Aside from time management, teamwork and innovative problem solving, which are valuable skills from competing in the hackathon, we have also had a chance to expand our knowledge about the core technologies behind Cosmos and some of their appchains, which I believe is the best thing we had received from this hackathon to further improve Unpredictable DAO.

How our project utilizes Cosmos & impacts on Cosmos

Thanks to the Cosmos SDK and the Cosmos's multi-chain network, appchains are highly customizable, thus making fast, decentralized EVM hubs like Evmos available, which are the suitable platforms that power Unpredictable DAO.

Unpredictable DAO brings truly unbiased and unpredictable randomness to the Cosmos ecosystem, which helps further expand a ton of possibilities from them without losing any security like existing on-chain random number generators. It is usable by every smart contract for decentralized applications, and through Cosmos's multi-chain architecture, it can also be used by any appchains to further strengthen the network.

What's next for Unpredictable DAO

Our main goal is to gather participants from the Cosmos community to make the DAO even more secure and decentralized, as well as having the adoptions from developers to integrate our random number generator into their applications and smart contracts, expanding the possibilities of blockchains.

We are working to extend the use case of Unpredictable DAO. In addition, we also hope that with the strong community and top-notch technology of Cosmos, developers can figure out a way to use our randomness to enhance their product’s security.

Built With

Share this project:

Updates