Hyrax Interactive Protocol
Hyrax is a transformation to the GKR protocol which makes it zero knowledge. The GKR protocol as explained in our GKR Tutorial is not zero knowledge on its own. Recall that in the section about what GKR Proofs look like, we mention that GKR proofs contain the sumcheck messages from the sumcheck protocol performed for each layer of the arithmetic circuit.
Each of these sumcheck messages are the evaluations of a very particular univariate polynomial, constructed based on the data contained within that layer. Therefore, each of these evaluations leak a little bit of information on the data contained within a circuit, and these can be used to construct a system of equations that reveal some information about private inputs to a circuit.
Therefore, in use cases which require a zero knowledge proof of the output of a circuit, we use the Hyrax interactive protocol to transform GKR circuits into a variant which produces a zero knowledge proof. The high-level overview of the protocol is that rather than sending evaluations of the univariates directly, sends Pedersen commitments of these evaluations, and is able to verify these commitments to sumcheck messages by taking advantage of the additive homomorphism of Pedersen commitments.
For the remainder of this chapter we use additive group notation because this is the notation our code in Remainder is written in.
Background
The Hyrax protocol is defined over any cyclic group of prime order. We break down what this means below.
- Group: A group is an algebraic structure which is closed under a chosen binary operation, usually called the group operation. This means that if and , and the group operation of is denoted by , . Additionally, satisfies the following properties:
- Associativity: .
- Identity such that .
- Inverses such that .
- Order: The number of elements in a group, denoted by .
- Finite: is finite if it has finitely many elements.
- Cyclic: is cyclic if it contains a generator such that such that . In this case, we say that is generated by , meaning by composing with itself times, where and , we can enumerate every element of
- Prime Order: A group has prime order if is prime.
In Remainder, we instantiate Hyrax over an elliptic curve group, denoted below as , with prime order (defined by the trait PrimeOrderCurve).
Elliptic curve consists of points in a finite field satisfying the equation . An elliptic curve group's binary operation is "point addition," which we denote with . If we add to itself times, we call this operation "scalar multiplication," denoted by . While we won't go into full detail on elliptic curves in this tutorial, we define some operations that will make it easier to follow the rest of this section and the codebase. For more information on elliptic curves, you can read these notes on an introduction to elliptic curves.
-
Base Field: If , is defined by coordinates on a plane (either two or three, depending on the notation being used as explained below). Each of the coordinates of belong to the base field, which we denote as For example, if , then .
-
Scalar Field: The scalar field is the field , where , whose equivalence classes are the integers In other words, because is cyclic, it contains a generator , for some
-
Group Element: A group element is a point on the coordinate plane, and can be represented in many ways. We present the three types of representations used in the Remainder codebase below:
- Affine Coordinates: Affine coordinates are elliptic curve points represented in the traditional 2D plane, and are denoted as .
- Projective Coordinates: Projective coordinates are points on the projective plane, represented by where each point is the value in the appropriate dimension. To convert an affine coordinate to its projective coordinates, simply multiply each coordinate by some element to get . For every affine coordinate, there is a class of projective coordinates that define the same point. To go from a projective coordinate to its equivalent affine coordinate, the value is simply .
- Jacobian Coordinates: A jacobian coordinate represents the affine coordinate .
-
Point at Infinity: Note that it is not possible to define the appropriate affine coordinate corresponding to a projective coordinate if This is exactly the point at infinity, represented by the point .
Roadmap
For the rest of this chapter, we will first cover the Hyrax primitives, which allows us to prove properties of different blinded Pedersen commitments, such as proving that two commitments which look different (are different group elements) commit to the same message without having to open the commitment, or that the prover knows the message used to produce a commitment without having to open the commitment. We then move on to more complex proofs over Pedersen commitments such as Proof of Sumcheck and Proof of Claim Aggregation which prove that the prover has properly executed sumcheck or claim aggregation. Finally, we show how the primitives and more intermediate protocols can be put together to produce a valid GKR proof which only consists of blinded Pedersen commitments.