Skip to content

Architecture

Longfellow-ZK separates the statement being proved from the generic machinery that proves it. An application circuit describes a relation between public inputs and a private witness; the base library compiles, evaluates, proves, and verifies that relation.

End-to-end proof flow

text
Application data
  → witness construction
  → arithmetic circuit and canonical circuit ID
  → sumcheck transcript for circuit evaluation
  → Ligero commitment and constraint proof
  → Fiat–Shamir challenges
  → serialized non-interactive proof
  → verifier reconstructs challenges and checks all constraints

The prover commits before learning later challenges. The Fiat–Shamir transcript derives those challenges from the statement and ordered protocol messages, so a single proof can be verified without a live multi-round exchange.

Base-library layers

LayerRepresentative sourceResponsibility
Fields and codingsrc/algebra/, src/gf2k/Finite-field operations, FFTs, Reed–Solomon encoding
Circuit modelsrc/circuits/, src/sumcheck/circuit*Logic gadgets, compiler, layers, canonical circuit identity
Interactive proofsrc/sumcheck/Reduce circuit evaluation to polynomial claims
Commitment proofsrc/ligero/, src/merkle/Commit to encoded values and open challenged positions
Transcript and randomnesssrc/random/Domain-separated messages and Fiat–Shamir challenges
Proof compositionsrc/zk/Orchestrate prover, verifier, and proof objects
Serializationsrc/proto/, src/util/byte_cursor.hCircuit formats, bounds, canonical parsing

Sumcheck's role

The compiler represents the computation as layered arithmetic constraints. Sumcheck lets the prover convince the verifier that these large collections of constraints evaluate correctly while the verifier checks a much smaller number of field operations. Longfellow specializes the representation and transcript for its circuit structure.

Ligero's role

Ligero encodes witness-related values with Reed–Solomon codes, commits to them with a Merkle tree, and proves linear and quadratic constraints by opening a challenge-selected subset. Its soundness derives from coding distance, unpredictable challenges, and collision resistance. A random padding row hides the witness-related rows used by the argument.

Trust and assumption profile

Longfellow avoids a trusted setup and does not require pairing-friendly curves. Its deployed assumptions include collision-resistant hashing, sound parameter selection, secure randomness, the Fiat–Shamir model and transcript construction, and correct circuit compilation. “No trusted setup” does not mean “no trust”: a deployment still trusts reviewed code, build artifacts, parameters, circuits, and the verifier's interpretation of public inputs.

Package boundary

The base follows the architecture of the upstream Rust workspace without copying its Cargo directory structure. Named mdoc, ECDSA, and BIP340 projects depend on the base. The ownership manifest rejects missing, duplicate, stale, or reverse dependencies. Read the boundary document for the precise rule.

Artifact boundaries

Circuits have canonical identifiers. LFC1 remains the default storage writer; LFC2 is a compact, opt-in circuit format that preserves circuit IDs, arithmetic, transcripts, and proof bytes. See LFC2 circuit storage.