How to generate Ethereum wallet with ethers.js

--

With the ethers.js library, you can generate Ethereum wallet by writing the code below:

Code (Node.js)

const ethers = require('ethers')
const wallet = ethers.Wallet.createRandom()
console.log('address:', wallet.address)
console.log('mnemonic:', wallet.mnemonic.phrase)
console.log('privateKey:', wallet.privateKey)

Result

address: 0xb985d345c4bb8121cE2d18583b2a28e98D56d04b
mnemonic: produce alley citizen bone enact settle hedgehog common plate dwarf lady someone
privateKey: 0x49723865a8ab41e5e8081839e33dff15ab6b0125ba3acc82c25df64e8a8668f5

Support

If you find this article is helpful, it would be greatly appreciated if you could tip Ether to the address below. Thank you!

0x0089d53F703f7E0843953D48133f74cE247184c2

--

--