为了账号安全,请及时绑定邮箱和手机立即绑定

导出 BIP32 公钥(Base64 格式)

导出 BIP32 公钥(Base64 格式)

哈士奇WWW 2023-08-24 15:53:35
我正在使用这个BIP32 实现来派生密钥。如何导出 Base64 格式的派生公钥?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 childconsole.log(btoa(publicKey)) // This gives an error since the returned public key is not a string
查看完整描述

1 回答

?
喵喵时光机

TA贡献1846条经验 获得超7个赞


publicKey是一个缓冲区。

publicKey.toString('hex') 会将其转换为十六进制字符串。

类似地,对于 Base64,可以使用“base64”。


查看完整回答
反对 回复 2023-08-24
  • 1 回答
  • 0 关注
  • 96 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信