poanetwork / vdf

An implementation of Verifiable Delay Functions in Rust
Apache License 2.0
174 stars 53 forks source link

Calling `create_discriminant` #24

Open hartogss opened 8 months ago

hartogss commented 8 months ago

Hi,

we are using this crate for a project and wonder why create_discriminant is called every time vdf::solve and vdf::verify are called. Is it because we have to use a fresh class group for every VDF evaluation in order to guarantee sequentiality?

create_discriminant is computing a large negative prime, seeded by the current challenge input, x, that is being evaluated or verified. The default discriminant size is 2048 bits -- why was it chosen like this? This way of mapping from the challenge x to a single class group element while varying the class group using the discriminant seemingly was brought over from the Chia VDF, although they only use 1024 bits.

Also, we've noticed that its performance can vary greatly depending on the input (usually between 500-600ms, sometimes up to 900ms on a Ryzen 7 5850U) -- in turn, VDF evaluation can also vary quite a bit, especially if the delay parameter t is small.