Function estimateDifficulty

  • Estimate a VDF difficulty (iteration count) for a target wall-clock delay.

    Results are approximate. Hardware, JS engine, and thermal throttling vary. For Pietrzak, the value is forced even and clamped to [66, 7000].

    Parameters

    Returns number

    import { estimateDifficulty, WesolowskiVDFParams, DISCRIMINANT_256 } from 'crypto-vdf';

    const difficulty = estimateDifficulty({ bits: 256, targetSeconds: 2 });
    const vdf = new WesolowskiVDFParams(256).new();
    const proof = await vdf.solve(challenge, difficulty, DISCRIMINANT_256);