A Library that provides developers with Trustless Verifiable Randomness proven by Recursive ZK Technology
Motivation: Randomness is essential in many applications. It’s what underpins cryptography, makes sampling fair and generates the unpredictability and excitement we love in games.
Problem Statement: Current random generators either require trust, are extremely expensive or overkill for a lot of applications. Just as there are many different uses for randomness, there is also a need for different sources of randomness.
Design Statement: To develop a zero knowledge library that is able to provide trustless verifiable randomness that is free and easy to implement.
Solution: MINAmal VRF is a library of functions to allow developers to quickly implement trustless randomness in their projects. Randomness is generated through an amalgamation of hashed secrets from the participating users and cycles to include the previous random numbers as each round of generation is required.
A ZK proof is created to verify that the randomness was fairly generated. For on-chain verification, the Mina protocol is used for it’s recursive ZK proof system. A relayer was built to allow the proof to be access from any other chain.
To empower developers, an SDK was built for easy implementation.
Further Improvements:
This project consists of 3 key components and 2 smart contracts deployed across 6 different chains. The first is a library that allows people to easily build trustless verifiable randomness into their applications. This library is built using MINA SnarkyJS which allows us to quickly verify the proof using MINA’s Kim Chi’s recursive proving system. The randomness that is generated cannot be controlled by any party nor is it predictable due to our custom built Natto Interactive Random Protocol. The Natto Interactive Random Protocol is defined by the following formula: Σ((Secret Hash₁), (Secret Hash ₂),(Secret Hash₃)) = Initial Hash Random 1 = R((Secret₁), Initial Hash)) Random 2 = R((Secret₂), Initial Hash, Random 1) Random 3 = R((Secret₃), Initial Hash, Random 2) The commitment of an Initial Hash prevents players from changing their secret in subsequent turns as this would cause the Initial Hash to not match in the proof.
The second component in this project is the custom relayer. The relayer takes the Proof generated by MINA and provides verification before sending it to the destination EVM chains. The relayer is a temporary solution due to the Mina EVM bridge not yet being available.
The third component of this project is a front end game of Texas Holdem to demonstrate the use of MINAmal VRF. The front end is built with a dashboard to display the current Hash of each player and the current random generated. This is shown alongside the Texas Holdem game and displays in real time the backend values as each card is dealt.
In addition to the 3 components, 2 types of smart contracts have been deployed across 6 different EVM chains. The first smart contract is a universal relayer smart contract which facilitates the receival of the verified proof from the relayer. The second smart contract is an EVM Proof Channel which allows participants to publicise their proof. This channel allows the participants to trustlessly cross verify that the random numbers have not been tampered with.