2025-10-06 00:57:05 +02:00
|
|
|
Reference implementation in Haskell
|
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
|
|
First we implement a slow but hopefully easier to understand version in Haskell,
|
|
|
|
|
to get more familiarity with all the details.
|
|
|
|
|
|
|
|
|
|
The implementation is loosely based on (the FRI portion of) Plonky2, which in
|
|
|
|
|
turn is more-or-less the same as the DEEP-FRI paper. We use different conventions
|
|
|
|
|
though, as Plonky2 is rather over-complicated.
|
|
|
|
|
|
|
|
|
|
See the [docs](../docs/) directory for details.
|
|
|
|
|
|
|
|
|
|
### Improving performance
|
|
|
|
|
|
|
|
|
|
We could significantly improve the speed of the Haskell implementation by binding C code
|
2025-10-13 09:47:30 +02:00
|
|
|
for some of the critical routines: Goldilocks field and extension, hashing, fast Fourier
|
|
|
|
|
transform.
|
2025-10-06 00:57:05 +02:00
|
|
|
|
2025-10-21 13:14:07 +02:00
|
|
|
The switch between the simple but intentionally naive (and very slow) Haskell
|
|
|
|
|
implementation and the significantly faster C bindings is controlled by by the
|
|
|
|
|
C preprocessor flag `-DUSE_NAIVE_HASKELL` (so the faster one is the default).
|
|
|
|
|
|
2025-10-14 20:21:19 +02:00
|
|
|
### Implementation status
|
|
|
|
|
|
2025-10-21 13:14:07 +02:00
|
|
|
- [ ] cabalize
|
2025-10-14 20:21:19 +02:00
|
|
|
- [x] FRI prover
|
|
|
|
|
- [x] FRI verifier
|
2025-10-15 13:31:44 +02:00
|
|
|
- [x] proof serialization
|
2025-10-14 20:21:19 +02:00
|
|
|
- [ ] serious testing of the FRI verifier
|
|
|
|
|
- [ ] full outsourcing protocol
|
|
|
|
|
- [x] faster Goldilocks field operations via C FFI
|
2025-10-21 13:14:07 +02:00
|
|
|
- [x] quadratic field extension in C too (useful for the folding prover?)
|
2025-10-15 13:31:44 +02:00
|
|
|
- [x] faster hashing via C FFI
|
2025-10-14 20:21:19 +02:00
|
|
|
- [ ] faster NTT via C FFI
|
2025-10-21 13:14:07 +02:00
|
|
|
- [ ] disk layout optimization
|
|
|
|
|
- [ ] end-to-end workflow with input/output data in files
|
|
|
|
|
- [ ] command line interface
|
|
|
|
|
- [ ] even more detailed documentation of the protocol
|
2025-10-14 20:21:19 +02:00
|
|
|
|
2025-10-06 00:57:05 +02:00
|
|
|
### References
|
|
|
|
|
|
2025-10-13 09:47:30 +02:00
|
|
|
- E. Ben-Sasson, L. Goldberg, S. Kopparty, and S. Saraf: _"DEEP-FRI: Sampling outside the box improves soundness"_ - https://eprint.iacr.org/2019/336
|
|
|
|
|
- Ulrich Haböck: _"A summary on the FRI low degree test"_ - https://eprint.iacr.org/2022/1216
|