How ingonyama-zk/smallfield-super-sumcheck works
Main Components
• Core Library: At the heart is the Rust library (lib.rs) defining key API components.
• Algorithms Module: Under src/algorithms, several files (one.rs, two.rs, three.rs, four.rs) implement the sumcheck algorithms. Each file can be represented as a node, showing the two divergent approaches: Algorithm 1 (collapsing arrays) and Algorithm 2 (precomputations).
• Prover and Verifier: The modules in src/prover.rs and src/verifier.rs encapsulate the main proving logic and the verification processes.
• Transcript Management: There are dedicated modules for handling transcripts (src/transcript.rs, src/btf_transcript.rs, src/extension_transcript.rs), which interface with the merlin library to realize the Fiat-Shamir heuristic.
• Data Structures: The src/data_structures.rs file indicates core, reusable types or data representations in the project that underpin the sumcheck computations.
• Tower Fields Module: In src/tower_fields, files like binius.rs deal with specialized field operations (e.g., binary operations on tower fields) used during polynomial computations.
• Testing & Benchmarks: The tests (both in src/tests and the benches directory) provide validation and performance analysis. Separate nodes for test suites and benchmarks help in reflecting iterative development and performance evaluation.
Relationships and Interactions
• The Prover module uses components from the Algorithms, Data Structures, and Transcript modules to compute the sumcheck proof.
• The Transcript modules (including the specialized BTF and extension transcripts) are used by both the prover and the (future) verifier to obtain randomness or challenges via the merlin library.
• The Algorithms in src/algorithms are called by the main prover logic, with each algorithm having its own trade-offs (memory vs. computation).
• The Tower Fields components are integrated with the above modules, particularly in the context of polynomial evaluation and field arithmetic.
• Tests and benchmarking code interacts with all core components to validate functionality and measure performance.
Architectural Patterns & Design Principles
• Modularity: Components are separated by functionality (algorithms, prover, verifier, transcript management), which promotes clarity and testing.
• Reusability: Shared helper functions and data structures increase maintainability and reduce code duplication.
• Extensibility: The design supports switching or updating the sumcheck algorithm easily. Future implementations like adding multi-threading or commitment schemes are envisioned.
• Layered interaction: Lower-level modules (e.g. data structures and tower fields) support higher-level components like the prover and transcript, following a clear dependency direction.