Compression Ratios

Compression Ratios

State Storage vs Event Logs vs ZK-only Footprint


SnarkSide is engineered to minimize its on-chain footprint while maintaining cryptographic verifiability, replay resistance, and auditable settlement. Traditional DEXs typically emit large volumes of event logs and write extensive state to storage—both of which incur significant gas costs and reveal trade-level metadata exploitable by MEV bots.

In contrast, SnarkSide compresses the footprint of each trade into a few field elements using zero-knowledge proofs, Merkle roots, and nullifier-based identifiers, ensuring that nothing leaks except what the circuit is explicitly designed to reveal. This section breaks down the comparative data compression efficiency between:

  • Full state writes (legacy account model)

  • Event-based disclosures

  • Pure ZK-verified commitments


On-Chain Footprint Modalities

Modality
Contents Stored
Gas Cost
Privacy Level

State Write

All trade parameters in storage

High (SSTORE-heavy)

❌ None

Event Log

Trade params + emitted events

Medium (LOG + calldata)

⚠️ Partial obfuscation

ZK-only Commitments

Nullifier, Merkle root, proof hash

Low (verify + store root only)

✅ Full privacy

SnarkSide uses a ZK-only state model, storing only:

  • Updated Merkle root of the CipherVault

  • Nullifiers of consumed intents

  • Compressed ZK proof (190–230 bytes)

  • Minimal calldata (4–6 public inputs)


Quantitative Compression Comparison

Below is a comparison of equivalent data volumes across the three storage models for one matched trade:

Data Layer

State Model

Event Logs

ZK Model (SnarkSide)

Position Params

120 bytes

100 bytes

0 (private in circuit)

Leverage / Direction

8 bytes

8 bytes

0

Entry / Exit Price

32 bytes

32 bytes

0

Timestamp / Expiry

16 bytes

12 bytes

0

Vault ID / Index

16 bytes

16 bytes

0

Witness Hash / Nullifier

32 bytes

Merkle Root Commit

32 bytes

ZK Proof (Groth16)

192–230 bytes

Total

~192 bytes

~168 bytes

~256–290 bytes (all obfuscated)

Though ZK proofs are slightly larger than raw event logs, they leak zero information, making them exponentially more secure and resistant to economic attacks.


Calldata Footprint (EVM)

Field Element
Size (bytes)
Role

nullifier_hash

32

Prevent replay

vault_root_before

32

ZK circuit input

vault_root_after

32

Proof binding

oracle_commitment

32

Ensures consistency with feed

ZK proof

192–230

Groth16 SNARK

Total Calldata

~350–390

per trade match

All other values—leverage, trade size, price, trader identity—are committed inside the proof and never submitted in plaintext.


Compression Ratio Summary

Comparison
Compression Ratio
Info Leakage

State Write → ZK-Only

4.2x

0%

Event Log → ZK-Only

2.3x

0%

Event Log → State Write

0.55x

Medium

ZK → On-Chain Match Transcript

N/A

None

This makes SnarkSide 2–4x more efficient than traditional state/event-based models while eliminating the surface area for MEV, front-running, and liquidation targeting.


Conclusion

SnarkSide achieves a high-compression private settlement pipeline by committing only:

  • Minimal calldata (~350 bytes)

  • Single ZK proof per match

  • Merkle root state progression

  • Nullifier hash to prevent replay

There are no leaked prices, no trader tags, no token sizes, and no vault metadata exposed.

This design enables long-term scalability and sovereign privacy, turning the chain into a ZK-verified ledger of state transitions, not a transcript of market behavior.

Last updated