Exporting public keys
eozturk1 opened this issue · comments
Ercan Ozturk commented
I asked this on StackOverflow but got no response.
How can one export the derived public keys in a non-binary format? For instance,
var node = bip32js.bip32.fromBase58('<some private key>');
var child = node.derivePath('m/0/0');
var publicKey = child.publicKey(); // This gets the public key for the child
console.log(btoa(publicKey)) // This gives an error since the returned public key is not a string
Jonathan Underwood commented
publicKey is a Buffer.
publicKey.toString('hex') will turn it into a hex string.