Skip to content
AntChainOpenLabsPublic

About

A RISC-V zkVM for real-time proving on consumer GPUs.

Resources

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

zkDTVM

zkDTVM is an open-source, general-purpose RISC-V verifiable virtual machine (zkVM) developed by AntChain OpenLabs. It proves the execution of RV32IM programs—with a Rust SDK for ordinary Rust applications—using only standard hashing, producing proofs small enough to ship anywhere and fast enough for real-time workloads, from Ethereum block proving to light clients, cross-chain verification, and verifiable off-chain computation.

OpenLabs Website · GitHub · X

The zkDTVM technical whitepaper (PDF) describes the proof system and reports results for 10,000 Ethereum mainnet blocks. On one GeForce RTX 5090, the 99th-percentile proving time was 8.26 seconds.


zkDTVM proves the execution of programs compiled for its RV32IM guest ABI (the 1.0.0-alpha unaudited research release provides succinct verifiable execution without witness hiding). Each proof is a compact, self-contained Seal that anyone can check against a single trusted 32-byte SealKey using the Rust SDK, a standalone command-line verifier, or a dependency-free WebAssembly module.

Highlights

  • Standard hashing. The PCS commitments, Fiat–Shamir transcripts, and their recursive verification use BLAKE3-256 throughout Hart → Bridge → Fold → Apex → Seal. This proof stack uses no Poseidon. Guest precompiles provide Keccak-256 and SHA-256, and public output uses SHA-256 by default or BLAKE3 when selected.
  • 128-bit security target. Protocol parameters are exported directly from the prover and evaluated with Ethereum's soundcalc. See the Security Analysis.
  • Small final proofs. Every terminal mode uses the same bare Seal format with a ≤ 300,000 B decimal wire limit, without a trusted setup or SNARK wrapper.
  • One key per program. Verifiers pin one 32-byte SealKey for each guest ELF and output-hash choice, using the shared Seal AIR catalog embedded in the verifier binary.
  • Portable verification. The verifier is no_std + alloc and depends on no prover code. It ships as a Rust library, a native binary, and a zero-import WebAssembly module.
  • CPU or 1–2 GPUs. Proving runs on multi-core CPUs or on one or two NVIDIA CUDA GPUs on Linux x86-64.
Property Reference Value
Guest ISA & ABI RV32IM (Guest ABI, 60 syscalls: 7 core + 53 precompiles, and 10 host witness oracles)
Field & proof hashing KoalaBear ($p = 2^{31} - 2^{24} + 1$) / $\mathbb{F}_{p^5}$, with BLAKE3-256 PCS and transcripts
Soundness model 128-bit classical target (128.06 bits joint list-decoding bound via soundcalc)
Bare .seal size ≤ 300,000 B wire limit across all four modes (~205–250 KB observed; Ethereum target ≤ 285,000 B, where 1 KB = 1,000 B)
Trusted key size 32 bytes (SealKey, one key per guest ELF and output hash)
WebAssembly verifier Under 200 KB (~183 KB wasm-release build), zero external imports
GPU proving 1 or 2 NVIDIA CUDA GPUs on Linux x86-64 (tested on RTX 5090; no P2P link required)

cargo xtask seal-modes exercises and verifies all four terminal modes (Direct, Single, Pair, and Multi) on a small SDK test guest. Across all four modes and measured workloads, serialized bare Seals fall within roughly 205–250 KB (1 KB = 1,000 B), meeting both the ≤ 285,000 B Ethereum target and the 300,000 B wire ceiling; exact byte counts vary slightly with active tables and build revision. A receipt also carries public output and unauthenticated cycle metadata.

How It Works

zkDTVM uses the KoalaBear prime field ($p = 2^{31} - 2^{24} + 1$), its degree-5 extension, multilinear sumcheck, and WHIR polynomial commitments. Hart replays execution windows in parallel and packs rows by chip family. It checks registers with Twist, mutable RAM with an address-sorted trace, and program code with a static lookup table.

Bridge verifies Hart proofs in fixed recursion circuits and produces regional certificates. Fold and Apex merge certificates as needed. These inner stages use Compact WHIR to keep openings small and fold LogUp accumulation into the main sumcheck. The terminal Seal uses Stacked WHIR with LogUp-GKR to reduce the transmitted proof size.

The topology planner chooses the region layout, recursion tree, and terminal mode under memory and proof-size limits. It can emit Direct, Single, Pair, or Multi Seals.

See Architecture for the full pipeline, key derivation, and proof format.

Quick Start

Install the zkdtvm CLI from the repository root with the pinned Rust toolchain (1.94.0, see rust-toolchain.toml), then check the guest build environment (Clang 14 and the isolated RISC-V toolchain):

cargo install --locked --path crates/tooling/cli
zkdtvm setup --check    # install Clang 14 separately and use `zkdtvm setup` for missing guest Rust components

Local proving on Linux x86-64 also needs the bundled rv2x86 translator (see the User Guide). zkdtvm build, key, execute, and verify work without it.

From a guest package directory such as examples/fibonacci/program, the core workflow is five commands:

