3.1.0 • Published 5 years ago

@olympus-protocol/bip32-bls v3.1.0

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

bip32-bls

A BIP32 compatible library using BLS12-381 written in TypeScript with transpiled JavaScript committed to git.

Requirements

To work with BIP32 keys using BLS you first need to initialize the bls module using the bls wasm library

Example

TypeScript

import * as bip32 from '@olympus-protocol/bip32-bls';
import * as bls from '@olympus-protocol/bls-wasm';
import { BIP32Interface } from '@olympus-protocol/bip32-bls';

bls.initModule().then( (mod) => {
    let node: BIP32Interface = bip32.fromBase58(mod, 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi');
    let child: BIP32Interface = node.derivePath('m/0/0');
})

NodeJS

let bip32 = require('@olympus-protocol/bip32-bls')
let bls = require('@olympus-protocol/bls-wasm');

bls.initModule().then( (mod) => {
    let node: BIP32Interface = bip32.fromBase58(mod, 'xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi');
    let child = node.derivePath('m/0/0')
})