All projects

Private Token Swap

Privacy-preserving swap of gold/silver tokens via Chainlink ACE on Sepolia

Privacy

What it is

The Problem
Traditional decentralized exchanges (DEXs) are completely transparent - every trade, balance, and wallet activity is publicly visible on the blockchain. This creates several issues:

  1. Front-running: Bots can see pending transactions and exploit them
  2. Privacy concerns: All trading activity is public (amounts, prices, positions)
  3. Competitive disadvantage: Large traders reveal their strategies
  4. Regulatory challenges: No compliance layer for regulated assets

The Solution

This project demonstrates a privacy-preserving token swap system using Chainlink ACE (Automated Compliance Engine) that enables:

  1. Private Trading
    • Shielded balances hide token amounts from public view
  • Orders and swaps execute without revealing sensitive data
    • Only participants know trade details
  1. Collateralized Real-World Assets
    • Tokens backed by precious metals (Gold/Silver)
    • 150% over-collateralization with USDT ensures stability
    • Prices reflect real market rates from metalpriceapi.com
  2. Compliance-Ready Architecture
    • Policy Engine enforces rules (KYC, transfer limits, blacklists)
    • Regulatory compliance without sacrificing privacy
    • Auditable by authorized parties only
  3. Automated Matching & Execution
    • Off-chain orderbook for efficient matching
    • Atomic on-chain settlement via Chainlink ACE Vault
    • No counterparty risk

Key Features

Privacy Layer

  • Shielded addresses derived from secrets using Poseidon hash
  • Private balances stored within ACE Vault (not visible on blockchain)
  • Confidential swaps - amounts and participants hidden from public

How it Works

Tech Stack

Smart Contracts:

  • Solidity + Foundry
  • OpenZeppelin libraries
  • Chainlink ACE integration

Backend:

  • Node.js + TypeScript
  • Express.js (REST API)
  • WebSocket (real-time updates)
  • ethers.js (blockchain interaction)

Frontend:

  • React 18 + TypeScript
  • Vite (build tool)
  • ethers.js (Web3 provider)

Blockchain:

  • Ethereum Sepolia testnet
  • Alchemy RPC provider

Links

Created by

  • Elzbieta Faifer