1

Anybody knows, how can ether wallets be generated on serverside (node.js). It's needed for service, to create a new wallets for new customers. Maybe something like bitcoinJS-lib but for ethereum? But can't find with my own, please help :)

2

Using web3js library, here is how you do it on nodejs serverside

//generate private key    
privateKey = web3.eth.accounts.create().privateKey.substr(2)

//generates pubKey from privateKey, encrypts it and store in keystore folder.
web3.eth.personal.importRawKey(privateKey, pin)
    .then((result) => {

    //store pub address.
    publicAddr = web3.utils.toChecksumAddress(result)
})

...

There you go.

2
  • What's "pin" here? – Ruham Apr 15 '20 at 10:38
  • @Ruham it's a string you wish to encrypt with the privateKey that was generated and store in keystore directory. – Zinxer May 16 '20 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.