Announcing our Verifiable Random Function (VRF) Rust library

A fast and extensible Verifiable Random Function (VRF) library, which currently supports some of the most widely used elliptic cipher suites.

Introducing the vrf-rs library

use vrf::openssl::{CipherSuite, ECVRF};
use vrf::VRF;
fn main() {
// Initialization of VRF context by providing a curve
let mut vrf = ECVRF::from_suite(CipherSuite::SECP256K1_SHA256_TAI).unwrap();
// Inputs: Secret Key, Public Key (derived) & Message
let secret_key =
hex::decode("c9afa9d845ba75166b5c215767b1d6934e50c3db36e89b127b8a622b120f6721").unwrap();
let public_key = vrf.derive_public_key(&secret_key).unwrap();
let message: &[u8] = b"sample";

// VRF proof and hash output
let pi = vrf.prove(&secret_key, &message).unwrap();
let hash = vrf.proof_to_hash(&pi).unwrap();
// VRF proof verification (returns VRF hash output)
let beta = vrf.verify(&public_key, &pi, &message);
}

What is a VRF?

Why VRFs?

Contribute with us!

₿uilding Witnet • Research & Dev • Crypto and boardsports lover