Torus compression is a technique for reducing proof size by compressing elliptic curve points in Dory polynomial commitments. This optimization can achieve an estimated 3x reduction in proof size with minimal computational overhead.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/a16z/jolt/llms.txt
Use this file to discover all available pages before exploring further.
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
| Format | G1 Size | G2 Size | Compression Ratio |
|---|---|---|---|
| Uncompressed | 64 bytes | 128 bytes | 1x (baseline) |
| Standard compressed | 33 bytes | 65 bytes | ~2x |
| Torus compressed | ~21 bytes | ~42 bytes | ~3x |
Implementation Strategy
Compression During Serialization
Compression Levels
Different proof components may use different compression:Performance Impact
Proof Size Reduction
For a typical Jolt proof:| Component | Count | Uncompressed | Torus Compressed | Savings |
|---|---|---|---|---|
| Polynomial commitments | 80 | 5,120 bytes | 1,680 bytes | 3,440 bytes |
| Dory opening proof | 30 | 1,920 bytes | 630 bytes | 1,290 bytes |
| BlindFold (ZK) | 150 | 9,600 bytes | 3,150 bytes | 6,450 bytes |
| Sumcheck polynomials | — | 4,000 bytes | 4,000 bytes | 0 (no compression) |
| Total | — | 20,640 bytes | 9,460 bytes | ~2.2x reduction |
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