Module vdf_delay

Module vdf_delay 

Source
Expand description

Verifiable Delay Functions (VDF) for time-based proofs.

This module provides a VDF implementation based on sequential hashing. VDFs are functions that require a specified number of sequential steps to compute, but can be verified quickly. They’re useful for generating unbiased randomness and proving that a certain amount of time has elapsed.

§Features

  • Sequential computation with adjustable delay
  • Fast verification
  • Deterministic output given input and delay
  • Hash-based construction using BLAKE3

§Use Cases in CHIE Protocol

  • Fair leader election without bias
  • Randomness beacons
  • Proof of elapsed time
  • Anti-spam mechanisms with computational costs

§Example

use chie_crypto::vdf_delay::{VdfParams, vdf_compute, vdf_verify};

// Create VDF parameters with 10000 iterations
let params = VdfParams::new(10000);

// Compute VDF on input
let input = b"random_seed_12345";
let (output, proof) = vdf_compute(&params, input);

// Verify the proof (much faster than computation)
assert!(vdf_verify(&params, input, &output, &proof).is_ok());

Structs§

VdfOutput
VDF output value.
VdfParams
Parameters for VDF computation.
VdfProof
Proof of VDF computation.

Enums§

VdfError
VDF-specific errors.

Functions§

vdf_compute
Compute VDF on given input.
vdf_randomness_beacon
Compute VDF for randomness beacon.
vdf_verify
Verify a VDF proof.

Type Aliases§

VdfResult