Multi-Party Computation (MPC) heaivly relies on the primitive of Shamir's secret sharing (SSS) for various use cases.
In this secret-sharing scheme a set of parties would like to hold a secret in a distributed manner. The secret, which will be denoted for the rest of this document, is an element of a field . It is important to mention that "distributed manner" means that party will hold a piece of information, denoted so that :
The parameters and are known prior to the sharing of the secret. In the basic setting of Shamir's secret sharing there is a trusted-dealer who send to each party its corresponding . So what is this , and how does it look like?
DISCLAIMER: I may not be 100% algebraically accurate for the sake of both brevity convenience.
REMINDER: A polynomial is a function which can be expressed algebraically in the following form: for some number . The are called "coefficients" and the largest number such that is the "degree" of the polynomial. Note that in the case that all coefficients are zero, we consider the degree to be .
Shamir's secret sharing utlizes one key algebraic property about polynomials known as the "unique interpolation theorem" which states that:
Given a set of pairs of field elements, such that at least one , there exists a unique polynomial of degree at most such that for all .
Therefore, given two distinct polynomials of degree at most and a set of sample points then for at least one between and it must hold that . Thus, a set of evaluations of a polynomial is all that is required to reconstruct a polynomial . By "reconstructing" we mean deriving the coefficients of the polynomial so we will be able to express the polynomial in the form .
Before diving into how the sharing is done, let's answer an even more fundamental question. Given those evaluations of a polynomial at points , how can it be practically reconstructed?
The reconstruction's smallest building blocks will be a set of degree polynomials that satisfy for the following constraints:
Notice that for values which are not one of the value of is not necessarily 0 and that there is exactly one polynomial who satisfies these constraints for every choice of and (according to the unique-interpolation theorem). Thus, the polynomial can be constructed with the following formula:
.
This formula satisfies all our constraints:
The actual coefficients of can be derived from this formula by programmatically multiplying the factors of the product.
Two observations that will allow us to reconstruct any polynomial from is samples on points are as follows:
Let be two distinct polynomials of degree , then their sum is also a polynomial of degree .
This one is correct because their sum can be expressed as a polynomial where coefficients are simply added:
Let be a polynomial and let be a constant. Then the product is also a polynomial.
Similarly to the previous this one is correct because the resulting polynomial is the same as the original polynomial with all coefficients just multiplied by .
Great, now using these observations we can create a polynomial such that for all , we will give the polynomial and these explain why is satisfied these properties:
First, according to the previous two observations and since each is a degree polynomial, by multiplying each by a constant and summing them, the result is also a polynomial of degree .
Next, for each we get that:
By that achieving the requested interpolation.
This interpolation algorithm is known as "Lagrange Interpolation" and the are often referred to as "Lagrange Polynomials".
The sharing goes as follows. The trusted dealer, who knows the secret will generate a polynomial of degree such that and for the dealer will pick randomly from the field . The dealer will send, for each party between and its share . In other words, each party has a share of the secret which is the polynomial evaluated at point .
So why is this even working? Since the polynomial is of degree , any set of parties will be able to derive according the to unique interpolation theorem. However, for any set of parties, they will not be able to learn anything about or since up to different polynomials can be created that all agree with the evaluations of given to these parties, and each will be evaluated to a diffenret value at point .
This is all fun, but at this point we have this trusted dealer which we must trust and who is accessible to the secret. In many MPC scenarios we want some secret to never exist at a single point but still be able to make some computations based on its value. Therefore, we must find a way to get rid of the dealer.
In this section we will try to get rid of the dealer and still achieve the same effect of Shamir's secret sharing where a subset of out of parties, each holding - a share of a secret, can restore the secret, but without a dealer.
One question that must be asked at this point is what is the meaning of ? In particular, since no one knows (since there is no dealer), what exactly are we trying to achieve?
Well, we will change our goal by a little bit so that instead of sharing an existing secret held by the dealer, the parties will generate cooperatively a secret and share it between them without any party at any time holding the secret (or any information that may allow it to compute it efficiently).
This can be achieved in the following way. Party (for all ) will generate a local secret denoted so that the final secret shared among all parties will be . To achieve this, each party will share between all parties by following the steps of the dealer from the previous section. To be explicit, it will randomly create a polynomial of degree at most such that and send to party a share of this secret denoted by . Now each party who hold the secret shares will sum all those shares to get .
Since are all polynomials of degree , their sum is also a polynomial of degree at most denoted by .
Notice that:
Therefore, the parties ended in a state where each party holds a secret-share which is the evaluation of a degree polynomial at point and the shared secret is . From previous section we know that this allows each subset of parties of size to compute the secret and any subset of parties will not be able to derive any information about the secret.
Without getting too much into details, the share isn't exposed to any party along the way because if it did, it would imply the original secret-sharing algorithm from previous section to be insecure, but it is secure because of the unique-interpolation theorem.
Now that we know just enough about how secret shares are generated, we consider the scenario in which a set of parties have a secret shared among them so that each party holds a share of the secret, denoted where is a polynomial of degree at most and where is the shared-secret which isn't known fully to any party.
The problem we want to solve is being able add party to the setup so that it will have its own share of the secret, while maintaining the demand that each set of parties will be able to make some MPC-driven computations on the secret and any set of up to parties will not be able to do so.
The most naive approach is to gather all parties together, the original parties will forget about their existing shares and all parties will derive new shares of a new secret . This is dissatisfactory since we don't want the existing secret to change. On top of that, we would be happy if the solution will require as little communication as possible.
Party should obtain in a way that only it will learn and no other party will learn anything about it. After obtaining this piece of information, the party will be able to collaborate with any set of additional parties to perform MPC-driven computations on the secret.
The key observation which has driven us is:
If it only takes parties to compute the secret it shouldn't take more than parties to evaluate and send it to party .
According to this mindset, it should be possible to achieve a solution where not all parties are required to add new party in the happy flow where none of the parties is malicious.
One naive way in which a set of parties numbered could have done this is so that party will compute and send it to the new party who will in turn sum those inputs to obtain .
However, this imposes a major security risk, since party receiving can divide it by (notice that is a publicly known polynomial) and obtain for each and thus reconstruct the polynomial with those shares and obtain the secret!
Therefore, we should look for another solution that doesn't violate the security requirements.
Each party out of the collaborating parties could locally compute their local additive share of which is . As mentioned earlier the sum of the s equals to the share of party which is . ()
Thus, we will think of their sum as a secret and we would like to share it. Recall that Shamir's Secret Sharing algorithm without a dealer allowed some parties to distribute a secret amongst them so that the shared secret will be the sum of the local secrets of all parties.
In our case the local secret of each party will be and running this algorithm where each party uses as the local secret will result in each party holding the evalution of some polynomial at point such that is the sum of all local secrets which equals to which is the share of party (see ).
Each party will send their respective evaluation of the polynomial to party who will be able to reconstruct polynomial and compute . Assuming Shamir's secret sharing without a dealer is secure, no party should be able to infer and party shouldn't be able to infer the secrets of the rest of the parties.