This page stitches together the RareSkills ZK Book material and the production implementations inside Groth.jl. Use it as a compass when moving from conceptual chapters to code.
Pages = ["rareskills-map.md"]
Depth = 2
flowchart LR
subgraph Book["RareSkills ZK Book concepts"]
direction TB
FF["Finite fields<br/>modular arithmetic"]
SUB["Group theory<br/>subgroups"]
POLY["Lagrange interpolation<br/>polynomials"]
ECC["Elliptic curve arithmetic"]
PAIR["Pairings<br/>final exponentiation"]
R1CS["Rank-1 constraint systems"]
QAP["QAP<br/>R1CS to QAP"]
G16["Trusted setup<br/>Groth16"]
EX["Worked circuits<br/>tutorials"]
end
subgraph Code["Groth.jl implementation"]
direction TB
GA["GrothAlgebra/FiniteFields.jl"]
GG["GrothAlgebra/Group.jl"]
PA["GrothAlgebra/Polynomial.jl"]
GC["GrothCurves/BN254Curve.jl"]
GP["GrothCurves pairing pipeline"]
PR1["GrothProofs/R1CS.jl"]
PQ["GrothProofs/QAP.jl"]
PG["GrothProofs/Groth16.jl"]
EXJ["GrothExamples/"]
end
FF --> GA
SUB --> GG
POLY --> PA
ECC --> GC
PAIR --> GP
R1CS --> PR1
QAP --> PQ
G16 --> PG
EX --> EXJ
- RareSkills ZK Book concepts: finite fields and modular arithmetic, group theory, homomorphisms, multiplicative subgroups, polynomial arithmetic, and inner-product algebra.
- Groth.jl counterparts:
GrothAlgebra/FiniteFields.jldefinesFiniteFieldElementplus the current fixed-width Montgomery BN254 field backend.GrothAlgebra/Polynomial.jlimplements Horner evaluation, interpolation, derivatives, and FFT scaffolding.GrothAlgebra/Group.jlprovides curve-agnostic group operations, w-NAF helpers, and MSM support.
- What changes in code: we lean on fixed-width limbs, concrete extension-field storage, windowed MSM, and FFT-friendly evaluation domains to feed the prover efficiently.
- RareSkills ZK Book concepts: elliptic curve addition, elliptic curves over finite fields, bilinear pairings, Miller loops, and final exponentiation.
- Groth.jl counterparts:
GrothCurves/BN254Curve.jlkeeps G1/G2 in Jacobian form with mixed additions and batch normalisation.- Tower files (
BN254Fp2.jl,BN254Fp6_3over2.jl,BN254Fp12_2over6.jl) encode the extension fields exactly as derived in the book. BN254MillerLoop.jl,BN254FinalExp.jl,BN254Pairing.jlfollow the optimal ate pipeline and reuse Frobenius shortcuts.
- What changes in code: we use sparse Fp12 placement, precomputed Frobenius constants, and the
BN254Engineabstraction so future curves can reuse the same interface.
- RareSkills ZK Book concepts: arithmetic circuits, rank-1 constraint systems, Lagrange interpolation, Schwartz-Zippel, quadratic arithmetic programs, and R1CS to QAP.
- Groth.jl counterparts:
GrothProofs/R1CS.jlships multiplication, sum-of-products, affine-product, and square-offset circuits plus randomised fixtures.GrothProofs/QAP.jlrecords the active constraint points and builds an arkworks-shaped power-of-two domain: constraint rows first, public-input selector rows next, and zero padding last.
- What changes in code:
prove_fulluses the coset-only quotient path, while dense/coset parity survives in tests and debugging helpers. The current performance work is focused more on prover hot paths than on broad domain rewrites.
- RareSkills ZK Book concepts: trusted setup, evaluating a QAP on a trusted setup, and Groth16 proving and verification.
- Groth.jl counterparts:
GrothProofs/Groth16.jlwires setup/prove/verify, including the prepared verifier path and batched pairings viapairing_batch.GrothProofs/test/runtests.jlmirrors the book’s witness discipline across multiple circuit families.GrothExamples/provides notebook-based walkthroughs (AbstractAlgebra-first and Groth package-native R1CS → QAP flows) for side-by-side comparison.
- Start with the RareSkills ZK Book section you are studying.
- Jump to the matching Groth.jl module listed above.
- Compare representation choices—projective vs affine, batched MSM, FFT preparation—to understand how the production prover keeps the algebraic guarantees while optimising for performance.
For a focused explanation of why the optimized code no longer always looks like the textbook derivation, see [From Textbook To Optimized Code](@ref textbook-to-optimized).
Update this page whenever new features land or the textbook mapping shifts.