1.0.2 • Published 1 year ago

nip06 v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

NIP06

tests

Install

npm i nip06

Usage

import {
  privateKeyFromSeedWords,
  getPublicKey,
  getBech32PrivateKey,
  getBech32PublicKey
} from 'nip06'

const mnemonic = 'zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong'
const passphrase = 'your super secure passphrase' // optional

// hex format
const { privateKey } = privateKeyFromSeedWords({ mnemonic, passphrase })
const { publicKey } = getPublicKey({ privateKey })
// bech32 format
const { bech32PrivateKey } = getBech32PrivateKey({ privateKey })
const { bech32PublicKey } = getBech32PublicKey({ publicKey })