Torus compression is mentioned in Jolt’s profiling benchmarks but may not be fully implemented in the current version. This page describes the theoretical technique and expected performance impact.
Problem: Large Curve Points
Dory commitments use elliptic curve points from BN254:- Polynomial commitments: 50-100 G1 points
- Opening proofs: 20-40 G1 points (Dory tier-1/tier-2)
- BlindFold (ZK mode): 100-200 G1 points (Pedersen commitments, Hyrax row commitments)
Solution: Torus-Based Compression
Torus compression exploits the algebraic structure of elliptic curves to represent points more compactly.Mathematical Background
For an elliptic curve pointP = (x, y) on a curve y² = x³ + ax + b:
Standard compressed format:
- Store
x(32 bytes) + 1 bit forysign - Total: 33 bytes
- Decompression: Solve for
y = ±√(x³ + ax + b)
- Represent point in projective coordinates:
[X : Y : Z] - Exploit torus structure:
T² ≅ E[r] × E[r](for r-torsion points) - Compress to ~21 bytes (estimated)
- Decompression: More complex but still efficient
Compression Ratio
Implementation Strategy
Compression During Serialization
Compression Levels
Different proof components may use different compression:Performance Impact
Proof Size Reduction
For a typical Jolt proof:
Note: Actual compression ratio depends on the specific proof components. Estimated ~3x for curve points alone, ~2-2.5x for full proof (including scalars).
Computational Cost
Compression time (per G1 point):- Standard compression: ~5 μs
- Torus compression: ~10 μs (estimated)
- Standard decompression: ~20 μs (requires square root)
- Torus decompression: ~50 μs (estimated, more complex reconstruction)
- Proof generation: Minimal overhead (~1-2% increase)
- Proof serialization: Slight overhead from compression
- Proof deserialization: ~2-3x slower decompression
- Verification: No change (works with decompressed points)
Use Cases
When to Use Torus Compression
✅ Good for:- On-chain proof submission (minimize calldata costs)
- Proof archival (long-term storage)
- Network transmission over slow connections
- Applications where verification is infrequent
- High-throughput verification (latency-sensitive)
- Local proof generation and verification
- Applications that re-verify proofs frequently
Hybrid Approach
Use different compression for different stages:Implementation Status
Current State
Roadmap
Phase 1: Standard Compression (likely implemented)- Use arkworks’ built-in point compression
- Serialize G1 points as 33 bytes (x-coordinate + sign bit)
- Serialize G2 points as 65 bytes
- Implement torus-based compression algorithm
- Integrate with Dory commitment scheme
- Benchmarking and optimization
- Automatically choose compression level based on use case
- Profile-guided compression (compress hot proof components less aggressively)
Related Techniques
Other Proof Compression Methods
1. Recursive SNARKs:- Compress proof by proving its verification in another SNARK
- Can achieve constant-size proofs (~1-2 KB)
- Much higher prover cost (10-100x)
- Amortize verification cost across multiple proofs
- Doesn’t reduce individual proof size
- Complementary to compression
- Combine multiple proofs into one
- Useful for blockchain rollups
- Can be combined with torus compression
Best Practices
Compression Configuration
Error Handling
Torus decompression can fail if the compressed data is invalid:Related Optimizations
- Batched Openings: Reduce number of curve points in proof
- Batched Sumcheck: Reduce number of sumcheck rounds
References
- BN254 Curve Specification — Pairing-friendly elliptic curve
- Torus-Based Cryptography — Theoretical foundation (example paper)
- Profiling benchmark:
jolt-core/benches/e2e_profiling.rs