KIP-55: Update Random Number Generator

This is a proposal to use the function changeRNGenerator to update the RNG used by Kleros. The new RNG will use BeaconRNG.sol as deployed at


Post-merge, the best native source of randomness that will be accessible in the EVM will be the Randao values that the Ethereum consensus algorithm itself will use to choose its committees of attestors/block producers in a given epoch. Particularly, under EIP 4399 which is part of the merge, this value will be returned by using the OPcode that is currently being used for block difficulty. The check that block.difficulty<=2**64 follows a pattern recommended by EIP 4399, where such values are very likely to be produced if and only if the merge has not happened yet, so if the merge has not happened yet the new RNG defaults back to the old RNG.

Note final testing on this contract is still being done, so if a critical vulnerability is found prior to implementation this proposal should be considered to be voided.