The Nexus 2.0 zkVM
The Nexus zkVM (zero-knowledge virtual machine) is a modular, extensible, open-source, highly-parallelized, prover-optimized, contributor-friendly, zkVM written in Rust, focused on performance and security.
Nexus zkVM v0.2.4 (opens in a new tab) is the current stable release, implementing the zkVM component of the Nexus 2.0 system.
Proving Computation
The Nexus zkVM can prove any computation. For a Rust program:
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]
use nexus_rt::println;
fn fib(n: u32) -> u32 {
match n {
0 => 0,
1 => 1,
_ => fib(n - 1) + fib(n - 2),
}
}
#[nexus_rt::main]
fn main() {
let n = 7;
let result = fib(n);
assert_eq!(result, 13);
println!("fib({}) = {}", n, result);
}
Generating a zero-knowledge proof of its correct execution is as easy as running:
cargo nexus prove
And verification is as simple as running:
cargo nexus verify
To get started with the Nexus zkVM, check out the SDK Quick Start guide or the CLI Quick Start guide.
Nexus is in an experimental stage and is not currently recommended for production use. The system has low performance and high costs. Many future upgrades are expected.
Architecture and Science
The ethos of the Nexus project is a commitment to open and transparent science, engineering, and evaluation.
For an in-depth look at the science behind the Nexus zkVM and the Nexus network, see the Nexus Whitepaper (opens in a new tab).
Core Components
The Nexus zkVM is designed to be modular and extensible, with highly optimized components:
- The Nexus Prover: A prover enabling highly efficient Incrementally Verifiable Computation (IVC) through the first production-grade implementations of folding schemes, like the CycleFold (opens in a new tab)-variants of Nova (opens in a new tab), SuperNova (opens in a new tab), and HyperNova (opens in a new tab).
- The Nexus Virtual Machine (NVM): A minimal, general-purpose virtual machine building off of RISC-V, designed to optimize prover performance.
- The Nexus Proof Compression Mechanism: A proof compression sequence of recursive SNARKs that compresses proofs with each recursive application of a SNARK. Nexus (Nova) proofs are inherently large, but can be compressed through recursion down to a few bytes.
Each component of the Nexus zkVM has been carefully chosen or designed from the ground up and then implemented by the Nexus team (opens in a new tab) to maximize security, performance, modularity, and extensibility.
As a consequence of that approach, the Nexus zkVM is architected to support new theoretical developments led by our research team, as well as tooling to accelerate deploying the zkVM for a variety of use cases:
- Proving Schemes: In addition to the Nova family of folding schemes, the Nexus Prover can be extended with new proving scheme constructions as the state-of-the-art continues to advance.
- Precompiles: Precompiles are custom extensions planned for the NVM instruction set, supporting common operations like cryptographic hashing (SHA-256 or keccak256) and matrix multiplication, that developers can use to accelerate specific computations. Nexus precompiles are exactly like Ethereum precompiles, but in the context of zkVMs. Developers will be able to extend the zkVM with their own custom precompiles, as well as import other developer's precompiles. This is possible due to non-uniform IVC like SuperNova (opens in a new tab).
- Language Support: As the NVM builds off the RISC-V ISA, the zkVM can run programs written in any high-level language (e.g. Rust, C++, etc.), including emulation with minimal overhead of many common Instruction Set Architectures (ISA) such as the EVM, Wasm, and RISC-V itself.
- Targeted Compilation: The zkVM can be targeted by safe and correct compiler tooling that compiles various high-level languages and any other ISAs to the NVM, with dedicated support for precompiles and optimizations designed to maximize prover performance while maintaining correctness.
The zkVM aims to offer developers out-of-the-box prover performance and security, designed to power production-grade applications. See the Roadmap for more on the future of the zkVM.
Proving Architectures
The Nexus zkVM turns programs into proofs, but the computational work of executing and proving the zkVM must be implemented by a proving architecture.
The Nexus zkVM design is compatible with a variety of proving architectures, from sequential execution on your laptop all the way up to the Nexus network, a globally-distributed proving network under active development.
See the Nexus network overview for more.
The Nexus Ethos: Secure, Open Science, Open Source
We believe a zkVM's main purpose is to provide an efficient proving mechanism, without compromising on security and correctness. Every component of a zkVM should be powered by open-source, peer-reviewed science and well-understood cryptographic components, with careful analysis of security and performance.
The Nexus zkVM features no code obfuscation, no proprietary components, and no closed-source code.
Modular and Extensible
The Nexus zkVM is designed to be modular and extensible, with highly optimized isolated components. With thoroughly analyzed sensible defaults (provers, compilers, etc.) that will work for most users, developers can feel confident in the security and performance of the zkVM.
That said, the Nexus zkVM is specifically designed to be extensible. Users can add support for new languages, new ISAs, new precompiles, and new provers, and import other developer's precompiles, with no vendor lock-in.