# Polynomial

A polynomial is a mathematical expression made up of variables and coefficients, combined using addition, subtraction, and multiplication, where the variables are raised to non-negative integer powers. For example, something like $$P(x)=3x2+5x+2$$ is a polynomial. In zero-knowledge proofs, these polynomials are typically defined over finite fields (a special kind of number system used in cryptography), which makes them well-suited for computation and security.

This chapter would be concerned with just two classifications of polynomials.&#x20;

While you might expect polynomials to be just math tools, it's interesting that multilinear polynomials can make proofs more efficient for multi-variable problems, like verifying complex transactions, by leveraging their structure to reduce computation time.

### Univariate Polynomials

Univariate polynomials, which have just one variable, are a backbone of zero-knowledge proofs, especially in zk-SNARKs. These proofs transform a computation into a single polynomial, like turning a math problem into a simple equation with one unknown, x. This makes it easier to check if the computation is correct without revealing the details, using a method called the Quadratic Arithmetic Program (QAP). For example, in zk-SNARKs, we check if this polynomial evaluates to zero at a random point, ensuring the computation holds without showing the inputs.

### Multilinear Polynomials

Multilinear polynomials, which are linear in each of their variables (like P(x, y) = x + y + x\*y), are important when dealing with computations that have multiple inputs, such as checking if two numbers multiply to a certain result. They help in proof systems where we need to prove something about these multiple inputs efficiently, without revealing them. For instance, a scheme called Zeromorph uses them to commit to and prove evaluations of these polynomials in a zero-knowledge way, making proofs faster for certain tasks.

### Univariate and Multilinear Polynomials in Zero-Knowledge Proofs

Zero-knowledge proofs (ZK proofs) are cryptographic protocols that allow a prover to demonstrate the validity of a statement without revealing any additional information, a concept pivotal for privacy and scalability in applications like blockchain technology. Within this domain, polynomials serve as fundamental mathematical constructs, enabling the design of efficient and secure proof systems. This note explores the roles of univariate and multilinear polynomials in ZK proofs, providing a comprehensive overview for researchers, developers, and enthusiasts.

**Univariate Polynomials: The Backbone of zk-SNARKs**

Univariate polynomials, defined as polynomials with a single variable, are central to many ZK proof systems, particularly zero-knowledge succinct non-interactive arguments of knowledge (zk-SNARKs). These polynomials are instrumental in the process of arithmetization, where a computation—often represented as a circuit—is transformed into a system of polynomial equations and subsequently combined into a single univariate polynomial using techniques such as the Quadratic Arithmetic Program (QAP).

In the QAP framework, the circuit is encoded by three polynomials: L(x), R(x), and O(x), which correspond to the left input, right input, and output wires of the circuit's gates, respectively. The verification process involves checking if the polynomial H(x) = L(x) \* R(x) - O(x) lies within the span of other polynomials that encode the circuit's constraints. This is achieved by evaluating H(x) at a random point and verifying if it satisfies specific conditions, ensuring the computation is correct without revealing the inputs. This approach leverages the efficiency of univariate polynomial evaluations and commitments, making verification both straightforward and computationally feasible.

