0.1.1 • Published 4 years ago

vss v0.1.1

Weekly downloads
16
License
MPL-2.0
Repository
gitlab
Last release
4 years ago

SYNOPSIS

Coverage Status

js-standard-style

This implements verifiable secret sharing on top of bls-lib. Its is based on Shamir's scheme but has the added benefit that ths recipients can verify their shares against a verifcation vector. This insures that dealer cannot hand out invalid shares.

INSTALL

npm install vss

USAGE

const vss = require('vss')
const bls = require('bls-lib')

bls.onModuleInit(() => {
  bls.init()
  const threshold = 5
  const numOfPlayers = 7
  const setup = vss.createShare(bls, numOfPlayers, threshold)
  
  // use `setup.secret` to encrypt something, it is a random 32 byte Uint8Array
  // post `setup.verificationVector` somewhere public
  // then send each share in `setup.shares` to someone

  // when the recipients recieve thier share they can verify that it was created
  // corectly with the verifcationVector
  setup.shares.forEach(share => {
    const verified = vss.verifyShare(bls, share, setup.verifcationVector)
    console.log(verified)
  })

  // when `threshold` number of recipients combine their shares the secert key
  // can be recovered
  const secret = vss.recoverSecret(bls, setup.shares.slice(0, threshold))
  // secret === setup.secret
})

API

./docs/

LICENSE

MPL-2.0

0.1.1

4 years ago

0.1.0

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago

0.0.0-inactive

7 years ago

0.1.0-3

8 years ago

0.1.0-2

8 years ago

0.1.0-1

8 years ago