Search code examples
ethereum

Generate new ethereum address


I'm currently working on a ethereum dapp where users can login and perform transactions. I'm a newbie in dapp development. The problem is I've been trying to make something happen which is when a user registers the dapp, a wallet address will automatically be generated for that user. Any help will be appreciated


Solution

  • An account on Ethereum is nothing but holding a private key.

    There are many software packages like web3j (for java), web3js (for javascript) which help in creating private keys and accounts.

    To create a private key, you need to input a string. This string will be sent to a one-way hash function. Since private keys have to be unique for every account, the input string has to be random. Few standard practices would be using the (current time stamp + user mail id + password + random phrases) as the input string.

    Once you create a private key for a user, you can generate an account for him.

    Hope this helps.