# Valida zk-VM

## Prerequisites

These instructions assume that you have [installed the toolchain](/lita-documentation/quick-start/installation-and-system-requirements.md) 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`.&#x20;

## 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`:&#x20;

```
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`:&#x20;

```
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 [zk-VM: Advanced Usage](/lita-documentation/advanced-usage-1/zk-vm-advanced-usage.md) for "power user" options for the zk-VM.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lita.gitbook.io/lita-documentation/quick-start/valida-zk-vm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
