Product
Oct 24, 2024
The Tl;DR
—--------------------------
Building on the success of our C compiler toolchain, we’re excited to announce the Valida Rust Alpha Compiler.
This initial step towards Rust integration marks an important milestone for supporting a wider range of languages and use cases for Valida, our state-of-the-art zkVM. We have also made significant progress and updates across our zkVM stack, all included in this release.
Our Valida Rust Alpha Compiler leverages the power of LLVM to bridge the gap between Rust and the Valida zkVM. This means that some parts of the Rust programming language can now be translated into an intermediate representation (IR) used by the LLVM compiler framework. From there, this IR can be further compiled into machine code that runs on the Valida zkVM.
Essentially, developers can now write some Rust code and have it run on Valida.
Check the example repository here. We are working towards more extensive examples and benchmarks in our upcoming release.
“Why is rust support for Valida taking a longer time versus other zkVMs?”
At Lita, we believe that using traditional hardware based ISA to develop zkVM software is not the optimal approach. Unlike other zkVMs such as SP1 and Risc Zero, which leverage the RISC-V ISA and benefit from existing compiler toolchains for native Rust support, our design approach is different.
Our instruction set architecture (ISA) for Valida is built from the ground up and specifically optimized for end-to-end zero-knowledge proof generation. Using a custom ISA meant we needed to build a compiler toolchain from scratch to support high-level programming languages like Rust. Early this year, our compiler team initially focused on C support, achieving industry-leading benchmark results even without pre-compiles. This approach is highly user-friendly, requiring no expertise in AIR from developers.
While this trade-off in compiler compatibility has presented challenges, we are excited that the efforts are beginning to pay off with this release. The path has been more complex, but we believe this to be the superior approach for creating the most performant, energy efficient and user-friendly zkVM.
Read more about our design choices here.
We’re excited that the Valida Rust Alpha Compiler marks a significant step forward for Lita. However, we want to be transparent about some limitations you might encounter:
Currently, exception handling, multi-file compilation, and the complete Rust standard library are not supported; it's reasonable to expect that there may be other undocumented issues as well. Given the potential for the compiler to emit incorrect code, we advise against using the Valida rust compiler toolchain in a production environment at this time. You are however very welcome to try Valida on examples, and even add yours to our collection of examples. Interesting ones might help us stress-test and optimize Valida further.
Read the full 0.4.0-alpha release of the LLVM Valida toolchain by Lita here, which details the full change log, usage instructions and known bugs.
Join our core developer community on Telegram here; your feedback is always welcome to help us continuously improve Valida. Our compiler and cryptography team will be active there to address any questions or concerns you may have.