Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•ΆοΈ UniCloak

A Unified, Compliance-Aware Privacy Layer for Blockchain

UniCloak is a zero-knowledge powered privacy protocol that enables users to transact, swap, and move stablecoins privately across chains from a single liquidity pool, while remaining compliance-aware by design.


🚨 Problem

Public blockchains are transparent by default.

  • Every transaction is traceable
  • Wallet histories reveal behavioral patterns
  • Sensitive use cases like:
    • Payroll
    • Donations
    • Treasury management
    • Trading strategies
      become fully exposed

Existing privacy solutions fail because they:

  • Stop at withdrawals
  • Break composability with DeFi
  • Are non-compliant and legally fragile
  • Fragment liquidity across chains

πŸ’‘ Solution

UniCloak decouples fund ownership from fund usage using Zero-Knowledge Proofs, enabling private yet verifiable transactions without fragmenting liquidity.

At its core, UniCloak provides:

  • Private identity verification
  • Private DeFi execution
  • Unified liquidity on a single chain
  • Cross-chain access without breaking privacy

🧠 How UniCloak Works (High Level)

  1. ZK Identity (zk-KYC)
    Users generate a privacy-preserving identity commitment from government-issued documents (e.g. passport), without revealing personal data on-chain.

  2. Private Wallet Commitments
    Wallets are represented as cryptographic commitments (Poseidon hash), not public addresses.

  3. Unified Private Pool
    Stablecoins (e.g. USDC) are deposited into a shared private pool anchored on Mantle.

  4. ZK-Verified Actions via Relayers
    Withdrawals, swaps, bridges, and cross-chain swaps are executed by relayers using ZK proofs β€” the user’s wallet is never revealed.


🧩 Architecture Overview

flowchart LR
    U[User Browser]

    subgraph ZKID["zk-ID Layer"]
        P[Passport Upload]
        MRZ[MRZ Extraction Local]
        IC[Identity Commitment Poseidon Hash]
        IM[Identity Mixer Merkle Tree]

        P --> MRZ
        MRZ --> IC
        IC --> IM
    end

    subgraph WALLET["Private Wallet Layer"]
        ZKIDP[ZK Proof of Identity]
        WC[Wallet Commitment Poseidon Hash]

        ZKIDP --> WC
    end

    subgraph POOL["Unified Private Pool Mantle"]
        MT[Wallet Commitments Merkle Tree]
    end

    subgraph RELAYER["Relayer Layer"]
        R[Relayer]
    end

    subgraph DEFI["In Protocol DeFi Execution"]
        WOOFI[WooFi Swap]
        STG[Stargate Bridge]
        XM[Cross Messenger]
        REC[Recipient]
    end

    IM --> ZKIDP
    WC --> MT

    U -->|Deposit with ZK Proof| MT
    MT -->|ZK Proof| R

    R --> WOOFI
    WOOFI --> REC

    R --> STG
    STG --> REC

    R --> STG
    STG --> XM
    XM --> WOOFI
    WOOFI --> REC
Loading

1️⃣ zk-ID Creation (Identity Layer)

  • User uploads a passport image in the web app.
  • Passport data (MRZ fields) is extracted locally in the browser.
  • Frontend generates a random secret.
  • An identity commitment is created using a cryptographic hash of:
    • passport data
    • secret
  • The identity commitment is submitted to the Identity Mixer contract and stored in a Merkle Tree.

No raw passport data is stored on-chain.


2️⃣ Private Wallet Creation

  • User creates a wallet commitment instead of a public address.
  • Wallet commitment is derived from:
    • random nullifier
    • user secret
    • initial balance = 0
  • User submits a ZK proof of identity ownership.
  • Wallet commitment is stored in the Private Pool contract’s Merkle Tree.

Wallets are anonymous commitments, not EOAs.


3️⃣ Deposit Flow

  • User deposits stablecoins (e.g. USDC) into the private pool.
  • User generates a ZK proof proving:
    • ownership of a valid zk-ID
    • ownership of a valid wallet commitment
  • A new wallet commitment with updated balance is computed.
  • Old commitment is invalidated and the new one is added to the pool Merkle Tree.

Balance updates happen via commitment replacement.


4️⃣ Private Withdrawal

  • User generates a ZK proof proving sufficient balance.
  • Proof is sent to a relayer instead of submitting directly.
  • Relayer submits the transaction on-chain.
  • Funds are transferred to the recipient without revealing:
    • deposit source
    • wallet identity

This breaks the on-chain link between deposit and withdrawal.


5️⃣ Private Swap

  • User requests a swap (e.g. USDC β†’ another asset).
  • ZK proof authorizes the operation.
  • Relayer executes:
    • Private Pool β†’ WooFi β†’ Recipient
  • User identity and wallet remain private.

Privacy extends into DeFi execution.


6️⃣ Private Bridge

  • User requests a bridge to a destination chain.
  • ZK proof authorizes the transfer.
  • Relayer executes:
    • Private Pool β†’ Stargate β†’ Destination Chain Recipient
  • No wallet linkage is revealed on either chain.

