CipherBook uses Fully Homomorphic Encryption to keep your prices encrypted on-chain. MEV bots see nothing. Validators see nothing. Nobody sees anything.
The difference
Standard DEX
Your orders are exposed
MEV bot intercepted
Sandwich attack executing at price: 98 → 100
CipherBook
Your orders are invisible
MEV bot: nothing to see
Price encrypted until settlement. Mathematically unreadable.
Why CipherBook
Every design decision optimizes for one outcome: your orders stay invisible until they need to settle.
Core feature
Your price is FHE-encrypted in your browser before the transaction is sent. The ciphertext lives on Sepolia as a euint64 — unreadable to MEV bots, validators, and even the Zama team.
No plaintext price means sandwich attacks are cryptographically impossible. What bots can't see, they can't exploit.
FHE.ge and FHE.select compare encrypted prices entirely on-chain. The match result is an encrypted boolean — never revealed.
Each price is ACL-gated to your wallet. Decrypt your own orders via a free EIP-712 signature — completely off-chain, no gas.
The flow
No plaintext ever touches the chain. From placement to settlement, your price stays yours.
Enter your price and amount. FHE encryption runs locally in your browser — the price never leaves as plaintext.
Your order is stored as a euint64 ciphertext on Sepolia. No one can read it — not even with full validator access.
Anyone calls runBatchMatch(). The contract uses FHE.ge to compare prices — a match produces an encrypted boolean result.
Sign a free off-chain message to decrypt your own price. If remaining = 0, your order filled. Withdraw unused escrow anytime.
The math
FHE lets the contract evaluate conditions on ciphertext without ever decrypting. The matching result is computed over encrypted inputs and remains encrypted until the KMS releases it post-settlement.
Connect MetaMask on Sepolia and place your first FHE-encrypted limit order. The entire experience takes under 60 seconds.