# @idena/vrf-js

> Reference implementation of Google Key Transparency VRF

Latest version **1.0.1** (published 2020-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @idena/vrf-js
pnpm add @idena/vrf-js
yarn add @idena/vrf-js
bun add @idena/vrf-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-08-28 |
| First published | 2020-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | ridenaio |
| Maintainers | idena |

## Links

- npm: https://www.npmjs.com/package/@idena/vrf-js
- Repository: https://github.com/idena-network/vrf-js
- Homepage: https://github.com/idena-network/vrf-js#readme
- Issues: https://github.com/idena-network/vrf-js/issues
- npm.io page: https://npm.io/package/@idena/vrf-js

## Dependencies (5)

- [bn.js](https://npm.io/package/bn.js.md) ^5.1.3
- [mocha](https://npm.io/package/mocha.md) ^8.1.2
- [elliptic](https://npm.io/package/elliptic.md) ^6.5.3
- [js-sha256](https://npm.io/package/js-sha256.md) ^0.9.0
- [js-sha512](https://npm.io/package/js-sha512.md) ^0.8.0

## Recent versions

- 1.0.1 (latest) — 2020-08-28
- 1.0.0 — 2020-08-28

## README

# vrf-js

[![NPM](https://nodei.co/npm/@idena/vrf-js.png?stars&downloads)](https://nodei.co/npm/@idena/vrf-js/)  
A reference implementation of [Google Key Transparency VRF](https://github.com/google/keytransparency/tree/master/core/crypto/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:

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

or ES6 import

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

## Example

```JavaScript
// 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](http://www.opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/@idena/vrf-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
