@nodefactory/bls-keystore
v1.0.0-beta7
Published
[![Build Status](https://travis-ci.com/NodeFactoryIo/bls-keystore.svg?branch=master)](https://travis-ci.com/NodeFactoryIo/bls-keystore) ![npm](https://img.shields.io/npm/v/@nodefactory/bls-keystore) ![Discord](https://img.shields.io/discord/60820486459346
Downloads
11
Readme
@nodefactory/bls-keystore
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