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?

  • 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, 2017 at 3:49
  • @Ismael are there any examples of how to implement zk-snarks?
    – RagHaven
    Jan 22, 2018 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, 2018 at 13:07

3 Answers 3


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.


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.) Dec 3, 2017 at 10:34

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 and acknowledge you have read our privacy policy.

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