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
Mario Cao
Jun 3, 2019 · 2 min read
Image for post
Image for post

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 Foundation Blog

A P2P protocol that connects smart contracts to the real…

Thanks to Gorka Irazoqui Apecechea

Mario Cao

Written by

Mario Cao

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

The Witnet Foundation Blog

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

Mario Cao

Written by

Mario Cao

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

The Witnet Foundation Blog

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

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store