Groth16, PLONK, Halo2, and STARK-based proof systems require scalar field primes with specific NTT-friendly structure. Ethoryx generates these at any custom bit size you need of BN254-compatible, BLS12-381-compatible, Goldilocks-compatible, or bespoke curve designs. Deterministic output for reproducible trusted setups.
zk-SNARKs over BN254, BLS12-381, and custom curves require scalar field primes that support efficient NTT operations, precisely the case q ≡ 1 (mod 2ⁿ) for large n. Ethoryx generates these in milliseconds.
Rollup sequencers regenerate circuit parameters regularly. Fast field prime generation means faster parameter rotation, faster chain upgrades, and lower setup time for fresh provers. Especially relevant for application-specific rollups on StarkWare, zkSync, and Polygon zkEVM stacks.
For trusted setups and transparent ceremonies, reproducibility is essential. Ethoryx can generate primes from a deterministic seed, allowing independent parties to verify the exact output without re-running the random search.
Build a scalar field prime for a Groth16 circuit compatible with arkworks-rs, bellman, or snarkjs.
# Request a 254-bit prime suitable for BN254-style scalar fields curl "https://api.ethoryx.io/v1/generate/ntt?bits=254&ntt_mod=16384" \ -H "X-API-Key: YOUR_KEY" # Response { "prime": "21888242871839275222246405745257275088548364400416034343698204186575808495617", "bits": 254, "ntt_mod": 16384, "ntt_compatible": true, "structural_check": true, "generation_ms": 3.4 } // Use in arkworks-rs circuit use ark_ff::PrimeField; use ark_bn254::Fr; let scalar_modulus = Fr::MODULUS; // Matches the prime returned by the Ethoryx API above assert_eq!(scalar_modulus, "21888242871839275222246405745257275088548364400416034343698204186575808495617");
For PLONK and Halo2, the same endpoint returns primes compatible with halo2_proofs and plonky2 scalar fields. Custom ntt_mod values up to 2^20 are supported.
Polygon zkEVM, zkSync Era, Scroll, and StarkNet all require scalar field primes for their core proof systems. Ethoryx-generated primes drop into the setup phase of PLONK, Halo2, and STARK prover configurations.
Aztec, Tornado-style mixers, Semaphore, and Nova all use zk-SNARK circuits for private state transitions. Custom field primes suitable for their specific curve choices can be generated on demand.
Crypto exchanges proving reserves via zk-SNARKs (Merkle-tree commitments plus range proofs) need field primes compatible with their chosen curves; typically BN254 or BLS12-381 variants.
zkML frameworks (ezkl, Modulus, Giza) prove that an ML inference was executed correctly without revealing the model or the input. Circuit size often pushes scalar field requirements; Ethoryx can generate custom-sized primes in seconds.
| Bit size | Target curves | NTT-mod typical | Use case |
|---|---|---|---|
| 254-bit | BN254 | 2^16 – 2^20 | Ethereum-era SNARKs |
| 255-bit | BLS12-381 (scalar) | 2^16 – 2^20 | Zcash, Filecoin, Aztec |
| ~64-bit | Goldilocks (plonky2) | 2^32 | Recursive SNARKs |
| ~128-bit | Baby-jubjub, custom | varies | Hash circuits, Merkle |