Trait vdf::VDFParams

source ·
pub trait VDFParams: Clone + Eq {
    type VDF: VDF + Sized;

    fn new(self) -> Self::VDF;
}
Expand description

The type of VDF parameters.

Parameters represent public information that can be shared by all users of the protocol. As such, they must implement Clone, so that they can be duplicated. They also must implement Send, so that a parallel application can send them safely across threads.

The parameters do not include the difficulty level (usually an iteration count), since that can be separate for each invocation.

This must implement Clone and Eq.

Required Associated Types

Required Methods

Creates an instance of this VDF from the given parameters.

Performance

This method is expected to be fairly cheap. For example, it is okay if it allocates memory, but it should not perform expensive computations or I/O.

Panics

This method MUST NOT fail due to invalid values for params. Such errors should be checked by the factory functions for Self::Params.

This function MAY panic for other reasons. For example, it is allowed to panic if an allocation fails, or if a needed external library could not be dynamically loaded.

Implementors