Univariate Polynomial Grand Sum
Last updated
Last updated
An intuitive example of modular arithmetic from our daily life is the "clock arithmetic". When we see "19:00" boarding time on a boarding pass, we know that it corresponds to "7" on the clock face. Formally, in this case we perform the modular reduction by the modulus 12:
because the clock face only has twelve hours marked on it.
An integer is an -th root of unity modulo if
In other words, "wraps around" due to modular reduction to yield exactly . A particular case is when no integers smaller than yield modulo . In this case, is called a primitive root of unity: for any .
Let's observe a finite field of order : . Let's see that and are the 3rd roots of unity in such a field:
, so 2 is a 3rd root of unity modulo 7.
, so 4 is another 3rd root of unity modulo 7.
Proof:
Expanding the right hand side, we get:
Let's see how we can take advantage of the sum of all roots of unity being zero when applied to the proof of solvency.
The desired commitment scheme for Summa should have the following properties:
Committing to the total liabilities of the Custodian that is the sum of all user balances;
Allowing to publicly reveal the total liabilities without revealing any information about user balances;
Allowing to prove the individual user inclusion into the commitment without revealing any information about other user balances;
Preserving the user privacy and hiding the user data (namely the user cryptocurrency balances);
Outperform the Merkle sum tree in both commitment phase and proving phase.
We will demonstrate how a polynomial commitment can be used to achieve all of these properties.
We can call it a user balance polynomial. It is quite easy to construct such a polynomial using the Lagrange interpolation. The formula for the polynomial that interpolates these data points is:
Therefore, the grand sum of the user balances is simply the constant coefficient of the polynomial times the number of users:
itself is a root of unity, too, and is called a trivial root of unity.
Let's consider a finite field that has -th roots of unity. Let be a primitive -th root of unity in , which means and no smaller positive power of equals .
The -th roots of unity in are .
Claim: (the sum of all the roots of unity in a finite field is equal to zero).
Consider the sum . We can multiply by , noting that so that such a multiplication preserves the equality:
Notice that if we were to expand further, every term except and would cancel out:
Since is a primitive -th root of unity, . So, . Therefore:
If the product of two factors is zero, at least one of them must be zero. We already established that , thus must be zero: . Therefore,
Let's also check it on our previous toy example of and : .
Let's consider a polynomial that evaluates to an -th user balance at a "user's point" - some value that is designated for this specific user:
.
Where is the Lagrange basis polynomial defined as a product:
A polynomial constructed using the Lagrange interpolation is known to have the degree where is the number of users (and the number of the corresponding balance evaluation points). The resulting polynomial should look like the following:
Let's choose the values as the -th degrees of an -th root of unity (assuming that we are performing all the calculations in the prime field with a sufficiently large modulus):
where is the -th primitive root of unity and .
To prove the solvency of the Custodian, we need to find its total liabilities by summing up all the user balances and to prove to the public that the sum is less than the assets owned by the Custodian. An individual -th user balance is the evaluation of the polynomial at the value corresponding to the user:
Let's calculate the sum of all the user balances as the sum of the polynomial evaluations:
As it turns out, the Halo2 proving system is internally using the roots of unity as coordinates for the polynomial construction, and we will later see how we can take advantage of that.