Is raw_rand a VRF?

I’m wondering if strictly and technically speaking the raw_rand method on the ManagementCanister is a Verifiable Random Function. I would love documentation that supports this.

Any insight would be appreciated, thanks!

1 Like

Verifiable Random Functions are functions which when called on a fresh input produce an output which looks random (together with some sort of proof that the output corresponds to the input). So, I’d say that in a very strong mathematical sense raw_rand is not even a function (let alone a VRF): you call it once you get some bytes; you call it again, you get different bytes.

However, the output of raw_rand is calculated using a Verifiable Random Function (VRF) behind the scenes. Specifically, every round we evaluate a VRF on input the number of the round – per the informal definition I gave above, the result are some fresh random bytes.
We then use these bytes as seed to a pseudorandom generator to derive randomness for each of the canisters that has made a call to raw_rand in the previous round.


@bogwar already answered your question, but if you want to learn more about how we implement raw_rand, we did a community conversation on this a while back Community Conversations | Randomness - YouTube.


Thanks @bogwar and @Manu !