Flip-a-Chip Crypto Casino and Verifiable Randomness 🎲? (Part 1)

Flip-a-Chip Casino
2 min readAug 10, 2022

--

How to achieve randomness on chain at a low price - Flip-a-Chip Casino & ORAO Network VRF

the probability cat

When it comes to randomness, unfortunately Solana does not support random functions on chain because of the blockchain’s nature.

The smart contracts on Solana are stateless and deterministic.

What does that mean?

First, stateless means that the smart contract includes only program logic , meaning there’s no record of previous interactions and every request is handled based on the information that comes in.

Second, deterministic means that each node should be able to produce the same result when the same input is given to a method.

All these conducts to reduced code complexity and scalability.

But how are we going to request the randomness on-chain?

Answer: We are going to use an Oracle !

Oracles are entities that connects the blockchains to the external systems(one VM API??) and the way to provide external data to our instructions.

But why do we trust Oracles in the first place?

Isn’t this why we migrate our systems to blockchains? To get rid of centralised systems?
The trick is that trustworthy Oracles connects to verifiers (a distributed system) where they must agree on the random number using a consensus mechanism. Even though a one machine API might have the best intentions to provide us a random number, we can’t rely on that as we are rigorous when it comes to security.

So we decided to implement ORAO Network’ s VRF !

ORAO VRF is an unbiased randomness service whose result can be verified and it’s signed with a cryptographic signature by multiple computers.

We need to be able to achieve this inside a smart contract call, to make sure no third party can temper with our functions when it comes to the random number result.

In the next part we are going to talk about Orao-VRF Solana smart contract and how we managed to achieve a low cost verifiable random number for our games.

--

--