# Building Query Engine

## <mark style="color:blue;">Building the DVR Query Engine</mark>

The heart of the DVR application is the query engine, which implements the DVR app. The query engine is designed as a DVR Query language interpreter that runs on the ZKVM directly.

<figure><img src="/files/2NGnLh5wUsz4jlXpUazc" alt="" width="375"><figcaption></figcaption></figure>

1. **DVR Query Engine Codes**\
   The core component, the DVR Query Engine, is programmed in the Rust language. Rust is known for its safety and performance, making it an excellent choice for building reliable and secure systems.
2. **Compilation to Assembly Code**\
   To integrate with the Zero-Knowledge Virtual Machine (ZKVM), the DVR Query Engine is compiled into assembly code. This compilation is done using a specialized set of tools known as the compiler toolchain, which is specifically designed for the ZKVM environment. This ensures that the Query Engine is compatible with the security and operational requirements of the ZKVM.
3. **Build Outputs**\
   After the compilation process, two primary outputs are generated:
   * The **Zero-Knowledge Proof Generator (ZK Proof Generator)**\
     This module is responsible for creating cryptographic proofs that confirm the validity of a query without revealing any underlying data. It is an integral part of the DVR Query Engine.
   * The **Zero-Knowledge Proof Verifier (ZK Proof Verifier)**\
     This is the counterpart to the Proof Generator. It is tasked with checking the validity of the proofs generated by the Proof Generator. The Proof Verifier is included in the `zkpass-client` library, allowing client applications to verify proofs independently.


---

# 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://gl-docs.gitbook.io/zkpass/zkpass-developers-guide/zkpass-modules/dvr/dvr-query/building-query-engine.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.
