1.0.0-beta7 • Published 5 years ago

@nodefactory/bls-keystore v1.0.0-beta7

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

@nodefactory/bls-keystore

Build Status npm Discord License: MIT

Bls keystore implementation as per draft EIP 2335 for node and browser.

Electron usage
  • Set env variable ELECTRON=true because electron replaces openssl with BoreSSL which causes some incompatibilities when using native modules.

How to use?

import {Buffer} from "buffer";
import {Keystore} from "@nodefactory/bls-keystore";

// encrypt private key
const privateKey: Buffer;
const password = "SomePassword123"; 
const keystore = Keystore.encrypt(privateKey, password, "m/12381/60/0/0");

//verify password
keystore.verifyPassword(password); //true | false

//decrypt
const decryptedPrivateKey: Buffer = keystore.decrypt(password);

//save as json
keystore.toJSON(); //string

For key derivation checkout @chainsafe/bls-ts-key-mgmt

Contribute

  • get yarn
  • yarn install
  • yarn test

Built by

NodeFactory

1.0.0-beta7

5 years ago

1.0.0-beta6

5 years ago

1.0.0-beta4

5 years ago

1.0.0-beta5

5 years ago

1.0.0-beta3

5 years ago

1.0.0-beta2

5 years ago

1.0.0-beta1

5 years ago

1.0.0-beta

5 years ago