-
Notifications
You must be signed in to change notification settings - Fork 3
feat: zkVM packages #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: zkVM packages #270
Conversation
541717c to
10dea37
Compare
|
I've done some testing. I have created a very rough nixification of zkVMs-benchmark, with the goal of trying out these packages. I had to do some adjustments to Jolt, but outside of that, everything went swimmingly. You can check it out here: https://github.com/blocksense-network/zkVMs-benchmark/tree/nixification-test. As is written in the README (where you'll also find usage instructions), this is a very rough proof of concept. The codebase is as clean as I could muster, so I feel it's ready for a review. |
|
Please update the README of this repo to add descriptions of the newly added packages. While you are at it, I would also appreciate it if you make the improvements I've requested here: |
|
I've added tables for the zkVM packages. Currently they're all listed as supporting only x86_64-linux. They may support darwin but I have no devices to test. Regarding the general README improvements, I've replaced the lists with headers, but I've not written a contents section since GitHub provides a much better one automatically: I'm also not sure who to ask for organizing the packages. |
|
Can you clarify why some packages feature a My expectation is that packages that build binaries will have a lock file and those that must be integrated as a library won't, but currently this doesn't seem to be the case. Otherwise, this looks good for merging. Please rebase and investigate the CI issues, so we can merge it soon. |
Because certain zkVMs don't provide one (to be more specific, it's .gitignore-ed in their repository) and crane requires it (crane is the Nix library which is used for all Rust projects). As to why they don't have a Cargo.lock, it seems in the past this was the recommended Rust workflow, though it isn't anymore. |
2a9cc0a to
d108ed9
Compare
|
The CI issues seem to have been from GitHub. When looking at the logs, I found the errors stemmed from not finding a repository which absolutely existed. |
|
Caution
Update: all zkVM packages are up to date as of 07.01.2025 |
Co-authored-by: Petar Atanasov <[email protected]>
This change will also need to be done for stable 1.84 https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
Now you could reference the package in your project's Cargo.toml as `path = "/nix/store/...-jolt-..."` Co-authored-by: Petar Atanasov <[email protected]>
`jolt new` will create a project with the correct /nix/store path to jolt, installPhase now emits bin/jolt, bin/cargo, ... so all you need to use jolt is found with `nix shell flake#jolt`
We need different cargo version when compiling the guest and host programs and zkm requires certain variables to be set, so in the installPhase we create cargo-host and cargo-guest, each of which set those variables and then pass arguments to the correct cargo version
To use it you will need dependencies (cmake, pkg-config, openssl) and a link script. Future versions will address these problems.
2e84b74 to
9afd4eb
Compare
…0241217 (v1.85.0)
- Update Cargo.lock - Replace nightly (host) toolchain with the prebuilt zkm one - Remove cargo_guest (and rename cargo_host to cargo) - Update LD_LIBRARY_PATH in cargo script
When the guest is compiled with the standard library, cargo is spawned with RUSTUP_TOOLCHAIN variable set. In such cases we put the jolt rust fork as the "default" cargo to call. Before this commit, the condition worked in the opposite way.
9afd4eb to
4fccdef
Compare
|
Thanks for your Pull Request! Below you will find a summary of the cachix status of each package, for each supported platform.
|

This PR aims to add Nix packages for Jolt, Nexus, zkMIPS, zkWasm, SP1 and RISC0 Zero-knowledge Virtual Machines.
For the immediate future, it will be left as a draft PR, signifying that the packages are in a useable form where anyone can try them out.
However, a lot of cleanup and testing still needs to be done until it is ready for review.
P.S. Even though it shows ~11k additions, in reality 10533 lines come from two
Cargo.tomlfiles which needed to be included. The actual code is >=510 lines, many of which are boilerplate.