Extends BIP340-compatible FROST with an enrollment protocol. It enables recovery of lost shares and addition of new participants. Essentially, it converts a
-
generate_enrollment_shares
-
$t$ participants involved in enrollment protocol will run this API first - this splits each participants contribution (towards a new share) into
$t$ random values- we do this for security reasons
- without this the new participant can compute
$P_i$ 's frost share - by multiplying the data
$P_i$ sends with$\ell_i(x)^{-1}$
- these
$t$ value are sent to the other$t-1$ participants (not to new participant)
-
def generate_enrollment_shares(self, participant_indexes, new_participant_index)
-
aggregate_enrollment_shares
- each participants aggregates the random values received from other
$t-1$ participants - now each participant sends this aggregated value to the new participant
- they also need to send their group public key, since new participant was not part of dkg
- each participants aggregates the random values received from other
def aggregate_enrollment_shares(self, participant_indexes, enrollment_shares)
-
generate_frost_share
- new participant simply sums the the value received from
$t$ participants - this will result in a new frost share which they can use for signing
- now the scheme go from
$(t, n)$ to$(t, n+1)$
- new participant simply sums the the value received from
def generate_frost_share(self, aggregate_enrollment_shares, group_public_key)
To clone the repo:
git clone --recurse-submodules <project-url>
To build the code:
# need to run this `export` cmd when you start a new terminal session
export PYTHONPATH=$PYTHONPATH:./frost-bip340
python main.py
To run the tests:
# runs all tests
python -m unittest main.py
# runs the sepecified test
python -m unittest -k EnrollmentTests.<test-name> main.py