Overview
Certainly. Here's a fully expanded, technical, and professional overview page for the SnarkSide GitBook, based on your prompt and fully contextualized for advanced readers:
SnarkSide is a fully encrypted, intent-based perpetual futures exchange designed to solve the structural vulnerabilities present in conventional decentralized derivatives markets. Built from first principles, SnarkSide integrates zero-knowledge cryptography, stealth UTXO-based margin accounts, and a custom off-chain MPC-based matching engine to enable provably correct execution without leaking user intent, position metadata, or liquidation thresholds.
This documentation serves as the canonical technical resource for understanding the architecture and implementation details of the SnarkSide protocol. It is intended for engineers, researchers, auditors, and infrastructure teams who seek a complete view of the system’s inner workings.
Motivation
Current on-chain perp DEXes operate under an open visibility model, exposing:
User orders in the public mempool
Wallet-linked positions and liquidation prices
Aggregated order flow that can be arbitraged or front-run
This results in a trading environment where MEV extraction, position hunting, and oracle manipulation are not edge cases—they’re default risks.
SnarkSide was built to fundamentally eliminate this class of attack surface.
Core Design Principles
SnarkSide was architected around four foundational assumptions:
Intent leakage is the root of most on-chain exploitation. Mempool visibility, deterministic trade flow, and traceable wallet state make it easy for adversaries to model and predict user behavior. All user interaction in SnarkSide begins with encrypted trade intent commitments, verified off-chain and settled privately.
Transparency and verifiability are distinct concerns. Zero-knowledge proofs allow a protocol to remain cryptographically accountable without exposing execution details. On SnarkSide, every matched trade and vault transition is verified via SNARK constraints, not logs or indexers.
Margin and liquidation systems must be fully shielded. Traditional perp systems disclose liquidation thresholds, attracting liquidation hunters. SnarkSide’s margin vaults are built on UTXO commitments and stealth addresses. Liquidations are performed via non-interactive ZK proofs of margin breach.
Matching does not require revelation. Most DEX matching engines are built around observable books. SnarkSide uses off-chain MPC to match encrypted intents in batches, generating a single verifiable hash commitment that is proven on-chain via a circuit. No orderbook. No front-running. No match exposure.
Protocol Stack Overview
SnarkSide is composed of five tightly integrated layers:
Encrypted Intent Layer
Users submit zero-knowledge commitments representing trade preferences (size, side, slippage, leverage), which are non-linkable and non-revealing
DarkMatch Engine
A distributed relayer network performs encrypted matching using MPC and submits verifiable ZK proof of match correctness
CipherVault
Margin accounts represented as shielded UTXOs with entry price, leverage, and direction hidden via Poseidon commitments
Oblivion Pool
A virtual AMM used for funding rate and net flow management, which processes encrypted liquidity inputs and outputs via ZK
Settlement Layer
Final trade resolution, liquidation, and funding distribution occur via on-chain SNARK verification and state updates
Each layer is modular but bound by cryptographic guarantees and trustless settlement rules.
Topics Covered in This Documentation
This GitBook provides a detailed breakdown of each subsystem. Major sections include:
Encrypted Intent Architecture: Format, circuit constraints, poseidon hash specs, nonce/nullifier protection
Relayer Matching Infrastructure: MPC relayer coordination, witness generation, batch processing and state sync
Vault and Margin System: UTXO model, shielded position mechanics, stealth address management
Liquidation Model: ZK liquidation proofs, funding rate enforcement, privacy-preserving rewards
Oracle Design: Commit-reveal oracle wrappers, bounded price drift validation, SNARK-integrated price finality
Cryptographic Toolkit: Proof system configuration (Circom, Groth16, PLONK), prover optimization, circuit parameterization
Client Integration: zkWallet SDK, stealth trade construction, bundler architecture for gas abstraction
Deployment Configuration: Network assumptions, sequencer setup, staging/testnet deployment walkthrough
Each page is technical, non-trivial, and based on the two-year implementation of SnarkSide’s real-world cryptographic backend.
Intended Audience
This documentation is intended for:
Smart contract engineers working on privacy infrastructure
ZK circuit developers building verifiable constraint systems
MPC researchers modeling off-chain coordination protocols
Auditors and verifiers reviewing vault logic and SNARK constraints
L2 infrastructure builders seeking modular encrypted perp architecture
Institutions and trading desks looking to integrate encrypted perps into internal workflows
SnarkSide represents a fundamentally new model for on-chain financial systems — one that refuses to leak, proves without revealing, and operates without surveillance. This documentation reflects that same philosophy: complete transparency, without compromise to privacy.
Continue to the next section to explore the Encrypted Trade Intent system, the foundation for all user interactions on SnarkSide.
Let me know if you'd like this exported to Markdown, HTML, or added as a .md file in a GitBook repo structure.
Last updated

