MCPcopy Index your code
hub / github.com/arkworks-rs/gemini

github.com/arkworks-rs/gemini @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
513 symbols 1,362 edges 86 files 123 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gemini is elastic proof system system, FFT-free, blazingly fast and space-conscious. This code is not meant for production use and has not been audited.

Documentation

Gemini's API can be accessed via:

cargo rustdoc --open

This include a detailed protocol description.

Features

Gemini can be compiled with the following feature flags:

  • asm, to turn on the assembly backend within ark-ff;
  • parallel, to turn on multi-threading. This requires the additional dependency rayon;
  • std, to rely on the Rust Standard library;
  • print-trace, to print additional information concerning the execution time of the sub-protocols. This feature must be enabled in order to monitor the execution time of the examples.

Performance

Micro-benchmarks for single components are done using criterion.rs. Benchmarks for the elastic and time-efficient provers can be run through the examples/. More specifically, to benchmark an instance of logarithmic size INSTANCE_LOGSIZE, run:

cargo run --features asm,print-trace,parallel --example snark -- -i <INSTANCE_LOGSIZE>

You monitor the memory used setting the environment variable RUST_LOG=debug. We tested so far ranges from 18 up to 35. It is also possible to run a purely-linear time prover with the additional option --time-prover.

Elasticity

Space footprint for the prover can be tweaked playing with the following constants: - TENSOR_EXPANSION_LOG (set to 16) which sets the space budget for expanding the tensor products; - MAX_MSM_BUFFER_LOG (set to 20) the size of the buffers over which Gemini performs multi-scalar multiplication; - SPACE_TIME_THRESHOLD (set to 22) the threshold for converting the space-prover into the time-prover. It will run a separate thread measuring stack+heap consumption.

The so-called time_prover modules contain a full-speed implementation of the proving algorithm without constraints on space.

Extension points exported contracts — how you extend this code

Prover (Interface)
Prover trait interface for both time-efficient and space-efficient prover. [4 implementers]
src/subprotocols/sumcheck/prover.rs
BilinearModule (Interface)
(no doc) [5 implementers]
src/herring/module.rs
GeminiTranscript (Interface)
A Transcript with some shorthands for feeding scalars, group elements, and obtaining challenges as field elements. [1 …
src/transcript.rs
Prover (Interface)
Prover trait interface for both time-efficient and space-efficient prover. [2 implementers]
src/herring/prover.rs

Core symbols most depended-on inside this repo

iter
called by 119
src/psnark/constraint_system.rs
append_serializable
called by 96
src/transcript.rs
len
called by 53
src/herring/ipa.rs
iter
called by 46
src/herring/ipa.rs
len
called by 43
src/psnark/streams/val_stream.rs
iter
called by 39
src/subprotocols/sumcheck/streams.rs
powers
called by 30
src/misc.rs
ip
called by 30
src/misc.rs

Shape

Method 213
Function 175
Class 119
Interface 4
Enum 2

Languages

Rust100%

Modules by API surface

src/misc.rs26 symbols
src/herring/ipa.rs24 symbols
src/psnark/streams/val_stream.rs15 symbols
src/psnark/constraint_system.rs15 symbols
src/iterable/dummy.rs15 symbols
src/kzg/msm/stream_pippenger.rs14 symbols
src/kzg/time.rs13 symbols
src/circuit.rs13 symbols
src/subprotocols/sumcheck/streams.rs12 symbols
src/kzg/mod.rs12 symbols
src/subprotocols/sumcheck/time_prover.rs11 symbols
src/psnark/streams/tensor_stream.rs11 symbols

For agents

$ claude mcp add gemini \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact