Written by neepheid, cha0sg0d, yush_g, with thoughts by ludens
Note: All of the thinking in this post has already been done many times in the past, including this blog post and this research conference. Our goal with this post is to strip away all the complexity of understanding eth2 and instead discuss the specific usecase of randomness in smart contracts.
Introduction -- usecases for on-chain randomness
Having an on-chain source of randomness enables of host of games, NFT mints, and financial mechanisms.
Currently, most Dapp developers use a randomness oracle (like Chainlink) or some version of the hash of a previous block (blockhash).
As discussed below, a blockhash can be easily manipulated by a malicious actor and there is overhead and cost involved with setting up Chainlink, as well as a trust assumption on their protocol
Baked into the core Ethereum protocol is a "reasonably" (defined below) random value referred to as PREVRANDAO that is generated by the proposer of each block, accessible via the difficulty opcode.
This post will share some background about how the PREVRANDAO value works and propose a use case for on-chain games that enables developers to access a better source of randomness than blockhash in just a few lines of code.