Core Concepts
DarkVeil's ability to offer a private, secure, and high-performance trading experience stems from the unique way it combines several key technologies. This page breaks down the foundational concepts that power our protocol.
1. The Hybrid Model: On-Chain Security, Off-Chain Privacy
DarkVeil operates on a hybrid model that leverages the best of both on-chain and off-chain systems.
On-Chain (Ethereum Layer 1): The Trust Layer Our smart contracts are deployed on the Ethereum mainnet, the most secure and decentralized smart contract platform. This layer acts as the ultimate judge and vault for user funds. Its only jobs are to hold user collateral securely and to execute the final settlement of trades based on valid instructions from the off-chain layer.
Off-Chain (Secure Enclave Network): The Privacy & Performance Layer The complex and computationally intensive tasks—like order matching and margin calculations—happen off-chain. This allows for near-instant execution without incurring high gas fees for every action. This layer is responsible for privacy and speed, but it never takes direct custody of user funds.
2. Confidential Computing & Secure Enclaves (TEEs)
The core challenge of our off-chain layer is trust. How can we process trades privately without forcing users to trust the node operators running the system? The answer is Confidential Computing.
Think of a Secure Enclave (also known as a Trusted Execution Environment or TEE) as a locked, digital black box.
It's a special, isolated part of a server's processor where code and data are automatically encrypted while they are being used. This means that no one—not even the owner of the server or someone with root access—can see the data or interfere with the code running inside the enclave.
DarkVeil uses a network of these enclaves to run its confidential order book and matching engine, ensuring that your trades are completely private from node operators and the outside world.
3. Remote Attestation: How We Trust the "Black Box"
A crucial question remains: How does your wallet know it's communicating with a genuine, untampered enclave running the correct DarkVeil code?
This is solved through a process called Remote Attestation.
Before your client sends any sensitive information, it challenges the enclave to provide a cryptographic proof. This proof, which is signed by the hardware manufacturer itself (e.g., Intel or AMD), confirms two things:
The hardware is a genuine secure enclave.
The code running inside it is exactly the official, publicly verifiable DarkVeil code.
Once this "attestation" is complete, a secure, end-to-end encrypted channel is established between you and the trusted application inside the enclave.
By combining these core concepts, DarkVeil achieves something unique: the ability to process trades with the speed and privacy of a centralized system while retaining the trustless security of a decentralized blockchain for final settlement.
With these fundamentals covered, you can now explore the technical details in the ARCHITECTURE DEEP DIVE.
Last updated