Lita Docs
  • Introduction
    • Getting Started
  • Quick Start
    • Tutorial: Rust via Docker
    • Installation & System Requirements
    • Valida Compiler Toolchain
      • Rust Usage
      • C Usage
      • WASM Usage
      • Rust API
      • Client-side API
    • Valida zk-VM
  • ADVANCED USAGE
    • zk-VM: Advanced Usage
    • Using the Rust Toolchain
    • Using LLVM libc
  • Architecture
    • Overview
    • Proving System: Plonky3
      • Future Directions
    • Valida zk-VM
      • Technical Design: VM
      • Technical Design: Prover
      • GitHub Link
    • LLVM-Valida Compiler
      • Technical Design
      • GitHub Link
    • Benchmarks
      • Fibonacci (vs. RISC Zero)
      • Fibonacci (vs. SP1)
      • Fibonacci (vs. Jolt)
      • Fibonacci (Rust vs. C)
      • SHA-256 (vs. RISC Zero)
      • SHA-256 (vs. SP1)
      • SHA-256 (vs. Jolt)
  • Core Concepts
    • zk-VM
    • Proofs: Classical, Probabilistic, Succinct, and ZK
    • Evaluating zk-VMs
    • ZK-VM Design Tradeoffs
    • Valida Design Considerations
  • Contributing
    • Overview
    • Early Access Program
Powered by GitBook
On this page
  • Prerequisites
  • Executing programs
  • Executing (input from standard in)
  • Executing (input from a file)
  • Proving and verifying executions
  • Proving (input from standard in)
  • Proving (input from a file)
  • Verifying a proof
  • Advanced usage
  1. Quick Start

Valida zk-VM

PreviousClient-side APINextzk-VM: Advanced Usage

Last updated 3 months ago

Prerequisites

These instructions assume that you have and produced or obtained a Valida executable, such as by using the compiler toolchain following the instructions above. They assume that you are in the Valida Docker image shell or the valida-shell.

Executing programs

Executing (input from standard in)

To execute a program, where the path to the program executable file is $PROGRAM, and the path to write the output to is $OUTPUT:

valida run --fast $PROGRAM $OUTPUT

The input to the program will be read from stdin. The output of the program will also be written to stdout, in addition to $OUTPUT.

Executing (input from a file)

To execute a program, where the path to the program executable file is $PROGRAM, the path to write the output to is $OUTPUT, and the path to read the input from is $INPUT:

valida run --fast $PROGRAM $OUTPUT $INPUT

The output of the program will also be written to stdout, in addition to $OUTPUT.

Proving and verifying executions

Proving (input from standard in)

To prove an execution of a program, where the path to the program executable file is $PROGRAM, and the path to write the proof file to is $PROOF:

valida prove $PROGRAM $PROOF

The input to the program will be read from stdin. The output of the program will be written to stdout.

Proving (input from a file)

To prove an execution of a program, where the path to the program executable file is $PROGRAM, the path to the input file is $INPUT, and the path to write the proof file to is $PROOF:

valida prove $PROGRAM $PROOF $INPUT

The output will be written to stdout.

Verifying a proof

To verify a proof, where the path to the program executable file is $PROGRAM, the path to a file containing the claimed output is $OUTPUT, and the path to the proof file is $PROOF:

valida verify $PROGRAM $PROOF $OUTPUT

The result (success or an error message) will be written to stdout. The above command verifies the claim that there exists some input which, when provided to $PROGRAM, results in the program halting with output $OUTPUT. It verifies the claim by checking the provided proof, $PROOF.

Advanced usage

See for "power user" options for the zk-VM.

installed the toolchain
zk-VM: Advanced Usage