Skip to content
CircuitX

CircuitX

A privacy-native perpetual DEX built on Ztarknet

Created on 4th December 2025

CircuitX

CircuitX

A privacy-native perpetual DEX built on Ztarknet

The problem CircuitX solves

Core Problems

  1. Strategy Exposure & Front-Running
  2. Lack of Privacy in DeFi Trading
  3. Vulnerability to Market Manipulation

Our solution

  • Complete privacy through ZK proofs. Traders prove position validity without revealing any details. Trade with confidence knowing strategies stay private.
  • Position details are cryptographically hidden. Only commitment hashes are on-chain—impossible to reverse-engineer. Traders can execute large positions without revealing strategy or becoming targets.
  • Private positions cannot be front-run or targeted. MEV bots cannot see trades, eliminating sandwich attacks and front-running

What People Can Use CircuitX For

Retail Traders

  • Strategy Protection: Develop and execute trading strategies without exposure
  • Privacy-Conscious Trading: Trade without revealing financial position
  • MEV Protection: Avoid front-running and sandwich attacks
  • Competitive Advantage: Keep successful strategies private
  • Example: A retail trader discovers a profitable arbitrage opportunity. On CircuitX, they can execute it repeatedly without competitors seeing the pattern and copying it.

How CircuitX Makes Existing Tasks Easier/Safer

  • No Strategy Management Overhead
  • Simplified Risk Management
  • Reduced Monitoring
  • Strategy Security

Challenges I ran into

Challenges I Ran Into

  1. Transaction Nonce Mismatch Errors
  • Problem: When calling lock_collateral followed immediately by open_position, the second transaction failed with "Invalid transaction nonce" because the account nonce hadn't updated on-chain yet

  • Solution: Implemented nonce polling—after lock_collateral confirms, poll the account's nonce every 500ms until it increments before sending the second transaction. Added a 2-second fallback delay as a safety measure.

  1. Commitment Format Mismatch (COMMITMENT_MISMATCH Error)
  • Problem: When closing positions, the commitment in the proof's public inputs didn't match the commitment parameter passed separately, causing COMMITMENT_MISMATCH errors.

  • Solution: Changed the flow to generate the proof first, then extract the commitment directly from proofResult.publicInputs[1] instead of normalizing the stored position commitment separately. This ensures both commitments match exactly.

  1. Market ID Format Inconsistencies
  • Problem: Different parts of the system used different formats for market IDs (string vs felt252), causing validation failures.

  • Solution: Created a shared getMarketIdFelt() function to ensure consistent format across the codebase, and removed strict market ID validation since the contract handles format variations internally.

Tracks Applied (4)

Cross-Chain Privacy Solutions

CircuitX delivers true privacy in perpetual futures trading through Zero-Knowledge proofs. Unlike traditional privacy so...Read More
Starknet

Starknet

Private DeFi & Trading

CircuitX is a privacy-native perpetual futures DEX that embodies Zcash's core privacy principles, delivering unstoppable...Read More

Zcash Community Grants

Private DeFi & Trading

CircuitX builds native privacy infrastructure using ZK proofs and commitment schemes that extend beyond perpetuals to sw...Read More

Unstoppable Wallet

Generic Bounty

A privacy perp dex on ztarknet

Mintlify

Technologies used

Cheer Project

Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

Discussion

Builders also viewed

See more projects on Devfolio