1- // Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
1+ // Copyright 2021 WeDPR Lab Project Authors. Licensed under Apache-2.0.
22
33syntax = "proto3" ;
44
@@ -11,34 +11,34 @@ message CandidateList {
1111 repeated string candidate = 1 ;
1212}
1313
14- // System parameters.
15- message SystemParametersStorage {
14+ // Shared system parameters to initialize a poll .
15+ message PollParametersStorage {
1616 bytes poll_point = 1 ;
1717 CandidateList candidates = 2 ;
1818}
1919
20- // Counter's secret value .
20+ // Secret of a counter .
2121message CounterSecret {
2222 bytes poll_secret_share = 1 ;
2323}
2424
25- // Voter's secret value .
25+ // Secret of a voter .
2626message VoterSecret {
2727 bytes voter_secret = 1 ;
2828}
2929
30- // Request of voter's registration .
30+ // Request of registering a voter .
3131message RegistrationRequest {
3232 RegistrationBlindingPoint weight_point = 1 ;
3333}
3434
35- // delete?
35+ // Blinding points for a voter registration.
3636message RegistrationBlindingPoint {
3737 bytes blinding_poll_point = 1 ;
3838 bytes blinding_basepoint_g2 = 2 ;
3939}
4040
41- // Response of coordinator for voter's registration.
41+ // Response of voter registration.
4242message RegistrationResponse {
4343 uint32 voter_weight = 1 ;
4444 Ballot ballot = 2 ;
@@ -51,30 +51,29 @@ message Ballot {
5151 bytes ciphertext2 = 2 ;
5252}
5353
54-
55- // Request of generating system parameter from a counter.
56- message CounterSystemParametersShareRequest {
54+ // Request of aggregating a part of system parameters from a counter.
55+ message CounterParametersShareRequest {
5756 string counter_id = 1 ;
5857 bytes poll_point_share = 2 ;
5958}
6059
61- // Requests of generating system parameter from all counters.
62- message CounterSystemParametersStorage {
63- repeated CounterSystemParametersShareRequest counter_parameters_request = 1 ;
60+ // Shared system parameters to initialize a group of counters.
61+ message CounterParametersStorage {
62+ repeated CounterParametersShareRequest counter_parameters_share = 1 ;
6463}
6564
66- // Choice of ballot casting for each candidate.
65+ // Vote choice for a candidate.
6766message VoteChoice {
6867 string candidate = 1 ;
6968 uint32 value = 2 ;
7069}
7170
72- // Choices for all candidate .
71+ // Choice list for all candidates .
7372message VoteChoices {
7473 repeated VoteChoice choice = 1 ;
7574}
7675
77- // Ciphertext ballot for each candidate.
76+ // Ciphertext ballot for a candidate.
7877message CandidateBallot {
7978 string candidate = 1 ;
8079 Ballot ballot = 2 ;
@@ -85,55 +84,54 @@ message BallotProof {
8584 bytes format_proof = 1 ;
8685}
8786
88- // Pair of candidate index and the ballot proof he received .
89- message StringToCandidateBallotProofPair {
87+ // Pair of string ( candidate id) and BallotProof .
88+ message StringToBallotProofPair {
9089 string key = 1 ;
9190 BallotProof value = 2 ;
9291}
9392
94- // Do not use Map, cause unordered in blockchain
95- // Request of polling for all candidates.
93+ // Request of voting for all candidates.
9694message VoteRequest {
9795 VoteStorage vote = 1 ;
98- repeated StringToCandidateBallotProofPair ballot_proof = 2 ;
96+ repeated StringToBallotProofPair ballot_proof = 2 ;
9997 bytes range_proof = 3 ;
10098 bytes sum_balance_proof = 4 ;
10199}
102100
103- // Polling for each candidates.
101+ // Ciphertext ballot for all candidates.
104102message VoteStorage {
105103 bytes signature = 1 ;
106104 Ballot blank_ballot = 2 ;
107105 Ballot rest_ballot = 3 ;
108106 repeated CandidateBallot voted_ballot = 4 ;
109107}
110108
111- // Decrypted ballot and ZKP data to verify the process of counting of each counter .
109+ // Partially decrypted ballot and associated ZKP data for a candidate .
112110message CountingPart {
113111 string counter_id = 1 ;
114112 bytes blinding_c2 = 2 ;
115113 bytes equality_proof = 3 ;
116114}
117115
118- // Pair of candidate index and the decrypted ballot he received .
116+ // Pair of string ( candidate id) and CountingPart .
119117message StringToCountingPartPair {
120118 string key = 1 ;
121119 CountingPart value = 2 ;
122120}
123121
124- // Decrypted ballot and ZKP data to verify the process of counting of all counters .
122+ // Partially decrypted ballots and associated ZKP data for a poll .
125123message DecryptedResultPartStorage {
126124 CountingPart blank_part = 1 ;
127125 repeated StringToCountingPartPair candidate_part = 2 ;
128126}
129127
130- // Final result of all candidates .
128+ // Fully decrypted result of a poll .
131129message VoteResultStorage {
132130 repeated StringToInt64Pair result = 1 ;
133131}
134132
135- // Final result of each candidate.
133+ // Pair of string ( candidate id) and number .
136134message StringToInt64Pair {
137135 string key = 1 ;
138136 int64 value = 2 ;
139- }
137+ }
0 commit comments