1

I need to create an Ethereum wallet for each user registering in my app (I am using Node.JS as backend). The idea is that each user can deposit and withdraw an amount from his wallet.

So what's the best way to accomplish this? And the best way to secure the private keys? Because users won't have access to this. Is very similar to the wallet on Binance exchange works.

Thanks

2 Answers 2

1

What you are asking is how to create a hot wallet.

Unless you are an expert in blockchains, I would strongly advise not to build this kind of feature yourself. It is just too dangerous, you are likely get it wrong and your users are likely to lose money due to hacks and similar incidents.

Instead, use something like WalletConnect protocol to let users use any wallet with your app.

2
  • Thanks, man. I know is dangerous. But anyway I want to learn and experiment with it. I don't want a solution, just a tip on where to begin.
    – 0xmysEE
    Oct 25, 2022 at 20:45
  • Check the link on how to create a how wallet in my answer. Oct 26, 2022 at 7:23
0

You could generate a new random wallets with their private keys using Ethers

https://docs.ethers.io/v5/api/signer/#Wallet

I use this script to make test wallets and store them in a json

const ethers = require('ethers');
var fs = require('fs');
var walletsArray = []

for (let i = 0; i < 10; i++) {
    let wallet = new ethers.Wallet.createRandom()
    walletsArray.push(wallet.address)
    console.log(wallet.privateKey)
}
fs.writeFile('tenAddresses.json', JSON.stringify(walletsArray), 'utf8', callback);


console.log(walletsArray)
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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