Verifying the Elliptic Curve Verifiable Random Function Secp256r1 on Blockchain

Randomness is a critical issue in peer-to-peer networks because random numbers allow us to fairly select the candidates, resolve the lotteries, select block producers, etc. The difficulty is that each participant wants to verify that the random number was randomly generated, this led to the invention of verifiable random functions (VRF). The VRF is a pseudo-random function that provides a solution to blockchain-based random number generation.
This paper focuses on the implementation of an elliptic curve-based VRF introduced by NIST called ECVRF-secp256r1 in Solidity. The algorithm verifies the randomness on-chain, tests the gas consumption at each stage, and compares it to the ECVRF-secp256k1.