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.

Mario Cao
The Witnet Oracle Blog
2 min readJun 3, 2019

--

Recently Gorka Irazoqui Apecechea and I proudly published a VRF crate as an open source project under the MIT license.

The library is a fast, flexible and general-purpose Verifiable Random Function (VRF) library written in Rust, which follows the IETF standard draft written by Sharon Goldberg, Moni Naor, Dimitris Papadopoulos, Leonid Reyzin, and Jan Včelák.

Introducing the vrf-rs library

  • RFC6979 for the nonce generation functionCurrently the supported cipher suites use the SHA256 hashing algorithm and the following elliptic curves: secp256k1, secp256r1 and sect163k1.

The library was written with the idea of being extensible so that additional cipher suites and algorithms can easily be added by implementing the trait VRF.

  • RFC6979 for the nonce generation functionCurrently the supported cipher suites use the SHA256 hashing algorithm and the following elliptic curves: secp256k1, secp256r1 and sect163k1.

A complete example can be found in examples/basic.rs

What is a VRF?

A VRF is a cryptographic primitive that provides a pseudo-random function along with a publicly verifiable proof of its outputs’ correctness. Additionally, the VRF hash output is deterministic, in the sense that it always produces the same output given the same pair of inputs. VRF were firstly introduced by Micali, Rabin and Vadhan in 1999.

It can be better understood as the public-key version of a keyed cryptographic hash. Only the holder of the VRF secret key is able to compute a valid hash (i.e. pseudo-random value), while anyone with the public can verify its correctness.

Why VRFs?

VRFs are widely used in various cryptographic schemes, protocols and systems. Similarly to Algorand, the Witnet network protocol uses VRFs to conduct secret cryptographic sortitions which are used for the leader and committee selections as part of the underlying consensus protocol. Cryptographic sortition allows Witnet blockchain to be secure while being efficient and scalable.

Contribute with us!

Please take a look to our GitHub repository and feel free to report issues, propose changes and contribute to the code.

--

--

The Witnet Oracle Blog
The Witnet Oracle Blog

Published in The Witnet Oracle Blog

A P2P protocol that connects smart contracts to the real world #DontTrustTheMessenger

Mario Cao
Mario Cao

Written by Mario Cao

Research & Dev @ SEDA 👨‍🚀