VRF Oracle V2
Get Random numbers from Chainlink's Oracle on Chain
Chainlink VRF (Verifiable Random Function) is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability. For each request, Chainlink VRF generates one or more random values and cryptographic proof of how those values were determined. The proof is published and verified on-chain before any consuming applications can use it. This process ensures that results cannot be tampered with or manipulated by any single entity including oracle operators, miners, users, or smart contract developers.
This guide explains how to get random values using a simple contract to request and receive random values from Chainlink VRF v2
We Support Direct Funding method currently , but there is no Fees currently applied to the Client , they are paid by the DATUM Oracle Consumer contract . We will add the functionality in future.
Using VRF v2
Start by importing the datum-contracts package
Create the contracts instance with the VRF Oracle address
Next step it to request the Random numbers from contract with the numWords and Numconfirmations info , from Oracle using
requestRandomness
The process will take place in backend and will probably take about 2-3 Minutes , so be patient
To get the Random Words from the Oracle , call
getRandomness
Full Example Contract Code
In this way , you can use VRF Oracle in simple steps , extra info is available on the Chainlink Docs
Last updated