How can I create a smart contract that has a function that receives an input ( either eth or another erc20 token ) and sends it to a specified address without revealing who sent it?

Basically making the transaction anonymous?

Is there any implementations of this as a smart contract?

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 1
    Everything in the blockchain is public and can inspected by anyone having a copy of the blockchain. Since byzantinum fork there are available available some primitives to implement zkSnarks, but since ethereum addresses have to be used you do not have fully anonymous transactions. – Ismael Nov 30 '17 at 3:49
  • @Ismael are there any examples of how to implement zk-snarks? – AndroidDev93 Jan 22 '18 at 7:42
  • @AndroidDev93 It is better to ask a new question about that. But you can take a look at github.com/JacobEberhardt/ZoKrates – Ismael Jan 22 '18 at 13:07

This may be useful for you https://www.ethereum.org/token. Thanks

  • Hi there. Can you summarise the important parts from that article, and include them here? I know that's the "official" page, but it's possible it may be taken down or moved in future, meaning your answer won't be useful anymore. (Also, the OP is asking about private tokens, rather than tokens in general.) – Richard Horrocks Dec 3 '17 at 10:34

You can try using zeth which is an implementation of the zerocoin protocol in an ethereum smart contract (https://github.com/zcoinofficial/zeth/blob/master/contracts/Zerocoin.sol) which you could integrate into a token contract. Do be warned though, zkSNARK computations on ethereum are expensive.


As an idea you can implement a contract which receive a coin and "re-transfer" the coin to an address which is needed :-)

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.