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: 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.
The matching engine continuously works to match buy and sell orders. A match occurs when the limit prices of a buy and sell order overlap. The trade is then executed at a fair price derived from a high-quality, tamper-resistant price oracle, ensuring both parties get a fair market rate.
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:
It verifies the cryptographic signature to confirm the proof is authentic and came from the trusted enclave network.
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.
This architecture provides the core benefits of DarkVeil for spot trading: zero front-running and no price slippage.
Next, learn how we apply these principles to leveraged trading in the Confidential Futures DEX.
Last updated