1

I know that it is not possible to create multiple addresses that are bound to one ethereum wallet unlike in bitcoin.

However, I am trying to create an ico page where each user should get unique ether address into which he can do payment.

an example is this page: https://tokensale.amon.tech

enter image description here

I want to do the exact same thing. How is it possible programmatically to achieve this?

4
  • I don't understand why you would want to do this. Why can you not let everyone use their "own" ethereum accounts?
    – JBrouwer
    Mar 30, 2018 at 18:49
  • @MathematicalRain sorry for being unclear in this point. (I edited the question now) What I meant was that each user gets unique ether address into which he transfers some ethers.
    – doniyor
    Mar 30, 2018 at 19:00
  • 2
    See this answer: ethereum.stackexchange.com/a/44252/33191 It is better (for transaction costs especially) to create a contract which handles this for you. Creating multiple addresses which allow you to take money out is going to cost you a significant amount of transaction costs.
    – JBrouwer
    Mar 30, 2018 at 19:12
  • @MathematicalRain great, thanks for the hint!! I will go for contracts then.
    – doniyor
    Mar 30, 2018 at 19:20

1 Answer 1

1

You can create a contract unique to each user, which in turn deploys wallet accounts. But the cool thing with this is that you don't actually have to deploy those wallet accounts until you want to or need to which can help you save significant gas costs. Why? Well that's because we can easily calculate the addresses of new contracts that will be generated by a contract.

Contract accounts start off with a nonce of 1, which is only increased during transactions from the contracts invoking the create opcode, so we can easily calculate addresses off-chain or on-chain. I wrote a contract that demonstrates this:

https://github.com/postables/Solidity-Modules/blob/master/Contracts/AddressGenerationCalculator.sol

Or if you don't want to go the whole contract route and don't care about centralization or security risks, you could generate the public-private key-pairs on your server, and create a web app to let people use their pre-generated wallets.

Your Answer

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

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