7️⃣ Private Cross-Chain Swap

  • User specifies:
    • destination chain
    • target token
    • slippage constraints
  • ZK proof authorizes execution.
  • Flow:
    1. Private Pool β†’ Stargate
    2. Funds bridged to destination chain
    3. Cross Messenger receives funds
    4. WooFi swap on destination chain
    5. Funds delivered to recipient

Single liquidity pool with private multi-chain execution.


πŸ” Core Design Principles

  • Privacy by default
  • Unified liquidity (no fragmentation)
  • In-protocol DeFi composability
  • Compliance-aware identity proofs
  • Relayer-based execution for unlinkability

πŸ” zk-KYC (Current Demo vs Vision)

βœ… Current Demo

  • Passport MRZ scanned locally in the browser
  • Identity commitment generated using passport data + secret
  • Demonstrates end-to-end ZK identity flow

⚠️ Limitation:
This demo does not verify passport authenticity β€” data could be tampered.

πŸš€ Vision

  • Use biometric passports (ePassports) with NFC
  • Verify Document Security Object (SOD) using ICAO PKI
  • Cryptographically prove the passport is genuine
  • Generate ZK proofs entirely on-device
  • No personal data ever leaves the user’s machine

This enables real, cryptographically verifiable zk-KYC without surveillance.


πŸ“ Project Structure

unicloak/
β”œβ”€β”€ contracts/src/
β”‚   β”œβ”€β”€ identityMixer/
β”‚   β”‚   β”œβ”€β”€ Mixer.sol        # zk-ID Merkle tree & identity commitments
β”‚   β”‚
β”‚   β”œβ”€β”€ pool.sol             # Unified private liquidity pool
β”‚   β”‚
β”‚   β”œβ”€β”€ cross-messenger.sol  # Cross messenger contract on destination chain for receiving bridged funds               
β”‚   β”‚
β”‚   └── interfaces/
β”‚       β”œβ”€β”€ IWooFi.sol                # WooFi swap interface
β”‚       β”œβ”€β”€ IStargate.sol             # Stargate bridge interface
β”‚
β”œβ”€β”€ circuits/
β”‚   β”œβ”€β”€ identity/src/
β”‚   β”‚   └── main.nr           # zk-ID circuit (passport β†’ commitment)
β”‚   β”‚
β”‚   β”œβ”€β”€ deposit/src/
β”‚   β”‚   └── main.nr           # Deposit proof circuit
β”‚   β”‚
β”‚   β”œβ”€β”€ withdraw/src/
β”‚   β”‚   └── main.nr           # Withdraw proof circuit
β”‚
β”œβ”€β”€ frontend/                 # ui
β”‚
β”œβ”€β”€ relayer/
β”‚   β”œβ”€β”€ index.ts                      # Relayer entry point, executes tx on behalf of users
β”‚
β”œβ”€β”€ merkleTreeManager/                # off-chain merkle tree manager for providing merkle proofs for commitments

πŸ› οΈ Tech Stack

  • Zero-Knowledge Circuits:
    Noir β€” used for zk-ID, wallet creation, deposits, withdrawals, and cross-chain authorization proofs.

  • Smart Contracts:
    Solidity β€” identity mixer, private pool, Merkle tree management, and verifier contracts.

  • Frontend:
    Next.js β€” user interface for zk-KYC, wallet creation, deposits, and private DeFi actions.

  • Relayer & Merkle Tree Manager:
    Node.js β€” relayer service for submitting ZK proofs, managing off-chain Merkle trees, and coordinating cross-chain execution.


πŸ“ Deployed Addresses

🏦 Core Contracts (Mantle mainnet)

Contract Address
Pool (entrypoint) 0x37741c6A9C54C0f8A8D659AB2386CFB5b3d318e8
Hasher 0x6ddf046B531839DfED9ec3bbEe919fFd9B401e1a
IdentityVerifier 0x203b923859Ed92d917e31D12EF56076CF70838e2
IDMixer 0xA9fE25E95D5F47FC6028d6760b64e4811DB3c4a9
DepositVerifier 0x1103Cf14ac34BD5D38a0D57D03Be2E7b597E0531
WithdrawVerifier 0xb7F3A2124DDE9b7Bc7eFfE7DC48bABC78c131976

πŸŒ‰ Cross-Chain Execution (Base mainnet)

Contract Address
CrossMessenger 0x08f480f8b8075F0775F131006d0E9db92e85F585

Note: Pool is the primary on-ramp into the private liquidity layer and should be referenced as the core entry point.


πŸ“½οΈ Links

πŸ–ΌοΈ Pitch Deck

Click Here

πŸŽ₯ Pitch Video

Click Here

πŸ’» Live Demo

Click Here


βœ… Conclusion

UniCloak introduces a new primitive for privacy-preserving DeFi by combining zk-identity, private wallet commitments, and relayer-based execution over a unified liquidity pool. Unlike traditional mixers that stop at withdrawal and fragment liquidity across chains, UniCloak enables compliant private operations such as swaps, bridging, and cross-chain swaps without exposing user identity or fund origin. By anchoring liquidity on a single chain and accessing external liquidity through integrations, UniCloak delivers privacy, composability, compliance-awareness, and cross-chain reach β€” all without compromising user control or cryptographic integrity.

About

A zero-knowledge powered privacy protocol that enables users to transact, swap and move stablecoins privately across chains from a single liquidity pool.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages