Skip to content

Latest commit

 

History

History
 
 

on-chain-random-numbers

On-Chain Random Numbers

The Gnosis Chain features an on-chain RNG based on RANDAO. It may be leveraged by smart contract developers to introduce random numbers into their applications. Note that random numbers are limited to certain blocks in the current implementation. See below for more information.

{% hint style="success" %} The following article explains on-chain randomness functions and includes concepts and an example. It is a good place to start.

https://forum.poa.network/t/reliable-randomness-bringing-on-chain-entropy-to-the-xdai-stable-chain/3015 {% endhint %}

Randomness Contract (RandomAuRa)

RandomAura is an upgradeable contract, so it includes both an implementation and proxy address. To access, utilize the proxy address (RandomAuraProxy) along with the ABI of the implementation contract (RandomAuraCode). Seed values are read from the proxy contract.

Contract Address Last Update
RandomAuRaCode 0x5452c62412E12B87e29D8E5ef72783ADE4de93a4 June 2021
RandomAuRaProxy 0x5870b0527DeDB1cFBD9534343Feda1a41Ce47766 June 2021

{% hint style="info" %} The current implementation requires a chain running Parity's AuRa consensus mechanism with version 3.2.5+ or Nethermind v 1.10.71. The Random Number generation contract was introduced in this PR. {% endhint %}