Command Purpose
zkdtvm build --elf-name guest.elf --output-directory ./elf Compile the Rust guest into a deterministic RV32IM ELF.
zkdtvm key --elf ./elf/guest.elf --uri > guest.key Derive the trusted 32-byte SealKey (zkdt:...).
zkdtvm execute --elf ./elf/guest.elf --u32 100 --public-out expected.bin Run the ELF in the RV32 interpreter and inspect cycles and public output.
zkdtvm prove --cpu --elf ./elf/guest.elf --u32 100 -o guest.seal --public-out guest.public Generate and self-check a Seal proof (use --cuda with --features cuda).
zkdtvm verify --key guest.key --seal guest.seal --public expected.bin Verify a bare .seal or receipt against a trusted SealKey.

To build the Fibonacci guest and prove it on CPU, run these commands from the repository root:

(cd examples/fibonacci/program && zkdtvm build --elf-name fibonacci.elf --output-directory ../elf)
cargo run --release --locked -p fibonacci-host --bin fibonacci-cpu -- 100

Always derive or obtain guest.key from an independent trusted build. Never trust key material carried alongside an unverified proof.

Examples

The examples include documented inputs and instructions for building each guest ELF before running its host.

Example What it demonstrates Command
Fibonacci One guest ELF across interpreter execution, CPU proving, AOT execution, and CUDA proving cargo run --release --locked -p fibonacci-host --bin fibonacci-cpu -- 100
Batch settlement Order-batch commitment using UINT256_MUL, SHA_EXTEND, and SHA_COMPRESS syscalls and a patched sha3::Keccak256 cargo run --release --locked -p batch-settlement-host --bin batch-cpu
Tendermint Offline Tendermint 0.40.4 light-client update with a validator-set change, bound to a checkpoint and policy cargo run --release --locked -p tendermint-host --bin tendermint-cpu
SDK workflows CUDA proving of a caller-supplied ELF, receipt persistence, and offline verification cargo run --release --locked -p sdk-workflows --bin verify_receipt -- <seal.key> <proof.receipt>

Documentation

Document Contents
User Guide Requirements, installation, CLI, Rust SDK, guest SDK, WebAssembly verifier, and walkthroughs
Architecture Proving pipeline, recursion stages and terminal modes, keys and proof format, crate layout
Security Analysis Protocol parameters, soundness bounds, and reproduction steps
Security Policy Verification trust contract, deployment hardening, and vulnerability reporting
Contributing Local checks and contribution guidelines
Benchmarks Standalone subsystem benchmarks measuring end-to-end proving through terminal Seal generation
Changelog Release notes

Security and Status

zkDTVM is in alpha and provides succinct verifiable execution without witness hiding. Its soundness model targets 128-bit classical security across all proof stages; parameters and results are documented in the Security Analysis.

Warning

zkDTVM's circuits, prover, and verifiers have not undergone a formal third-party security audit. It is intended for research and evaluation; do not use zkDTVM in production.

Future Work

RV64IM

Guests currently target RV32IM. Moving to RV64IM would:

  • run 64-bit integer arithmetic and 64-bit-lane algorithms such as Keccak as native word-sized instructions instead of pairs of 32-bit operations, reducing guest cycle counts for typical Rust and blockchain workloads;
  • lift the current guest address range (just under 2 GiB) for memory-heavy programs;
  • follow the broader RISC-V and zkVM ecosystem toward 64-bit targets.

The main design work is representing 64-bit registers and memory words over the 31-bit KoalaBear field without inflating chip widths or lookup traffic.

Keccak Across the Proof Stack

Shortly before this release was finalized, the Ethereum Foundation recommended standardizing Ethereum's proof systems on the Keccak family. This release had already been built and validated on BLAKE3-256—a widely deployed standard hash—and we share and respect the Foundation's commitment to the most conservative, most heavily analyzed choice. We plan to move commitments, transcripts, and in-circuit hashing from BLAKE3-256 to Keccak while keeping proving performance at its current level.

Formal Verification and Audit

Today, zkDTVM's correctness rests on tests, end-to-end proof verification, and the soundcalc model. None of these proves that the constraints themselves are right. We plan to:

  • formally verify in Lean that each execution chip constrains exactly the RISC-V semantics it claims, against a formal ISA model, so that only correct executions can be proved and every correct execution can be;
  • formally verify the recursion circuits and the standalone verifier against the protocol specification, including the lookup and modular-wraparound bounds;
  • commission an independent third-party audit of the circuits, prover, verifiers, and security analysis.

Together, these are the prerequisites for recommending zkDTVM for production use.

Zero Knowledge

zkDTVM currently targets succinct verifiable computation: a Seal proves that a program ran correctly, but it is not designed to hide the program's private inputs or intermediate state. We plan to add witness hiding so that zkDTVM can also serve privacy-preserving applications.

Acknowledgments

  • Plonky3: foundational finite-field and polynomial IOP toolkit; the KoalaBear field implementation used by zkDTVM is adapted from it.
  • RISC Zero: pioneered the Rust-to-RISC-V zkVM target and guest runtime model, with adapted guest components used in zkDTVM.
  • Valida: inspiration for the cross-table lookup interface and column-layout pattern, including the adapted AlignedBorrow derive macro.
  • SP1: inspiration for parts of the RISC-V and precompile chip designs, with adapted guest interface and precompile conventions.
  • soundcalc: the Ethereum Foundation's soundness calculator used for zkDTVM's security analysis.

Adapted third-party code keeps its original copyright and license notices in the corresponding source files.

License

Unless otherwise noted, zkDTVM is dual-licensed under either MIT or Apache-2.0, at your option. Third-party code keeps its original copyright notices and license terms.

About

A RISC-V zkVM for real-time proving on consumer GPUs.

Resources

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages