vrfVerify method
Verifies a Verifiable Random Function (VRF) output and its proof.
This method verifies the validity of a VRF output and its corresponding proof by comparing it to a transcript and the provided proof.
Parameters:
script
: A transcript containing context-specific information used for VRF verification.output
: The VRF output to be verified.proof
: The proof associated with the VRF output.
Returns: A boolean indicating whether the VRF output and its proof are valid (true) or not (false).
Example Usage:
MerlinTranscript script = ...;
List<int> vrfOutput = ...;
VRFProof proof = ...;
bool isVRFValid = vrfVerify(script, vrfOutput, proof);
The vrfVerify
method is used to verify the validity of a Verifiable Random Function (VRF) output and its proof
by comparing it to a transcript and the provided proof. It returns true
if the output and proof are valid,
and false
otherwise.
Implementation
bool vrfVerify(MerlinTranscript script, List<int> output, VRFProof proof) {
final publicPointHash = vrfHash(script);
final vrf = VRFInOut._(publicPointHash.toBytes(), output);
final vrifyScript = MerlinTranscript("VRF");
return dleqVerify(vrifyScript, vrf, proof);
}