6

I am interested in using the new PREVRANDAO value as a source of pseudo-randomness in calculating the Miller-Rabin probabilistic primality test on-chain. Chainlink VRF is an option but ideally I would like to not have any external dependencies in my contract. Architecturally, I would plan to use the value as a seed to generate a sufficient number of a bases to be used in the test.

My understanding is that it is only pseudo-random, and not truly random, as the validator has the option to choose NOT to propose a block, IF the current randomness value is favourable to them in some context. This differs from eg. using block.blockhash or others for randomness as the validator has a lot more influence over the value in this case.

My question is, how likely is it for this to occur, given that I generate a sufficient number of a bases? Given that the value is random the test should not be affected, but the validator still has influence over whether it's used or not.

3

1 Answer 1

2
+25

I believe this depends on if there are any financial incentives involves in the process or outcome of your Miller-Rabin probabilistic primality test. If there are, and the financial incentives outweigh the cost of manipulating the data, then it's likely someone could influence your test by choosing whether to use the PREVRANDAO value or not. If there are no incentives or the incentives don't outweigh the cost of manipulating the data, even if the PREVRANDAO value is only pseudorandom, I don't think the process or outcome of your test would likely be affected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.