Package Exports
- @chainsafe/bls-keygen
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chainsafe/bls-keygen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
BLS TypeScript Key Management
Utility methods for generating valid BLS keys from random bytes or mnemonic for NodeJs and Browser.
Implementation is following EIPS: EIP-2334, EIP-2333
For low level methods of EIP-2333, check out @chainsafe/bls-hd-key.
How to use?
import {generateRandomSecretKey, mnemonicToSecretKey, deriveKey} from "@chainsafe/bls-keygen";
//random secret key
const secretKey = generateRandomSecretKey();
...
//secret key from mnemonic and path
const secretKey = mnemonicToSecretKey(
"impact exit example acquire drastic cement usage float mesh source private bulb twenty guitar neglect",
"m/12381/3600/0/0"
);
...
//secret key from seed and path
const secretKey = deriveKey(
seed,
"m/12381/3600/0/0"
);
Contribution
Requirements:
- nodejs
- yarn
yarn install
yarn run test