Appearance
Concepts
Core technical concepts behind Zylith.
Concentrated Liquidity (CLMM)
Liquidity providers allocate capital within specific price ranges instead of 0 to infinity.
Constant Product AMM Concentrated Liquidity
━━━━━━━━━━━━━━━━━━━━━━━ ┌──────────┐
Liquidity: 0 → ∞ ━━━━│██████████│━━━━
└──────────┘
Focused in active rangeTick System
Prices are discretized:
tick = log₁.₀₀₀₁(price)
price = 1.0001^tickEach tick is ~0.01% price change. LP positions specify tick_lower and tick_upper.
Q128.128 Math
Fixed-point arithmetic for precision:
sqrt_price = sqrt(price) * 2^128Privacy Model
Commitment Scheme
Two-layer Poseidon hash binding ownership to amount:
inner_hash = Poseidon(secret, nullifier)
commitment = Poseidon(inner_hash, amount)| Component | Purpose | Visibility |
|---|---|---|
| secret | Proves ownership | Never revealed |
| nullifier | Prevents double-spend | Hash revealed on spend |
| amount | Binds balance | Public input in ZK proof |
| commitment | On-chain identifier | Public, unlinkable |
Verified solvency: Users cannot claim more than deposited because a different amount produces a different commitment that won't exist in the Merkle tree.
Nullifiers
Prevents double-spending:
- Generate random
nullifierat deposit time - Store
nullifier_hash = Poseidon(nullifier)when spending - Contract rejects if nullifier already used
Merkle Trees
BN254 Poseidon Merkle tree (depth 20, ~1M leaves):
Root
/ \
H H
/ \ / \
C1 C2 C3 C4 ← CommitmentsThe ZK proof shows commitment membership without revealing which leaf.
Privacy Pools
Dual Merkle tree architecture for optional compliance:
Deposit Tree Association Tree
┌─────────────┐ ┌─────────────┐
│ All deposits│ │ "Clean" only│
└─────────────┘ └─────────────┘- Deposit Tree: Contains all commitments
- Association Tree: Curated by ASP (relay server), excludes suspicious deposits
Users can prove against either tree—full privacy or compliance proof.
ZK Proofs
Groth16
- Constant-size proofs (~200 bytes)
- Fast verification (~3ms on-chain)
- Requires trusted setup (powers of tau ceremony)
- BN254 curve for Garaga compatibility
Public Inputs
Seven values visible to verifier:
| Input | Purpose |
|---|---|
| root | Merkle tree root |
| nullifier_hash | Double-spend prevention |
| recipient | Output commitment |
| relayer | Fee recipient |
| fee | Relay fee amount |
| amount_in | Input amount |
| min_amount_out | Slippage protection |
What the Proof Proves
- Prover knows
secretandnullifierfor a commitment - That commitment exists in the Merkle tree with given root
- The
amountmatches what's encoded in the commitment nullifier_hash = Poseidon(nullifier)
Trust Model
| Component | Trust Level | Can | Cannot |
|---|---|---|---|
| Smart Contract | Trustless | - | - |
| ZK Circuit | Trustless | - | - |
| Relay Server | Semi-trusted | Censor txs | Steal funds, forge proofs |
| Browser | User-trusted | Store secrets | Spend without user action |