0

我正在使用下面的代码生成公钥和私钥,我们在比特币、以太坊等中使用唯一地址进行交易sample address: mkhc2dpxmAMBqwN36TD2upqZL98v9AgP5r 如何为 EOS 生成地址?如何进行交易?

const hdkey = require('hdkey')
const wif = require('wif')
const ecc = require('eosjs-ecc')
const bip39 = require('bip39')

const mnemonic = 'butter decrease'
const seed = bip39.mnemonicToSeed(mnemonic).toString()
const master = hdkey.fromMasterSeed(Buffer(seed, 'hex'))
const node = master.derive("m/44/194/0/0/13")

console.log("publicKey: "+ecc.PublicKey(node._publicKey).toString())
console.log("privateKey: "+wif.encode(128, node._privateKey, false))
console.log("chainCode: "+wif.encode(239, node.chainCode, false))

publicKey: EOS5KvrNrXQM96jWaQmJW6QYCU28Q6p7QktcQzSCrKHe68bxXxk4R
privateKey: 5JBNSUbD4anpFFe3CbURTBtbpbUGLGtVUatDd1uL1i1HbjZjqGd
chainCode: 91wwTYUhb5szXqhwHLKgNgZ9t89Cn1DraPRnfF1FipnDjKRJWZQ
4

0 回答 0