@idena/vrf-js

1.0.1 • Public • Published

vrf-js

NPM
A reference implementation of Google Key Transparency VRF

Installation

You can use this command to install:

npm install @idena/vrf-js

Usage

You could use like this:

If you use node.js, you should require the module first:

const { Evaluate, ProofHoHash } = require('vrf-js');

or ES6 import

import { Evaluate, ProofHoHash } from 'vrf-js'

Example

// evaluate VRF proof from private key
const privateKey = [123, 254, 12, ... 11] // 32 bytes
const data = [1, 2, 3, 4, 5] // data
const [hash, proof] = Evaluate(privateKey, data)


// check VRF proof with public key
const publicKey = [23, 45, 76, ..., 22] // 65 bytes

// throws exception if proof is invalid
const hash = ProofTohash(publicKey, data, proof)

License

The project is released under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @idena/vrf-js

Weekly Downloads

40

Version

1.0.1

License

MIT

Unpacked Size

8.26 kB

Total Files

5

Last publish

Collaborators

  • idena