Blockchain 如何在nodejs中生成EOS地址或用户名?

Blockchain 如何在nodejs中生成EOS地址或用户名?,blockchain,ethereum,eos,Blockchain,Ethereum,Eos,我使用下面的代码生成公钥和私钥,我们在比特币、以太坊等中使用唯一地址进行交易示例地址:mkhc2dpxmAMBqwN36TD2upqZL98v9AgP5r 如何为EOS生成地址? 如何做交易 const hdkey = require('hdkey') const wif = require('wif') const ecc = require('eosjs-ecc') const bip39 = require('bip39') const mnemonic = 'butter decrea

我使用下面的代码生成公钥和私钥,我们在比特币、以太坊等中使用唯一地址进行交易
示例地址: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

为了进行交易,请查看并了解更多与eosio相关的问题,询问如何唯一地识别其他人,如btc、eth在EOS中有地址、用户名等?是的,eosio中有用户名,有12个字符,唯一性如何在nodejs中生成?