GithubHelp home page GithubHelp logo

circle-free / vrf-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from idena-network/vrf-js

0.0 2.0 0.0 16 KB

Reference implementation of Google Key Transparency VRF

License: MIT License

JavaScript 100.00%

vrf-js's Introduction

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.

vrf-js's People

Contributors

ridenaio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.