Skip to main content

Module vdf

Module vdf 

Source
Expand description

Verifiable Delay Function (VDF).

A Wesolowski-style VDF: forces sequential computation (repeated squaring) and produces a proof that the delay was executed.

§Protocol

  1. Setup: pick RSA modulus N = p * q
  2. Eval: y = x^(2^T) mod N (requires T sequential squarings)
  3. Proof: π = x^⌊2^T / l⌋ mod N where l is the prime nearest above hash(y, x)
  4. Verify: with r = 2^T mod l, check y == π^l · x^r (mod N) (the Wesolowski relation — 2^T = l·q + r and y = (x^q)^l · x^r)

Structs§

VdfOutput
VDF output with proof.
VdfParams
VDF public parameters.

Functions§

eval
Evaluate the VDF: compute y = x^(2^T) mod N and proof. This is the slow part — T sequential squarings.
setup
Generate VDF parameters with a fresh RSA modulus.
verify
Verify a VDF output without recomputing the delay.