In the context of zero-knowledge proofs and arithmetic circuits, a witness is the confidential data that satisfies the constraint system of a specific computation. It represents the prover's private knowledge—such as a valid input, a secret key, or the weights of a machine learning model—that causes the circuit's logical gates to evaluate to true, without which a valid proof cannot be generated.
Glossary
Witness

What is a Witness?
The secret auxiliary input known only to the prover that satisfies the constraints of a given circuit, such as private model weights or input data in a zkML context.
Unlike public inputs shared with a verifier, the witness remains cryptographically hidden during proof generation. In zkML, the witness typically comprises the private model parameters and the user's input data, enabling a prover to attest to the correctness of an inference via a zkSNARK or zkSTARK without exposing the underlying proprietary model or sensitive information.
Key Characteristics of a Witness
The witness is the secret auxiliary input that satisfies the constraints of an arithmetic circuit, representing the private knowledge the prover must demonstrate without revealing.
Definition and Role
A witness is the secret data known only to the prover that satisfies a given constraint system. It is the assignment of values to all intermediate variables (the 'wire values') in an arithmetic circuit that makes the circuit evaluate correctly. In a zkML context, the witness typically includes the private model weights, the input data, and all intermediate activation values generated during a forward pass. The prover's fundamental task is to generate a proof that they possess a valid witness without disclosing it.
Witness in zkML Inference
When proving a machine learning inference, the witness encodes the entire execution trace. This includes:
- Private Inputs: The user's sensitive data (e.g., a medical image).
- Model Weights: The proprietary parameters of the neural network.
- Intermediate State: The output of every matrix multiplication and activation function. The prover demonstrates that applying the committed model to the committed input yields a specific public output, all while keeping the witness hidden.
Witness Generation
Witness generation is the process of executing the computation to produce the full assignment of wire values. This step is performed by the prover and is typically the most computationally intensive phase of proof generation. The prover runs the actual machine learning model on the input data to calculate every intermediate tensor. These values are then arranged into a vector that satisfies the Rank-1 Constraint System (R1CS) or Plonkish constraint system representing the model's computation.
Witness vs. Instance
In zero-knowledge terminology, the computation's inputs are split into two categories:
- Instance (Public Input): Data known to both the prover and verifier, such as the circuit definition and the claimed output of the inference.
- Witness (Private Input): Data known only to the prover, such as the model weights and the input data. The proof asserts that for the given public instance, there exists a secret witness that satisfies all constraints.
Witness Extension for Lookups
Modern proving systems like Plonk and Halo2 use lookup arguments to optimize non-arithmetic operations. The witness is extended to include entries proving that specific wire values exist within a pre-computed lookup table. For example, an activation function like ReLU can be proven by showing the input-output pair exists in a table of valid ReLU transitions, with the witness containing the necessary sorted and multiplicity data to satisfy the lookup constraint.
Soundness and Witness Extraction
A proof system is knowledge-sound if a valid proof implies the prover actually 'knows' a valid witness. Formally, for any prover that generates a convincing proof, there exists an extractor algorithm that can recover the witness by interacting with the prover's internal state. This property guarantees that a valid proof is not a cryptographic fluke but a certificate of genuine computation. In zkSNARKs, this is often proven via knowledge of exponent assumptions.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technical answers to common questions about the role of the witness in zero-knowledge proof systems, focusing on its application to private model weights and inputs in zkML.
A witness is the secret auxiliary input known only to the prover that satisfies the constraints of a given arithmetic circuit. In the context of zkML, the witness typically consists of the private model weights, the input data, and all intermediate activations generated during a forward pass. The prover's task is to demonstrate knowledge of this witness without revealing its contents, thereby proving that a specific inference was computed correctly on a specific model without exposing the proprietary model or the user's sensitive data. The witness is the 'solution' to the computational puzzle defined by the circuit.
Related Terms
Understanding the witness requires familiarity with the broader cryptographic infrastructure that defines, constrains, and verifies these secret inputs within zero-knowledge machine learning systems.
Constraint System
A set of mathematical equations encoding the valid execution of a computation. The witness is the specific assignment of values that satisfies every constraint in this system. In zkML, the constraint system defines the valid transformations of model weights, and the witness is the actual set of weights and inputs that produce a correct inference. Common formats include Rank-1 Constraint Systems (R1CS) and Plonkish arithmetization.
Arithmetic Circuit
A directed acyclic graph representing a computation as addition and multiplication gates over a finite field. The circuit defines the structure of a valid computation, while the witness provides the concrete values flowing through each wire. In zkML, a model's forward pass is compiled into an arithmetic circuit, and the witness consists of:
- Private model weights
- Input data
- Intermediate activations
- Final output values
Zero-Knowledge Proof (ZKP)
A cryptographic protocol where a prover convinces a verifier of a statement's truth without revealing any information beyond validity. The witness is the secret knowledge the prover possesses that satisfies the statement. In zkML inference, the prover uses the witness (private model weights and input) to generate a proof that the output was computed correctly, without exposing the underlying model architecture or data.
zkSNARK
A Zero-Knowledge Succinct Non-Interactive Argument of Knowledge producing constant-size proofs with fast verification. The 'Argument of Knowledge' property cryptographically guarantees that a valid proof could only be generated by a prover who actually knows a satisfying witness. This knowledge soundness ensures that zkML proofs cannot be forged without access to the genuine model weights and inputs.
Rank-1 Constraint System (R1CS)
A standard format for representing arithmetic circuit satisfiability as a set of quadratic constraints of the form (A·w) ∘ (B·w) = C·w, where w is the witness vector. The witness includes:
- Public inputs and outputs (instance)
- Private intermediate values (witness proper)
- The constant 1 for handling addition with constants R1CS is the foundational constraint format for Groth16 and other early zkSNARK constructions.
Proof Carrying Data (PCD)
A cryptographic primitive enabling a proof that attests to correct execution across multiple computational steps while maintaining a verifiable lineage. In recursive zkML pipelines, each step's witness captures the state transition, and PCD composes these into a single proof. This allows verification that a complex multi-stage model pipeline executed correctly without revealing the intermediate witness values at each stage.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us