This repository provides a standalone hardware accelerator for binary FRI folding over the Goldilocks field, developed in Chisel. Its native streaming interface supports integration into ASIC or FPGA designs to accelerate evaluation-table folding in FRI-based proof systems, including STARKs, and the corresponding folding operations on the verifier side.
It is licensed under the MIT License, permitting free commercial use, modification, and redistribution, provided the copyright and license notices are retained; see Third-party notices for tool and generated-code information.
Release v1.1.0 · Interface · Reproduction · Performance · Synthesis results
One task folds a declared number of pairs using one caller-supplied challenge alpha. One input pair is the triple f(x), f(-x), x inverse, and produces one field element g(x squared). Thus 32,768 pairs represent 65,536 evaluations and yield 32,768 folded values; the inverse is additional input, not another evaluation or a value computed by this block. All field words use unsigned 64-bit canonical values 0 <= v < p, where p = 2^64 - 2^32 + 1.
A lane is one pair position in a data beat. The bundled one-lane interface transfers at most one pair per accepted beat; that does not mean a whole task finishes in one cycle. The output tag identifies the task and index identifies its pair position. A task is a folding batch, not the commitments, queries and challenge generation of a complete FRI round.
| Integration question | Released hardware |
|---|---|
| Computation | Binary Fast Reed–Solomon Interactive Oracle Proof of Proximity (FRI) evaluation-table folding |
| Field | Goldilocks p = 2^64 - 2^32 + 1 |
| Bundled configuration | One lane, up to 32,768 pairs per task; top GoldilocksFriFold |
| Input/output | Each pair supplies f(x), f(-x) and x inverse; each output is one folded field element |
| Native boundary | Task/challenge, ordered input, output and completion ready/valid channels; returned tag/index |
Download the source archive from Release v1.1.0, or clone the current release snapshot:
git clone --branch v1.1.0 --depth 1 https://github.com/OpenRTL-Lab/fri-fold-goldilocks.git
cd fri-fold-goldilocksInstall the exact prerequisites in Toolchain, then run from the repository root with a fresh output directory:
python3 tools/emit_sv.py --out build/emit --lanes 1 --pairs 32768 --tasks 16This emission command is not a complete RTL regression. The documented verification entry is:
python3 tools/verify.py --out build/verify --jobs 8Follow Reproduction for expected results, negative-control interpretation and the distinction between short functional and full performance runs.
The reproduction workflow compares independent C/Python references and generated/bundled SV, and documents eight simulation modes. Functional checks cover handshakes and malformed frames separately from ideal-interface timing; reset recovery and an intentional reference error are explicit gates. Read the mode table and expected completion status before interpreting a simulator return code.
The caller supplies alpha and point inverses in the documented pair order. This block does not generate challenges, compute inverse tables, commit a Merkle tree or implement an entire FRI/STARK protocol. Reset discards an active task without issuing its completion; task status determines whether the complete output is usable.
Under ideal native interfaces, one 32,768-pair task takes 32,819 cycles; successive tasks complete 32,820 cycles apart, yielding 0.998415600 pairs/cycle. Each of the two modular-multiplication pipelines has at least one valid stage in 99.902498% of the measured steady-window cycles. This is pipeline occupancy, not per-stage issue utilization or the task completion rate.
These are documented RTL cycle measurements under ideal native interfaces. MHz-based time/rate conversions are not board or silicon measurements. The reported Design Compiler results apply only to the documented configuration, library corner and constraints; they do not establish place-and-route signoff or system throughput. See Performance and Synthesis results for conditions.
- Chisel design: folding pipelines, field arithmetic, native interfaces, and verification environment.
- Emission entry point and SV emission script: lane-count and maximum-task-size configuration.
- Generated SV: single-lane product supporting up to 32768 pairs per task, with top module
GoldilocksFriFold. - C reference model, Python cross-check, and simulation driver: the complete functional and performance verification chain.
- Architecture, Interface, and Toolchain: integration and reproduction information.
For binary FRI folding over Goldilocks, this module can implement bulk evaluation-table reduction on the prover side, query-point folding on the verifier side, or a streaming compute unit inside a multi-round FRI scheduler. The caller supplies paired values, the challenge, and point inverses, and organizes commitment and query processing.
With ideal interfaces, a single-lane task of 32768 pairs has a latency of 32819 cycles, sustained throughput of 0.998416 pairs/cycle, and 99.9025% occupancy in each modular-multiplication pipeline; see Performance for definitions, methodology, and results.
The circuit computes g(x²) = (f(x)+f(-x))/2 + α·x⁻¹·(f(x)-f(-x))/2 modulo 2⁶⁴−2³²+1; see Mathematical model for exact input conventions, equations, and a known-answer example.
Reproduce functionality and performance by emitting Chisel RTL and running independent C/Python references, eight simulation modes, and equivalence checks against the supplied SV; see Reproduction.
The single-lane configuration passes DC setup at 500 MHz with 10% setup clock uncertainty in TSMC 28 HPC+, SSG 0.81 V −40°C. All 22719 examined endpoint paths have strictly fewer than 50 logic levels; see Synthesis results for conditions, timing, and area.
Published materials include reproducible RTL design, emission and simulation workflows, and written summaries of synthesis conditions and results. We apologize that foundry licensing and commercial-tool confidentiality requirements prevent us from distributing the process library, original DC Tcl, raw reports, or synthesis snapshots. The delivered component is a standalone folding operator; the integrator organizes commitments, query scheduling, inverse generation, and system interconnects.
Browse OpenRTL, the ZK accelerator catalogue and OpenRTL website for related modules and the cooperation/contact entry. Custom datapaths, interfaces and target-platform adaptation are optional services; MIT commercial use does not require buying a service. Do not submit confidential specifications in public issues.
The version tag identifies the current source tree, including source notices and documentation. Release downloads provide hardware sources and bundled RTL for this version. Archive annotations and documentation can differ from the online tree. For RTL integration, use the product file list rather than verification environments; use the verification and synthesis documents for supported configurations and measurement conditions.