💻 Javascript Implementation of Boneh-Lynn-Shacham Signatures
This repository has been archived on 2023-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
dapplion 4cb49674d5 Fix test util import 2020-11-25 15:11:02 +00:00
.github Split CI test steps 2020-11-25 11:41:28 +00:00
src Remove crypto from common helpers 2020-11-25 15:06:05 +00:00
test Fix test util import 2020-11-25 15:11:02 +00:00
.babel-register Move to packages/bls 2019-08-05 10:48:26 -05:00
.babelrc Update dev delendencies, tests, linter 2020-02-20 14:51:25 -06:00
.eslintrc.js Fix lint issues 2020-11-25 11:50:47 +00:00
.gitignore some fixes 2019-08-28 16:28:17 +02:00
.prettierignore Fix lint issues 2020-11-25 11:50:47 +00:00
.prettierrc.yml Fix prettier config file 2020-11-04 18:04:55 +00:00
CHANGELOG.md Run prettier 2020-11-04 11:40:36 -06:00
LICENSE Move to packages/bls 2019-08-05 10:48:26 -05:00
README.md Export strategies 2020-11-25 15:03:15 +00:00
blst-native.d.ts Export strategies 2020-11-25 15:03:15 +00:00
blst-native.js Export strategies 2020-11-25 15:03:15 +00:00
browser.d.ts Export strategies 2020-11-25 15:03:15 +00:00
browser.js Export strategies 2020-11-25 15:03:15 +00:00
herumi.d.ts Export strategies 2020-11-25 15:03:15 +00:00
herumi.js Export strategies 2020-11-25 15:03:15 +00:00
karma.conf.js Run only web implementation in Karma 2020-11-20 19:09:05 +00:00
node.d.ts Export strategies 2020-11-25 15:03:15 +00:00
node.js Export strategies 2020-11-25 15:03:15 +00:00
package.json Export strategies 2020-11-25 15:03:15 +00:00
tsconfig.build.json Include tests in ts-config 2020-11-04 18:00:50 +00:00
tsconfig.json remove @chainsafe/eth2-bls-wasm dep 2020-11-23 12:06:20 +01:00
webpack.config.js add bls browser test execution 2020-01-31 11:17:26 +01:00
yarn.lock Fix backing dependencies 2020-11-25 11:39:49 +00:00

README.md

bls

Build Status codecov ETH2.0_Spec_Version 0.12.0 ES Version Node Version

Javascript library for BLS (Boneh-Lynn-Shacham) signatures and signature aggregation.

Usage

import {PrivateKey} from "@chainsafe/bls";

const secretKey = PrivateKey.fromKeygen();
const publicKey = secretKey.toPublicKey();
const message = new Uint8Array(32);

const signature = secretKey.sign(message);
console.log("Is valid: ", signature.verify(publicKey, message));

Browser

If you are in the browser, import from /browser

import bls from "@chainsafe/bls/browser";

Native bindings only

If you are in NodeJS, import from /node to skip browser specific code

import bls from "@chainsafe/bls/node";

Native bindings + WASM fallback

If you want to offer a fallback in NodeJS, first try to load native bindings and then fallback to WASM

import bls from "@chainsafe/bls";

try {
  await bls.init("blst-native");
} catch (e) {
  await bls.init("herumi");
  console.warn("Using WASM");
}

The API is identical for all implementations.

Spec versioning

Version Bls spec version
2.x.x draft #7
1.x.x draft #6
0.3.x initial version

spec

test vectors

License

Apache-2.0