Live on Ethereum Sepolia · Powered by fhEVM

Your limit orders areinvisible to everyone.

CipherBook uses Fully Homomorphic Encryption to keep your prices encrypted on-chain. MEV bots see nothing. Validators see nothing. Nobody sees anything.

8FHE operations per match
27tests passing
0plaintext price leaks
Scroll

The difference

Standard DEX

Your orders are exposed

Vulnerable
// Transaction mempool — publicly visible
emitOrderPlaced(
price: 99,
amount: 50,
side: BUY
)

MEV bot intercepted

Sandwich attack executing at price: 98 → 100

CipherBook

Your orders are invisible

Protected
// On-chain — ciphertext, unreadable
euint64 price = 0x8f2a…e1
// FHE comparison — never decrypts
FHE.ge(buyPrice, sellPrice)
ebool // stays encrypted

MEV bot: nothing to see

Price encrypted until settlement. Mathematically unreadable.

Why CipherBook

Built to be cryptographically unfair
to MEV bots.

Every design decision optimizes for one outcome: your orders stay invisible until they need to settle.

Core feature

Fully Encrypted Orders

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.

Powered by Zama fhEVM

Zero MEV

No plaintext price means sandwich attacks are cryptographically impossible. What bots can't see, they can't exploit.

On-Chain FHE Matching

FHE.ge and FHE.select compare encrypted prices entirely on-chain. The match result is an encrypted boolean — never revealed.

Only You Can Decrypt

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

Four steps. Total privacy.

No plaintext ever touches the chain. From placement to settlement, your price stays yours.

01

Place a limit order

Enter your price and amount. FHE encryption runs locally in your browser — the price never leaves as plaintext.

02

Order lives on-chain encrypted

Your order is stored as a euint64 ciphertext on Sepolia. No one can read it — not even with full validator access.

03

FHE batch matching

Anyone calls runBatchMatch(). The contract uses FHE.ge to compare prices — a match produces an encrypted boolean result.

04

Private settlement

Sign a free off-chain message to decrypt your own price. If remaining = 0, your order filled. Withdraw unused escrow anytime.

The math

Not privacy by policy.
Privacy by mathematics.

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.

CipherBook.sol — runBatchMatch()
// Compare encrypted prices — no decryption needed
ebool canFill = FHE.ge(buy.encPrice, sell.encPrice);
// Select trade quantity — result stays encrypted
euint64 tradeQty = FHE.select(canFill, qty, zero);
// Make trade qty publicly decryptable by KMS
FHE.makePubliclyDecryptable(tradeQty);
Prices never leave encrypted form until the KMS settles post-match
8
FHE operations
27
tests passing
0
plaintext leaks
Sepolia testnet · No real funds required

Trade in the dark.Win in the clear.

Connect MetaMask on Sepolia and place your first FHE-encrypted limit order. The entire experience takes under 60 seconds.