This is a PoC level code. Do not use it.
VDFVerify.sol smart contract verifies Wesolowski VDF in 2048 bit RSA setting.
We used the hash to prime variant defined in section 7 of BBF19 where prover picks a nonce from small set and appends it to the transcript until they hit a prime number as hash result. Prover sends the nonce along with the proof to the verifier so that verifier performs single primality test.
operation | cost in gas |
---|---|
verify VDF | 173062 |
verify VDF with base and calldata | 207827 |
modexp (2048,256,2048) | 87012 |
modexp (256,256,256) | 1666 |
mul2048 | 13519 |
miller rabin 15 | 30994 |