ethsnarks-miximus icon indicating copy to clipboard operation
ethsnarks-miximus copied to clipboard

Make interface for mixer compatible with Vitalik's spec

Open HarryR opened this issue 5 years ago • 0 comments

As per: https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/rJj9hEJTN?type=view

The interface proposed is more agnostic to the underlying crypto being used:

The mixer has two functions:

  • deposit(bytes32 commitment) payable verifies that DENOMINATION ETH (eg. 1 ETH) was sent along with the call, and if so it adds the commitment to a list of commitments. It also maintains a Merkle tree of all commitments to far that uses some SNARK-friendly hash function (even Pedersen to start off would be ok).
  • withdraw(address destination, bytes proof) verifies that (i) proof is a valid ZK-SNARK that proves that destination and some commitment in the tree are related to each other (eg. destination = H(commitment + salt)) but does not reveal which commitment the witness corresponds to, and (ii) destination has not yet been used. Upon success, it pays out DENOMINATION - FEE to the destination and FEE to msg.sender

We should adjust the interface used by Miximus to adhere to this specification.

HarryR avatar Jun 18 '19 20:06 HarryR