With Shamir's Secret Sharing, to perform a recovery, we must know the "fragment index" of the corresponding fragment. A fragment index is used as an input to a Polynomial where the coefficients are the m-1 threshold fragments. The output of the polynomial evaluation, given an index, is the fragment itself. When m fragments and their corresponding fragment_indices are known, it's possible to re-assemble them using Lagrange basis polynomials.
Presently, we have no specification for calculating a "fragment index" (see issue #3) for a given fragment. As such, we naively assume that the fragments provided to PrivateKey::recover are ordered and their corresponding fragment_index is their index in the vector + 1.
To solve this, we need to have some sort of mechanism to store the fragment_index along with its corresponding fragment. Ideally, #3 will resolve this issue and allow us to deterministically generate these shares so that we no longer need to store them along with the fragment.
Presently, this is the only blocking issue in achieving our initial MVP release. There will likely be some refactoring of the API required to resolve this issue.
With Shamir's Secret Sharing, to perform a recovery, we must know the "fragment index" of the corresponding fragment. A fragment index is used as an input to a Polynomial where the coefficients are the
m-1
threshold fragments. The output of the polynomial evaluation, given an index, is the fragment itself. Whenm
fragments and their correspondingfragment_indices
are known, it's possible to re-assemble them using Lagrange basis polynomials.Presently, we have no specification for calculating a "fragment index" (see issue #3) for a given fragment. As such, we naively assume that the fragments provided to
PrivateKey::recover
are ordered and their correspondingfragment_index
is their index in thevector
+ 1.This does not work when fragments are collected out of order. See
test_unordered_index_recovery
for the test demonstrating this failure.To solve this, we need to have some sort of mechanism to store the
fragment_index
along with its correspondingfragment
. Ideally, #3 will resolve this issue and allow us to deterministically generate these shares so that we no longer need to store them along with thefragment
.