Registration
During early access, all users of the Verified Random Number Generator system must be manually registered. In order to use it your contract address must be approved, otherwise any requests will revert.Supported Networks
Usage
Requesting a Random Number
The following interface provides a method for requesting random numbers. Your contract can call the VRFSystem deployed on each chain. You can optionally provide a traceId, which will be annotated to each event (Useful if you have one transaction that does many steps, users can trace their transactions on chain). This is not required and can be left as 0.Random Number Callbacks
Every random number requested is delivered as soon as the first available number from drand is available to be delievered. This can take as long as 3 seconds.What if I want to have different numbers in the same 3 second window?
By default, we deliver the same number to all requests inside the same 3 second window that drand provides. This is great to be able to verify, but if you would like to have users all have different numbers over this time period, we recommend you add a source of entropy. Here’s a couple of examples of having unique random numbers per transaction.What if I want to have different numbers in the same transaction?
By default, we will give you only one number per transaction. We encourage developers to use this number to dervive other numbers from this to create new numbers.Blockchain Events
The contract will emit the following events.Verifying the round number / random number with drand
If you want to verify the random number, you can check directly with drand for this. We use drand’s quicknet for this. For instance, to see the roundNumber 11: GET https://api.drand.sh/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971/public/11ebdcbfe855d10c56db22455fa5a18963c1f62d85f859c35c310273449b49d284
Manual Retries with EIP712 signatures
🧪 This feature is in Preview. Please contact us on slack if you wish to use this.In a very rare instance, you may see random numbers fail to be delivered. In most cases this will be an issue on the contract side. In these situations, you can choose to deliver this number yourself. First you should request the EIP712 signature from our API servers which you can use to deliver the random nummber directly to the contract on the blockchain. Request: Try the API!
⚠️ Warning: You will be racing the normal relay flow. If you get a tx revert with InvalidRequestId, this means that a relay has already delivered this random number. Random numbers can only be delivered once.
