Skip to main content

Randomness

While true-randomness on some computers can be made possible via atmospheric noise and special hardware modules, such solutions on blockchains are not possible since they are virtual machines without physical hardware. Thus, pseudorandom-functions are needed to close this gap. You should be skeptical of teams claiming they offer true randomness.

Random numbers are crucial for many DeFi applications whether its fair NFT launches, gambling, gaming, or assigning user roles in a DAO. Without an element of randomness, each of the above could be exploited and the final outcome predicted.

Switchboard has had a Verifiable Random Function (VRF) deployed on Solana since February 2022. While this is not going away, it should be replaced in favor of using a Switchboard Function to generate randomness within a TEE and perform the callback into the users program. The Solana VRF implementation required 40+ transactions in order to perform the necessary computations while a Switchboard Function will take only a single transaction to settle resulting in a better user experience.

tip

A Switchboard Function can be used to generate randomness within a secure enclave.