Coder Social home page Coder Social logo

ompals / mixup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darlington02/mixup

0.0 0.0 0.0 3.58 MB

Mixup is a zk-Snarks powered, decentralized, non-custodial privacy solution built on Harmony. It improves transaction privacy by breaking the on-chain link between recipient and destination addresses. This project was inspired by tornado cash.

Home Page: https://zk-mixup.vercel.app

Shell 1.92% JavaScript 55.79% CSS 8.09% Solidity 34.20%

mixup's Introduction

Mixup - ZK PRIVATE MIXER

zkMixupImage

Mixup is a non-custodial privacy solution based on zkSNARKs. It improves transaction privacy by breaking the on-chain link between the recipient and destination addresses. It uses a smart contract that accepts ONE deposits that can be withdrawn by a different address. Whenever ONE is withdrawn by the new address, there is no way to link the withdrawal to the deposit, ensuring complete privacy.

To make a deposit user generates a secret and sends its hash (called a commitment) along with the deposit amount to the Mixup smart contract. The contract accepts the deposit and adds the commitment to its list of deposits.

Later, the user decides to make a withdrawal. To do that, the user should provide a proof that he or she possesses a secret to an unspent commitment from the smart contract’s list of deposits. zkSnark technology allows that to happen without revealing which exact deposit corresponds to this secret. The smart contract will check the proof and transfer deposited funds to the address specified for withdrawal. An external observer will be unable to determine which deposit this withdrawal came from.

This project takes alot of inspiration from the popular Tornado Cash Mixer

You can read more about it in this Medium article

Getting Started

Run npm i to install. Check out package.json for other commands to compile circuits and contracts.

To deploy on Harmony testnet, run the above command first, create a .secret file with your own private key (Please be careful not to include your private key in any commit!).

Requirements

  1. node v11.15.0
  2. npm install -g npx

Commands

Prepare test environment:

   npm run compile:circuits
   npm run compile:contracts
   npm run deploy:localhost
   npm run test
   npm run test:full

The project has three main folders:

  • hardhat - [circuits, contracts]
  • ui

circuits

The circuit folder contains all the circuits used in Mixup.

contracts

The contracts folder contains all the smart contracts used in Mixup.

ui

The ui folder contains the Mixup frontend.

Zero Knowledge Structure

The following graphic shows the structure of the most important zero knowledge elements of the Mixup project.

├── circuits
│   ├── Merkletree.circom
│   │  
│   ├── Withdraw.circom
├── contracts
│   ├── contracts
│   │   ├── Mixup(deposit and withdrawals)
│   │   │   ├── ERC20Mixup.sol
│   │   │   ├── ETHMixup.sol
|   |   |   ├── ETHMixup.sol
│   │   ├── MerkleTree (Merkle tree with history)
│   │   │   ├── MerkleTreeHistory.sol
│   │   ├── Verifier (verifies proof)
│   │   │   ├── verifier.sol
├── ui
│   ├── public
│   │   ├── zkproof
│   │   │   ├── Withdraw.wasm
│   │   │   │── circuit_final.zkey
│   │   │
│   ├── zkproof
│   │   ├── snarkjsZkproof.js
│   │   ├

Run Locally

Clone the Repository

git clone https://github.com/Darlington02/Mixup.git

Run circuits

To run cicuits, go inside the circuits folder:

cd circuits
npm run compile:circuits

Run contracts

To run contracts, go inside the contracts folder:

cd contracts
npm run compile:contracts

Run ui

To run the frontend, go inside the ui folder:

cd ui

mixup's People

Contributors

darlington02 avatar socathie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.