How o1-labs/proof-systems works
Main Components
• Core Proof System: At the heart is the “kimchi” crate, which implements a PLONK-based zero‐knowledge proof system.
• Cryptographic Primitives: Several crates provide the building blocks:
• curves – Includes elliptic curve implementations (Pasta curves).
• groupmap – For mapping between curve and field elements.
• hasher – Implements hashing functions used by Mina.
• poseidon – Provides the Poseidon hash function.
• poly-commitment – Implements polynomial commitment protocols.
• Auxiliary Tools and Libraries: These support various aspects of the system:
• signer – Contains signature schemes.
• utils – A collection of helper functions and traits.
• Additional math/crystallographic libraries such as folding, ivc, msm, mvpoly, turshi, etc., that support polynomial operations, field arithmetic, and circuit building for proofs.
• Documentation and Specifications:
• book – Contains the Mina book, technical specifications, and other supporting documents.
• Visualization & Debugging:
• tools/kimchi-visu – Provides tooling for visualizing aspects of the proof system.
• Other Supporting Components:
• o1vm – Implements a virtual machine (with interpreters for MIPS, RISC-V, and more) that likely ties into the proof system for verifying program executions.
Relationships and Interactions
• The “kimchi” proof system is central and depends on its underlying cryptographic libraries (curves, groupmap, hasher, poly-commitment, poseidon) for generating and verifying proofs.
• Additional libraries like folding, ivc, msm, and mvpoly provide support for polynomial arithmetic, constraint systems, and witness generation, interacting with the main “kimchi” and proof modules.
• The “signer” crate and “utils” provide supporting interfaces and common functionality to several modules.
• The “book” directory stands apart in that it documents the specifications and theoretical background; consider showing this as an external resource or documentation layer that feeds into the development and usage of the system.
• The “o1vm” component seems to be an execution engine (with its own set of interpreters and ELF loading infrastructure) which might interact with the proof system to verify program behavior.
Architectural Patterns and Design Principles
• Modular and Layered Design: Each crate is a self-contained module exposing a defined interface, allowing for separation of concerns (cryptography, arithmetic, signature handling, protocol logic, etc.).
• Library/Crate Dependency: Direct dependencies exist between the main proof system (kimchi) and the underlying mathematical and cryptographic libraries.
• Extensibility: The structure (with a dedicated “book” for specifications and tools directories) suggests that the system is designed for adaptability and continuous evolution (e.g., adding new curve implementations or proof schemes).
• Domain-Driven Design: The separation by functionality (hashing, commitments, arithmetic, VM interpretation) reflects a design focused on discrete responsibilities rooted in zero-knowledge proof theory and cryptographic systems.