serialization: fix potPubkey calculation #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the calculation of
potPubkey
which is the signature of the contribution. This was detected by the test-vector repo, which in it's first version used this repo implementation (now uses the sequencer one)..The code originally targeted
[t^0]_2
, which is alwaysG2
and not dependent on the secret for the sub-ceremony, which isn't correct.Considering the assumption that this work is done against the spec
initialContribution.json
, where the starting point of[t^1]_2
is effectiveG2
(t=identity), the first contribution first power of tau value in G2 will always be[x]_2
, which is the correct value (i.e: index 1).This repo still isn't suitable for a third or more iterations of contributions since
potPubkey
can't exploit current G2 POT calculations, since they have already baked existing secrets from previous contributions. The correct calculated value should be[x]_2
.As a note for other potential readers, you might be interested in looking at the sequencer repo for a reference implementation.