-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Bounty description
This bounty is to replace three crates in the edge-prover that are effectively deprecated or are causing additional friction. The overarching goal is to improve the cleanliness of the edge-prover codebase. A successful PR should net remove lines of code, reduce glue code in edge-frontend, and lose zero functionality. Performance is less of a worry, though a successful PR should also be able to provide changes in performance numbers.
Implementation requirements
Note, this issue is marked with the discussion label, and as such we expect some back and forth discussion on changes for a solution to this issue. Nonetheless, here are the requirements as we have them today.
- Replace in the workspace the use of
ffwithark-ff- Reasoning:
ffis a great crate, but if you look at its history, it is stale and has not seen changes in a while (until VERY recently). See here. Amazingly, the last update was March 9th 2025, but prior to that it was more than two years before a change. Also, other crates such as those to do with ACIR primarily useark-ff.
- Reasoning:
- Replace
bellpepperwithark-r1cs- Reasoning: similarly to the above,
bellpepperis a nice crate, but it has also been abandoned. It's a bit more complex than what we need as well. Theark-r1csalternative is a bit more simple. - Another option as well would be to use Pluto's WIP
custom-constraintscrate.
- Reasoning: similarly to the above,
- Replace
halo2curveswithark-ec- Reasoning: with the other changes, having to interface between
halo2curvesand the ark ecosystem would be a bit dirty and unnecessary. We should migrate to the ark ecosystem entirely by this point, so we may as well drop off thehalo2curves.
- Reasoning: with the other changes, having to interface between
- Is there more...?
Overall, this gives us a chance to work with the arkworks ecosystem which has no FFI as far as I know it. It also is being worked on actively, albeit maybe a bit slowly. Furthermore, and this is important, we can use sonobe as a reference point since they did everything there using the arkworks ecosystem.
Bonus features
There is more that can be done, and the emphasis is entirely on code quality and minimization. It does not directly have to do with this migration, but doing a migration as large as this opens up a good opportunity to do larger scale refactoring. To that end, here are some other generic features of this bounty:
- Reduce trait complexity.
- The
edge-provercodebase (based off of Arecibo) has a fairly tangled web of traits. It makes navigating and working in the repo challenging. In fact, this can really make the Rust analyzer choke. - The upshot here is that with a further simplified codebase, iteration on this project in the future becomes far less cumbersome. Your work here in clearing out space will make it a joy for future contributors. Folding is constantly undergoing research with large changes, we should be able to iterate quickly!
- The
- Reduce number of dependencies.
- Dependencies are inherently a complexity. We have to make sure they are cross-compatible and often times even pin versions or deal with compilation into different targets. Many times a dependency is used for a tiny amount of code, but we are adding many nested packages just to accomplish what is maybe just "extra" or what could be handled by a bit more self-contained code.
- Reduce generality of code.
- Right now the codebase is highly generalized allowing, for example, different commitment schemes. I don't think we want to completely remove the capability of easily swapping in and out certain components, but the abstractions laid down today are not very admissible to this goal. At this point, it would be smarter to overall reduce the generality and make more succinct and focused code.
- Reduce code redundancy.
- Redundancy is hard to manage and is by definition unnecessary. Let's remove as much of this as possible.
- Investigate serialization.
- We had in earlier pull requests introduced a
FastSerdetrait and implemented it where needed. I'm curious if this is necessary. Arkworks offers its ownCanonicalSerializein theark-serializecrate. Also, there isrkyvfor zero-copy serialization. An issue (bench:rkyvas a (de)serializerย #14) proposes benching these implementations together. I would love to see which comes out fastest (most importantly in the WASM context) so that we can potentially drop in a more general serialization library and remove the need forFastSerde(again, if benchmarks demonstrate this is a good idea).
- We had in earlier pull requests introduced a
Resources
Criteria
For timely submissions of bounties that meet the implementation requirements, a bounty of at least $2500 will be awarded to the contributor. Additional bounty amounts are available and will be rewarded based on the following criteria:
- Completion of any of the bonus features listed above and/or other bonus features that improve the quality of the submission.
- Correctness and security: A thorough review of the implementation should convince our team that they are correct and secure, with all requirements met.
- Code clarity and quality: Succinct, easy-to-follow code with appropriate naming conventions. Utilize Rustโs type system for flexibility and security (e.g., compile-time checks where possible), and avoid external crates. Optimizations should be a lower priority than clarity, but can be included behind a feature flag as a bonus.
- Documentation quality: Provide comprehensive READMEโs, Cargo docs, and inline comments where code itself is not self-explanatory. Prioritize clarity and readability.
Note: This is Pluto's largest bounty offering yet. This is a serious chance to make progress in folding backends for ZKPs.