You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to add some additional operations in VoteTally circuit where we construct a temporary Merkle tree and to save an amount of voters voted per each option. Each leaf will be hash3(voteOptionIndex, totalVotersCount, salt) (salt needed to allow publish this tree without worrying it can be reconstructed using only voteOptionIndex and totalVotersCount).
Per each batch we will calculate new temporary tree (similar as ballotTree) and add root of this tree to tallyCommitment, so we can ensure that this data is verifiable and we can continue calculating individual vote count per option. For next batch, we check that tallyCommitment is valid and add/remove/merge new values into the temporary tree and then continue the process until there are no batches.
Also, coordinator keeps previous version of temporary tree and based on it build new tree with updated values, so it's important to check that previous tree root is included in tallyCommitment.
Finally, we have tree that contains all the individual vote count values per option and its root.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is related to issue #2315.
The idea is to add some additional operations in
VoteTally
circuit where we construct a temporary Merkle tree and to save an amount of voters voted per each option. Each leaf will behash3(voteOptionIndex, totalVotersCount, salt)
(salt
needed to allow publish this tree without worrying it can be reconstructed using onlyvoteOptionIndex
andtotalVotersCount
).Per each batch we will calculate new temporary tree (similar as
ballotTree
) and add root of this tree totallyCommitment
, so we can ensure that this data is verifiable and we can continue calculating individual vote count per option. For next batch, we check thattallyCommitment
is valid and add/remove/merge new values into the temporary tree and then continue the process until there are no batches.Also, coordinator keeps previous version of temporary tree and based on it build new tree with updated values, so it's important to check that previous tree root is included in
tallyCommitment
.Finally, we have tree that contains all the individual vote count values per option and its root.
Beta Was this translation helpful? Give feedback.
All reactions