segregated witness – Utilizing Javascript, I wish to generate a segwit personal key (zprv) equally to how I’m producing my legacy base58 prolonged personal key. How?


let bip32 = require('bip32');
let bip39 = require('bip39');
let { bech32, bech32m } = require('bech32')

const seed = bip39.mnemonicToSeedSync('rural catch say tooth inform soul highway pilot payment board goose marriage ceremony');
// ^randomly generated for this query

const node = bip32.fromSeed(seed, bitcoin.networks.testnet);

//legacy account prolonged personal key
console.log("LEGACY: " + node.derivePath("m/44'/0/0").toBase58()); 

//segwit account prolonged personal key
//how do I take the identical inputs, and get a segwit prolonged personal key / zprv

That is how I am getting my xprv, I would prefer to additionally check out getting a zprv however I am having bother discovering the documentation for this. I am assuming it’ll be one thing utilizing bech32.

Supply hyperlink

Leave a reply