RANDAO Consumption and Incentive
Last updated
Last updated
RANDAO participants are incentivized for their contribution to the protocol. The source for this incentive is from RANDAO consumers, who request for random numbers from the protocol.
In our implementation, we additionally introduce a role of payers, who are willing to pay for each request for a random number from a consumer, which is typically a contract (but yet no such limitation is implemented). The payer makes a deposit into a contract (called RandaoFund). The payer could register a list of accounts of which call fees are covered by the payer. The payer does not need to register his account because it is enabled by default.
A whitelisted account could use the following interface to interact with the Randao contract for random numbers.
The first function currentBlock()
returns the highest RANDAO round ID at the calling time. Likely RANDAO rounds between N
and N-2*M
are not finalized, where N = currentBlock()
, and M
is the RANDAO period, returned by the function RANDAO_PERIOD()
. In other words, any requests to get the random numbers generated in these rounds will be rejected. For example, if currentBlock()
returns 100, and RANDAO_PERIOD()
returns 10, all rounds from 91 to 100 are not finalized.
The second function random()
is to request for a random number. In the current implementation, the returned value is generated base on an initial seed which could be any integer number, called sugar
, and random numbers generated in a number of consecutive RANDAO rounds, called salt
, based on a given pivot RANDAO round, denoted by randaoId.
Notably, the function will be rejected if the given RANDAO round is not finalized.
Successful calls of random()
are charged at a predefined and fixed rate (exclude the consumed gas). This charge is used as the incentive for the RANDAO participants (80%) and the RANDAO platform operator (20%).
RANDAO participants are incentivized proportionally to the number of RANDAO rounds they have successfully contributed (i.e., submit and reveal secret numbers in a proper timeline) in a period of time, called epoch. The incentive for a participant is calculated as follow:
Only participants who contribute to at least 80% of RANDAO rounds within an epoch are eligible to be incentivized. The incentive of ineligible participants will be automatically transferred to the next epoch.