Skip to content

zachyo/Privaswap

Repository files navigation

PrivaSwap

Privacy-First Decentralized Exchange on Avalanche C-Chain

Hack2Build: Privacy Edition Submission

Project Overview

A privacy-focused decentralized exchange using eERC20 encrypted tokens on Avalanche C-Chain. The DEX will enables private trading where balances, trade amounts, and user positions remain confidential while maintaining full decentralization.

Problem Statement Current DEXs expose all trading data publicly, enabling:

  • MEV attacks (front-running, sandwich attacks)
  • Trading strategy exploitation
  • Portfolio privacy violations
  • Competitive disadvantage for large traders

Solution Private DEX using eERC20 encrypted tokens that:

  • Hides user balances and trade amounts
  • Prevents MEV exploitation
  • Maintains trading privacy
  • Leverages Avalanche's speed and low fees

Technology Stack Blockchain:

  • Network: Avalanche C-Chain Testnet
  • Token Standard: eERC20 (Encrypted ERC20)
  • Development Framework: Hardhat

Smart Contracts:

  • Language: Solidity
  • Libraries: OpenZeppelin, eERC20 standard library
  • Testing: Hardhat test suite

Frontend:

  • Framework: React 18 + Next.js 14
  • Web3 Library: ethers.js v6
  • UI Framework: Tailwind CSS
  • State Management: React Context

Core Architecture eERC20 Integration Points:

  1. Encrypted Balances: User balances stored encrypted on-chain
  2. Private Transfers: Swap amounts hidden from public view
  3. Confidential Liquidity: LP positions remain private
  4. Encrypted Events: Transaction logs maintain privacy

AMM Logic:

  • Constant Product Formula: x * y = k
  • Encrypted reserve updates
  • Private slippage calculations
  • Hidden trading fees

Security Considerations:

  • Reentrancy protection
  • Integer overflow protection
  • Access control for admin functions
  • Input validation for all user interactions

Competitive Advantages

  1. First-mover: Early privacy DEX on Avalanche
  2. Technical depth: eERC20 integration complexity
  3. Real problem: Solves actual MEV/privacy issues
  4. Avalanche-native: Built specifically for the ecosystem
  5. Scalable roadmap: Clear path to full product

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors