pub trait VerifiableDelayFunction {
    // Required methods
    fn solve(&self, challenge: &[u8], difficulty: u64) -> Result<Vec<u8>>;
    fn verify(
        &self,
        challenge: &[u8],
        difficulty: u64,
        alleged_solution: &[u8]
    ) -> Result<()>;
}
Expand description

The trait for VDF.

Required Methods§

source

fn solve(&self, challenge: &[u8], difficulty: u64) -> Result<Vec<u8>>

solve inputted challenge with a given difficulty, and output a solution.

source

fn verify( &self, challenge: &[u8], difficulty: u64, alleged_solution: &[u8] ) -> Result<()>

Verify that the given alleged_solution is indeed a valid solution.

Implementors§