Skip to content

rightjelkin/vrf-ts-256

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://nodei.co/npm/vrf-ts-256.png?downloads=true&downloadRank=true&stars=true

vrf-ts-256

ECVRF-SECP256K1-SHA256-TAI (draft-irtf-cfrg-vrf-04)

Remastering of this reference for full compability with witnet/vrf-solidity

Usage

const ecvrf = require('vrf-ts-256')

const keypair = ecvrf.keygen()
const proof = ecvrf.prove(keypair.secret_key, '73616d706c65')
const beta = ecvrf.verify(keypair.public_key.key, proof.pi, '73616d706c65');

/*
Using with truffle-contract for vrf-solidity
*/
const vrfContractInstance = await VRF.deployed()
await vrfContractInstance.verify(
    [keypair.public_key.x, keypair.public_key.y],
    [proof.decoded.gammaX, proof.decoded.gammaY, proof.decoded.c, proof.decoded.s]
    '73616d706c65'
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%