
Python to Rust to Proof: Cross-Validating a ZK System
Three implementations of the same physics. Python floating-point. Python scaled-integer. Rust BigInt. They must agree bit-for-bit, because the ZK proof is only as correct as the reference implementation it was validated against. Here's how we cross-validate a ZK system across languages and number representations. The Three Implementations Our zk-physics project maintains three implementations of the Rayleigh-Plesset simulation: 1. Python Float ( reference/simulate.py ) The ground truth for physics. Uses NumPy float64 — the same representation a physicist would use. Human-readable, easy to modify, trusted. @dataclass class SimulationParams: R0: float # Equilibrium radius (m) P0: float # Ambient pressure (Pa) Pa: float # Acoustic amplitude (Pa) freq: float # Frequency (Hz) gamma: float # Polytropic exponent sigma: float # Surface tension (N/m) mu: float # Viscosity (Pa*s) rho: float # Density (kg/m³) T0: float # Initial temperature (K) dt: float # Timestep (s) This implementation answers
Continue reading on Dev.to
Opens in a new tab



