Confidential Spot DEX

The DarkVeil Confidential Spot DEX allows for the direct peer-to-peer trading of assets with complete pre-trade privacy. It is designed for traders who need to execute direct swaps (e.g., ETH for USDC) without revealing their intentions to the market and without suffering from price slippage caused by their own trade size.

The Lifecycle of a Spot Trade

Every spot trade on DarkVeil follows a secure, four-step lifecycle that separates private matching from public settlement.

Step 1: Encrypted Order Submission

A user decides to place a trade. Before the order leaves their client, it is encrypted. This encrypted payload contains the trade details (e.g., "Sell 1 ETH for a minimum of 3,500 USDC"). This encrypted order is then sent to the off-chain Secure Enclave network. This is only done after the user's client has successfully performed remote attestation to verify it is communicating with a genuine and untampered DarkVeil enclave.

Step 2: AI-Powered Confidential Matching

The enclave receives the encrypted order and places it into the confidential order book. This order book is held entirely within the enclave's encrypted memory, invisible to the outside world.

Here, the AI Matching Engine takes over. While a match occurs when the limit prices of a buy and sell order overlap, the AI's process is far more sophisticated. It analyzes the entire confidential order book and external oracle prices to find the optimal settlement path. Its objectives are:

  • Minimize Market Impact: For large orders, the AI may break them into smaller fragments or match them against multiple smaller orders to avoid price disruption.

  • Maximize Fairness: Trades are executed at a fair price derived from a high-quality, tamper-resistant price oracle, ensuring both parties get a fair market rate. The AI guarantees this price regardless of order size, eliminating slippage.

  • Intelligent Routing: The AI can identify complex, multi-party trades (e.g., A -> B, B -> C, C -> A) that can be settled together for maximum capital efficiency.

Step 3: Generating the Settlement Proof

Once a trade is matched inside the enclave, the engine generates a settlement proof. This is a small piece of data that contains the results of the trade (which accounts were involved and how their balances should change). This proof is then cryptographically signed by the enclave using a key that is only known to the trusted network. This signature acts as an unforgeable authorization for the on-chain settlement.

Step 4: On-Chain Settlement

The signed settlement proof is broadcast to the DarkVeil Settlement Contract on the Ethereum blockchain. The smart contract performs two actions:

  1. It verifies the cryptographic signature to confirm the proof is authentic and came from the trusted enclave network.

  2. If valid, it instructs the Vault Contract to update the internal balances of the two traders, finalizing the asset swap.

The result: The trade is settled with the full security of Ethereum, but the sensitive details—who placed the order, when it was placed, and at what limit price—were never exposed on a public ledger.

Last updated