JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1414
  • Score
    100M100P100Q110804F
  • License ISC

BIP84 - Derives segwit + bech32 addresses from zprv/zpub and vprv/vpub in javascript

Package Exports

  • bip84

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 (bip84) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

BIP84

Derives segwit + bech32 addresses from zprv/zpub and vprv/vpub in javascript

Installing

Run - npm install bip84 --save

Using

var BIP84 = require('bip84')

var vprv = new BIP84('vprv9KacKBSdiYsCfJSMa2tJekrhxxvJWhpoShz5SV8MJkt4av2wiqgMWKWddjAxtizdFYmg5o4ybHWkXWSSe2g4sKKbZwFxUdu6rWoXvoACsVy')
var vpub = new BIP84('vpub5YZxigyXYvRVsnWpg4RK1toSWzknvAYeovugEsXxs6R3TiN6GNzc47q7UzcEiFkhwmzTcx83B61PEuXXkrTWPMbyjcZXBbe9BU8oKcrHb1g')

var zprv = new BIP84('zprvAd8nxfJY24ad35tHSynGRpdAPymTj8hQhYG75pjgpwz9mpZ3Sq2G2YN1VmfXsWdZeXPkpouQReKZnj7VsTC69nVnubL2U2gZeUwmGot9AaW')
var zpub = new BIP84('zpub6r89NAqRrS8vFZxkZ1KGnxZtx1bx8bRG4mBhtD9JPHX8ectBzNLWaLgVM3owthf1JVAWqLgZdsUugsDDoHrq5RdRMAtiUTaEmyUaaAkasVu')

console.log(vprv.getAddress(0))
console.log(vpub.getAddress(0))

console.log(zprv.getAddress(0))
console.log(zpub.getAddress(0))

Reference

BIP 84

alt text

1NzRXQa3gL1kAVZZGMjedUqM3Z3MSDFyv6