Solutions · Zero-Knowledge Cryptography

Scalar field primes for zk-SNARKs, generated in milliseconds.

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.

Field prime speed
~3ms
60-bit NTT field · C/GMP Core
Curve compatibility
BN254 · BLS12
and custom scalar fields
Arithmetization
R1CS · PLONK · AIR
every mainstream circuit system
Test reduction
−79%
vs. standard at 1024-bit

NTT-friendly scalar fields

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.

Built for zk-rollup throughput

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.

🎯

Deterministic for reproducibility

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.

Groth16 scalar field setup

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.

zk-SNARK applications

zk-rollup operators

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.

Privacy protocols

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.

Proof-of-solvency systems

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.

Verifiable ML / AI

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.

Proof system compatibility

Groth16arkworks · snarkjs · bellman
PLONKhalo2 · plonky2 · plonky3
STARKswinterfell · stwo
Nova / SuperNovafolding schemes

Curve-compatible bit sizes

Bit sizeTarget curvesNTT-mod typicalUse case
254-bitBN2542^16 – 2^20Ethereum-era SNARKs
255-bitBLS12-381 (scalar)2^16 – 2^20Zcash, Filecoin, Aztec
~64-bitGoldilocks (plonky2)2^32Recursive SNARKs
~128-bitBaby-jubjub, customvariesHash circuits, Merkle

Build zk-rollups and private circuits

Fast field prime generation for every zk-SNARK circuit you build. Get a free API key and generate 254-bit primes in milliseconds or talk to us about a custom curve.