I am in the process of creating an app that will use Ethereum. I would like to create wallets for each of the users in my backend without them having to do anything except writing a passphrase.

What code should I use for that? can I use the Ethereum C++ client to do that? do I have to download all the blockchain to create wallets only?


You can realise this by using hd wallets technology. You can use just one passphrase and create a lot of addresses by using bip44 standard. So each your user will have public and private extended key, with public key they will able to create new addresses and with private key they will get all their resources.

You can find more info here

|improve this answer|||||

You could have an endpoint on your application which takes in a passphrase from a user and generates a wallet with that passphrase using an RPC call to Ethereum's web3.personal.newAccount function. You can create wallets without downloading the blockchain.

|improve this answer|||||

The most well supported library for Ethereum currently is probably web3.js. Note: version 1 is still in beta so make sure you use v0.20.1, which is still the most well documented.

Then you'll need to run a server-side node which will support IPC connections (you could use HTTP RPC, but IPC is a little more secure). Geth and Parity will both do the job, but you only need one. Another note: you'll need to ensure you enable the personal IPC API if it's not on by default.

After that, you can generate accounts using web3:

const Web3 = require('web3')
const web3 = new Web3(new Web3.providers.IpcProvider('/PATH/TO/IPC', require('net')

// make a new account, you can do this in a loop for all your users
let newAccount = web3.personal.newAccount("SOME_PASSWORD")


This is pretty dangerous. Networks like Ethereum are fun because when you hold the private key to an easily-generatable account, you own all the assets in that account. When you put a bunch of private keys in one place, you create an attractive target for a hack. Be careful when handling lots of private keys, and ensure only the necessary people have access to them. Practise good opsec.

|improve this answer|||||

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.