vrfInOut method

VRFInOut vrfInOut(
  1. MerlinTranscript script
)

This function computes the VRF (Verifiable Random Function) input and output using the provided MerlinTranscript as the cryptographic context.

The process involves hashing a transcript with the public key to generate a curve point, multiplying this point with the private key, and returning the corresponding VRF input and output.

Implementation

VRFInOut vrfInOut(MerlinTranscript script) {
  final publicHashPoint = publicKey().vrfHash(script);
  final keyBig = BigintUtils.fromBytes(key(), byteOrder: Endian.little);
  final mul = publicHashPoint * keyBig;
  return VRFInOut._(publicHashPoint.toBytes(), mul.toBytes());
}