# 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="https://2052969365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4jZpZP97P7tNPc6tR9Mf%2Fuploads%2FrcinyiZ0RoE0CWGp5oAe%2FzkPass%20DVR%20App%20compile-time%20pipeline.png?alt=media&#x26;token=8413020c-d372-4026-b6c0-66d526ea8788" 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.
