Table of contents
Open Table of contents
What it is
Shamir’s Secret Sharing allows one to split access to a secret value among multiple parties.
The secret can be split up in a way that a threshold number of secret share holders have to collaborate to reconstruct it.
How it works
Before continuing, one should have a solid understanding of Lagrange Interpolation which allows for the reconstruction of the shared secret.
The core mathematical building block this scheme relies on is polynomials. Each polynomial has coefficients as well as a certain degree which is the polynomial’s largest exponent.
A polynomial can therefore be written as:
One important property of polynomials is that any -degree polynomial can be uniquely reconstructed via polynomial evaluations (”-values”). While more than evaluations also allow for a reconstruction, less than evaluations won’t.
As mentioned above, an algorithm to perform such reconstruction is called Lagrange Interpolation.
As an example, we can look at the polynomial of degree that’s defined as:
This polynomial describes a line that intersects the -coordinate at .
As we can see in the following visualization, we can reconstruct the line uniquely via points:
With this knowledge we can use a polynomial to hide and share a secret among parties so that of our share holders can reconstruct it.
The first step is to define the secret value we want to hide and share. Next up, we need to decide how many participants will be required to reconstruct the secret (the “threshold”) and how many secret share holders there will be.
The secret will be defined as the value of the polynomial (the value where the graph intersects the -coordinate).
The threshold number of participants to reconstruct the secret will be . The overall number of participants that will hold secret shares will be ( has to be ).
We start by setting the polynomial’s value to . After that we generate random coefficients for a -degree polynomial.
Next up, we evaluate the polynomial at points (note that ):
We can then hand out these evaluations to our participants.
Given that we have a degree polynomial, any shares (polynomial evaluations) are enough to recover the polynomial (e.g. via Lagrange Interpolation).
Once it’s recovered, we can get access to the secret by evaluation the recovered polynomial at . Remember that the secret is the -intercept, i.e. the -value where .
Why it works
Shamir’s Secret Sharing leverages the ability to uniquely reconstruct polynomials via techniques such as Lagrange Interpolation.
Such techniques allow for the reconstruction of a polynomial of degree if at least evaluations of such polynomial are known. It’s important to emphasize that less than evaluations won’t allow for a proper reconstruction, whereas more than always do.
References
The following resources have been invaluable for me to learn the concepts discussed in this article.
You should definitely give them a read if you want to dive deeper into the topic.