-
Notifications
You must be signed in to change notification settings - Fork 1
Systems Architecture
This document describes the system design for implementing anonymous interactions with Uniswap using zk-SNARK proofs and commitments. It aims to provide a clear overview of the components, architecture, and interactions for the system.
The system facilitates anonymous deposits, liquidity adjustments, and withdrawals on Uniswap, hiding the identity of liquidity providers and users.
The system comprises three primary layers:
- User Client (Frontend)
- Backend Intermediary
- Ethereum Network (including Uniswap and the Proxy Contract)
-
User Client (Local Frontend App):
- Interface for user interactions.
- zk-SNARK proofs and commitments generator.
-
Backend Intermediary:
- zk-SNARK Manager
- Communication interface with Proxy Contract
- Commitment Storage
-
Ethereum Network:
- Proxy Contract for interacting with Uniswap.
- Modified Uniswap with zk-SNARK Hook.
- Built with modern frontend frameworks (e.g., React, Vue).
- Secure connection to Backend Intermediary.
- Local generation of zk-SNARK proofs and commitments to ensure user privacy.
- Utilizes existing zk-SNARK libraries.
- Generates and verifies zk-SNARK proofs as required.
- Acts as a bridge between the frontend and the proxy contract.
- Deployed on the Ethereum mainnet.
- Accepts zk-SNARK proofs and commitments from users.
- Interfaces with Uniswap on behalf of users.
- Database (e.g., PostgreSQL, MongoDB) for storing commitments.
- Quick retrieval methods to fetch commitments during verification.
- Regular backups and security checks.
- Extends or modifies Uniswap's existing codebase.
- Verifies zk-SNARK proofs using the
beforeModifyPosition
hook. - Ensures liquidity operations are authentic and anonymous.
- User decides to interact (e.g., deposit) on the frontend app.
- User Client generates the zk-SNARK proof and commitment.
- Backend Intermediary receives and validates the proof and commitment.
- Proxy Contract is instructed to interact with Uniswap.
- Uniswap, through the zk-SNARK Hook, verifies the operation.
- Operation is executed (e.g., liquidity added), and feedback is relayed back to the user.
- Secure HTTPS connections for all server-client interactions.
- Secure Ethereum transaction methods for proxy contract interactions.
- Database encryption and regular backups.
- Periodic security audits.
- Integration with other DeFi platforms beyond Uniswap.
- Improved zk-SNARK generation speed.
- Enhanced database scaling solutions for commitment storage.
my-anonymous-uniswap-project/ │ ├── frontend/ │ ├── src/ │ ├── public/ │ ├── package.json │ └── ... │ ├── backend-intermediary/ │ ├── zk-snark-manager/ │ │ ├── lib/ │ │ └── ... │ │ │ ├── commitment-storage/ │ │ ├── models/ │ │ └── ... │ │ │ ├── package.json │ └── ... │ ├── smart-contracts/ │ ├── proxy-contract/ │ │ ├── contracts/ │ │ ├── migrations/ │ │ ├── test/ │ │ └── ... │ │ │ ├── uniswap-zk-snark-hook/ │ │ ├── contracts/ │ │ ├── migrations/ │ │ ├── test/ │ │ └── ... │ │ │ └── truffle-config.js │ ├── docs/ │ └── ... │ ├── README.md └── .gitignore