I want to sell my token to users paying by Ether.

  • Is it a good idea to require the user to pass his wallet (to receive) Ether as the EVM payload?

  • Or is it needed to have my private key uploaded to the server which does the sales (with the receiving Wallet passed through HTTP(S)) and do the logic in server code?

  • Or maybe I should send tokens to the same address as the address from which I receive Ether?

Please enumerable all viable possible variants (among enumerated above or other) with their advantages and disadvantages to do it (implementing automatic selling the token with Ether).

A complete or incomplete Solidity code to do the task would be nice.


The usual approach is to put the tokens into the custody of a smart contract with a function that exchanges the tokens for ether. There is no need to ask the user for their address because the contract will know who signed the transaction, meaning, who sent the ether.

Admittedly, this answer is only useful for Solidity developers. If you aren't familiar with Smart Contracts then it isn't especially easy.

Q1: Not needed. Either your contract or wallet (manual process) receiving either will always "see" who sent it.

Q2: Never upload your private key. That way leads to the dark side.

Q3: Yes. In either case, manual or automated, the simplest logic is to send ether to the source of the funds in a simple trade.

Hope it helps.

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.