Announcing Lita's Valida zkVM & C Compiler

Published on:
Jun 20, 2024
Written by:
Lita Team
Read time:
10 min
Category:
Technical

Lita Team

Announcing Lita's Valida zkVM & C Compiler : The First Step Towards True Universal ZK

HIGHLIGHTS

  • Lita launches alpha release of Valida zero knowledge virtual machine and C Complier, enabling developers to compile, run, prove, and verify C programs on Valid
  • Valida showed promise in initial benchmarks, with multiple orders of magnitude of improvement in proof generation speed and efficiency
  • The LLVM Valida compiler backend lays the groundwork for all LLVM-compatible programming languages to utilize cost-effective, large-scale STARK-based zero knowledge proofs
  • Next up: Solidity, Rust, C++ and other popular programming languages

From day one, Lita has been committed to pushing the performance and usability of zero-knowledge proofs. We are here to make ZK truly universal. This is evident in how we designed Valida - our zero knowledge virtual machine. 

We opted to build Valida from the ground up with a zk-optimized ISA for efficient zero-knowledge proving, and a compiler toolchain that enables any developer to leverage familiar tools and languages to integrate their application with Valida. We believe this to be the superior approach for creating a fast, performant, and truly accessible zkVM. 

Today, we are proud to announce the alpha release of the Valida C Compiler Toolchain. Coupled with the Valida zkVM, developers can now execute and verify programs in Valida. This release represents more than just a technical milestone. It is a strategic advancement towards enabling cost-effective, large-scale applications of zkSTARKs and expanding the range of viable use cases.

Advantages of Lita's Compiler

Lita's compiler utilizes the powerful LLVM infrastructure, enabling the compilation of mainstream programming languages for the Valida zkVM. By adopting a common intermediate representation, we significantly streamline development by requiring only one backend for Valida for multiple frontend languages. This approach offers clear benefits in terms of versatility and coding efficiency.

Valida vs. Other zkVMs: Orders of Magnitude Faster and More Efficient

The C Compiler toolchain and the Valida zkVM will allow developers to run and test programs on our VM. To showcase Valida's capabilities, we benchmarked it against RISC Zero, SP1, and Jolt.

Our performance comparison focused on two key metrics:  User Time (CPU Efficiency) and Wall Clock Time, tested against programs performing SHA-256 and Fibonacci sequence computations.

We are pleased to present evidence that Valida holds significant advantages in both metrics compared to the aforementioned VMs. This superior performance underscores Lita’s promise of delivering industry-leading efficiency and speed.

Valida's performance significantly outshines that of other proving systems in terms of speed
Lita Valida zkVM maximises CUP efficiency
Valida zkVM maximizes CPU efficiency

Detailed reports can be found here.

Metrics Explained

User Time (CPU Efficiency) : The amount of computer time expended by the program code. For instance, if a program uses 5 cores for 5 seconds each, the user time is 25 seconds (5 cores x 5 seconds). User time is a crucial indicator of the energy consumed by the computation.

Wall Clock Time: This measures the actual elapsed time from the start to the end of the computation. In the same example, the wall clock time would be 5 seconds, regardless of the number of cores used. Wall clock time reflects the waiting time for users.

In summary, wall clock time focuses on user waiting time, while user time emphasizes the energy and cost efficiency of running the computation. Lowering both metrics benefits users by providing faster results and reducing overheads.

Current Limitations & Future Developments 

As part of our commitment to continuous improvement, it’s important to note that Standard C is not yet fully supported in the current alpha release of our C Compiler Toolchain. There are some known issues within the Valida backend for C, which our team is actively working to resolve  with minimal expected impact on Valida’s current performance. For a detailed summary of these known issues and limitations, please refer to the release notes accompanying this release.

Valida operates as a bare metal computing environment similar to those found in minimal embedded systems, running without an operating system or memory protection. This offers no safeguards against issues like segmentation faults. To function in this environment, programs often require modifications. Not all standard library functions (libc) are compatible with bare metal environments, especially those that involve system calls. However, LLVM’s libc can compile for bare metal by excluding functions that make system calls. 

Get Started Today

Developers can dive in by experimenting with the toolchain, providing valuable feedback, and contributing to its ongoing development. Get started with the C Compiler Toolchain today by visiting our GitHub repo for documentation and resources.

________________________________________

Appendix

Methodology Overview

Here’s an overview of the scope of benchmarks against different proving systems and test programs.

A 3-way Comparison 

  • Valida prover in single-threaded mode
  • Valida prover in multi-threaded mode
  • RISC Zero, SP1, and Jolt provers in multi-threaded mode 

Programs Tested:

  • Iterative implementation of the Fibonacci sequence
  • SHA-256

Detailed methodologies are available here.

You may also like

Custom ISA: Achieving Ultimate Efficiency in zk-Proving

June 19, 2024

Custom ISA: Achieving Ultimate Efficiency in zk-Proving

Exploring zk-VM Design Trade-offs

June 12, 2024

Exploring zk-VM Design Trade-offs

What is zkVM?

May 26, 2024

What is zkVM?