Polynomial Commitment Scheme
A polynomial commitment scheme (PCS) allows a prover to commit to a polynomial and later prove its evaluations at points chosen by the verifier. The verifier can then check that the evaluations are consistent with the committed polynomial. It consists of the following three algorithms:- : Given an upper bound on the degree, it outputs public parameters used to commit to polynomials of degree less than . For STARKs, the public parameters include the hash functions used for the Merkle commitment scheme and the FRI protocol parameters.
- : Takes public parameters and a polynomial of degree , and outputs a commitment to the polynomial. For STARKs, is the root of the Merkle tree which commits to the evaluations of the polynomial on the evaluation domain.
- : An interactive protocol where the prover convinces the verifier that . The verifier outputs 1 (accept) or 0 (reject). For STARKs, this protocol is based on FRI. The verifier will ask the prover to open the polynomial (committed using the Merkle tree) at point . The prover will send the opening and define the quotient:
- The verifier first receives a Merkle commitment to the evaluations of the original polynomial .
- The verifier samples a circle point and requests the evaluation from the prover.
- The prover sends the purported value , and then both prover and verifier engage in the FRI protocol on the quotient: Here, is the linear polynomial interpolating and , while vanishes at and its conjugate . As in the univariate case, if is “close” to a polynomial, then the verifier is convinced that the evaluation claim is correct, i.e., that .
Out of Domain Sampling
Out-of-domain sampling relates to the notion of “closeness” described in the FRI section. Informally, the FRI protocol tests whether a function provided by the prover is “close” to some bounded degree polynomial. There are two notions of “closeness”:- Unique Decoding Regime: We operate in this regime if there is at most a single polynomial which is “close” to the function provided by the prover. If the function is “close” to a single polynomial, then we can infer that the function represents that unique polynomial.
- List Decoding Regime: We operate in this regime if there is a list of polynomials which are “close” to the function provided by the prover. In this case, since the function can be “close” to a list of polynomials, we cannot be sure that it represents a unique polynomial.
Proof of Work
The key idea is that rather than increasing the number of verifier queries, we can increase the cost of generating a false proof by a malicious prover by using proof of work or grinding. We add an additional requirement to the FRI protocol: following all the commitments made by the prover, the prover must find a 64-bit nonce that, when hashed together with the state of the hash chain, results in a required number of leading zeros. The number of leading zeros defines a certain amount of work that the prover must perform before generating the randomness representing the queries. As a result, a malicious prover that attempts to generate favorable queries will need to repeat the grinding process every time a commitment is changed. On the other hand, an honest prover only needs to perform the grinding process once. This is similar to the grinding performed on many blockchains. The nonce found by the prover is sent to the verifier as part of the proof, and in turn the verifier checks its consistency with the state of the hash chain by running the hash function once. The required number of leading zeros is configured by thepow_bits parameter.
This effectively reduces the computational power of the cheating prover while only slightly increasing the running time of the honest prover. This is because the honest prover needs to solve the proof-of-work once, while a cheating prover, during the long process of trying to find a false proof, would need to solve many different instances of the proof-of-work.