This page centralises repository-wide commentary that used to live in older package-reference notes and the pairing-oriented status note. For package-specific API details, see the dedicated chapters in this manual.
Pages = ["implementation-notes.md"]
Depth = 2
- GrothAlgebra – prime-field arithmetic (BN254, secp256k1), polynomial
utilities, and generic MSM helpers. BN254
Fq/Frnow run on a Montgomery backend, and the current follow-through work is focused on the remainingBigIntescape hatches and prover-shaped specialization. - GrothCurves – BN254 tower fields, Jacobian G1/G2 arithmetic, and the
optimal ate pairing pipeline. Sparse Fp12 placement and Frobenius corrections
follow standard BN references; the
ProjectivePointabstraction keeps the pairing engine generic. - GrothProofs – R1CS/QAP conversion plus Groth16 setup/prove/verify. Coset FFT is the default; the dense quotient remains solely as an assertion. The latest prover work has shifted from broad backend replacement to the remaining hot-path specialization tracked in the roadmap.
- GrothExamples / benchmarks – notebook-first tutorials (including AbstractAlgebra and package-native R1CS → QAP walkthroughs), alongside JSON/PNG benchmark artefacts capturing prover hot paths.
- The extension tower (
BN254Fp2,BN254Fp6_3over2,BN254Fp12_2over6) uses Karatsuba-like decompositions and precomputed non-residue constants to shave multiplications. BN254Curve.jlkeeps G1/G2 in Jacobian coordinates, exposing mixed additions against affine points plus batch normalisation for CRS vectors.BN254MillerLoop.jlimplements the D-twist line placement with sparse Fp12 multiplication, whileBN254FinalExp.jlsplits the easy/hard exponentiation and reuses Frobenius shortcuts.BN254Pairing.jlwraps everything under theBN254Engineabstraction so additional curves can slot in later.
R1CS.jldefines reusable fixtures (multiplication, sum-of-products, affine-product, square-offset) and powers the randomised circuit generator.QAP.jlrecords constraint points and builds arkworks-shaped power-of-two domains with constraint rows, public-input selector rows, and zero padding explicit before IFFT.Groth16.jlwires the setup, prover, and verifier paths, including the prepared verifier that batches pairings (pairing_batch) before the single final exponentiation.
- Replace the remaining
BigInt-based inversion path in the BN254 backend. - Specialize final exponentiation and other extension-field hot paths further.
- Rebaseline
prove_fullafter each high-leverage specialization stage before deciding when Stage 9 parallelism is worth doing.
- [From Textbook To Optimized Code](@ref textbook-to-optimized) explains why some implementation paths no longer look like direct textbook derivations.
- [Implementation vs Arkworks](@ref implementation-vs-arkworks) compares our
choices against arkworks (
ark-ff,ark-poly,ark-groth16). - [RareSkills ZK Book ↔ Groth.jl Map](@ref rareskills-map) links textbook chapters to the corresponding Julia modules.