For example, in zk-SNARKs, the prover commits to the polynomial and later reveals its evaluation at certain points, a process facilitated by polynomial commitment schemes like the Kate-Zaverucha-Goldberg (KZG) commitment scheme ([Understanding Zero-Knowledge Proofs: Part 4— Polynomial Commitments](https://medium.com/@bhaskark2/understanding-zero-knowledge-proofs-part-4-polynomial-commitments-e6e2a6a5e5e8)). This efficiency is crucial for applications requiring succinct proofs, such as privacy-preserving cryptocurrencies.

**Multilinear Polynomials: Handling Multiple Variables Efficiently**

Multilinear polynomials, defined as polynomials that are linear in each of their variables (e.g., P(x, y) = a*x + b*y + c*x*y + d), play a significant role in ZK proofs when dealing with computations involving multiple inputs. These polynomials are particularly useful for representing functions of multiple variables, a common scenario in complex computations such as verifying the outcome of multi-party interactions or evaluating logical operations across several inputs.

The structure of multilinear polynomials allows for efficient evaluation techniques, such as the sum-over-subsets method, which is advantageous in proof systems where the prover must demonstrate that a function evaluates to a specific value without revealing the inputs. This efficiency stems from the fact that multilinear polynomials have a degree of at most one in each variable, enabling fast computation and verification, especially in protocols requiring evaluations at multiple points.

A notable application is found in the "Zeromorph: Zero-Knowledge Multilinear-Evaluation Proofs from Homomorphic Univariate Commitments" paper ([Zeromorph: Zero-Knowledge Multilinear-Evaluation Proofs from Homomorphic Univariate Commitments](https://eprint.iacr.org/2023/917)), which introduces a scheme to commit to multilinear polynomials and prove their evaluations in a zero-knowledge manner. This scheme relies on homomorphic univariate commitments and a protocol to ensure committed polynomials satisfy public degree bounds, achieving exponential improvements in prover costs for zero-knowledge evaluation proofs. For an n-linear polynomial, the instantiation with a hiding version of KZG commitments results in a prover performing only n + 5 extra first-group operations to achieve zero-knowledge, highlighting the practical benefits of multilinear polynomials in specific ZK proof systems.

Another context is explored in "Zero-Knowledge for Multivariate Polynomials" ([Zero-Knowledge for Multivariate Polynomials](https://link.springer.com/chapter/10.1007/978-3-642-33481-8_11?error=cookies_not_supported\&code=3f5ed8ea-60b8-4db4-bfaf-96c7c43993d4)), which extends zero-knowledge arguments to systems of multivariate polynomials, including multilinear ones, using techniques like polarization identities and cut-and-choose methods. This work demonstrates that multilinear polynomials can be leveraged for efficient zero-knowledge proofs, particularly for sparse or dense polynomial systems, offering flexibility in proof design.

**Comparative Analysis and Practical Implications**

To better understand the roles of univariate and multilinear polynomials, consider the following comparison:

| **Aspect**              | **Univariate Polynomials**                                   | **Multilinear Polynomials**                                                   |
| ----------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| **Definition**          | Polynomial with one variable, e.g., P(x) = x^2 + 2x + 1      | Polynomial linear in each variable, e.g., P(x, y) = x + y + x\*y              |
| **Primary Use in ZK**   | Represent entire computation in zk-SNARKs via QAP            | Represent functions of multiple variables, efficient for multi-input proofs   |
| **Efficiency**          | Efficient for single polynomial evaluation and verification  | Efficient for evaluating at multiple points, especially with sum-over-subsets |
| **Example Application** | Verification in zk-SNARKs, checking H(x) = 0 at random point | Proving evaluations in Zeromorph, handling multi-variable functions           |
| **Commitment Schemes**  | Often use KZG for univariate commitments                     | Can use homomorphic univariate commitments for multilinear evaluations        |

This table illustrates that while univariate polynomials are suited for representing and verifying the entire computation in a unified form, multilinear polynomials excel in handling computations with multiple variables, offering efficiency in specific proof systems. The choice between them depends on the nature of the computation and the proof system's design goals, such as proof size, verification time, and prover cost.

An unexpected detail is the way multilinear polynomials can enhance efficiency for multi-variable problems, such as verifying complex transactions in blockchain applications, by leveraging their structure to reduce computation time, as seen in schemes like Zeromorph. This is particularly relevant in scenarios where traditional univariate approaches might be less efficient due to the need to flatten multiple variables into a single polynomial.

Both univariate and multilinear polynomials are indispensable in the construction of ZK proofs, each serving distinct yet complementary roles. Univariate polynomials facilitate the representation of entire computations in a single polynomial, streamlining verification processes, as seen in standard zk-SNARKs. Multilinear polynomials, on the other hand, are adept at handling functions with multiple variables, leading to efficient proof systems for specific types of computations, as demonstrated in advanced schemes like Zeromorph.

Future research could explore hybrid approaches that combine the strengths of both, potentially leading to more versatile and efficient ZK proof systems. Understanding these polynomials' roles is crucial for advancing the field, ensuring privacy, and enhancing scalability in cryptographic applications.

[Univariate Polynomial RUST Implementation](https://github.com/developeruche/cryptography-n-zk-research/blob/main/polynomial/src/univariant.rs)

[Multilinear Polynomial RUST Implementation](https://github.com/developeruche/cryptography-n-zk-research/blob/main/polynomial/src/multilinear.rs)
