1
- // Copyright 2020 WeDPR Lab Project Authors. Licensed under Apache-2.0.
1
+ // Copyright 2021 WeDPR Lab Project Authors. Licensed under Apache-2.0.
2
2
3
3
syntax = "proto3" ;
4
4
@@ -11,34 +11,34 @@ message CandidateList {
11
11
repeated string candidate = 1 ;
12
12
}
13
13
14
- // System parameters.
15
- message SystemParametersStorage {
14
+ // Shared system parameters to initialize a poll .
15
+ message PollParametersStorage {
16
16
bytes poll_point = 1 ;
17
17
CandidateList candidates = 2 ;
18
18
}
19
19
20
- // Counter's secret value .
20
+ // Secret of a counter .
21
21
message CounterSecret {
22
22
bytes poll_secret_share = 1 ;
23
23
}
24
24
25
- // Voter's secret value .
25
+ // Secret of a voter .
26
26
message VoterSecret {
27
27
bytes voter_secret = 1 ;
28
28
}
29
29
30
- // Request of voter's registration .
30
+ // Request of registering a voter .
31
31
message RegistrationRequest {
32
32
RegistrationBlindingPoint weight_point = 1 ;
33
33
}
34
34
35
- // delete?
35
+ // Blinding points for a voter registration.
36
36
message RegistrationBlindingPoint {
37
37
bytes blinding_poll_point = 1 ;
38
38
bytes blinding_basepoint_g2 = 2 ;
39
39
}
40
40
41
- // Response of coordinator for voter's registration.
41
+ // Response of voter registration.
42
42
message RegistrationResponse {
43
43
uint32 voter_weight = 1 ;
44
44
Ballot ballot = 2 ;
@@ -51,30 +51,29 @@ message Ballot {
51
51
bytes ciphertext2 = 2 ;
52
52
}
53
53
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 {
57
56
string counter_id = 1 ;
58
57
bytes poll_point_share = 2 ;
59
58
}
60
59
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 ;
64
63
}
65
64
66
- // Choice of ballot casting for each candidate.
65
+ // Vote choice for a candidate.
67
66
message VoteChoice {
68
67
string candidate = 1 ;
69
68
uint32 value = 2 ;
70
69
}
71
70
72
- // Choices for all candidate .
71
+ // Choice list for all candidates .
73
72
message VoteChoices {
74
73
repeated VoteChoice choice = 1 ;
75
74
}
76
75
77
- // Ciphertext ballot for each candidate.
76
+ // Ciphertext ballot for a candidate.
78
77
message CandidateBallot {
79
78
string candidate = 1 ;
80
79
Ballot ballot = 2 ;
@@ -85,55 +84,54 @@ message BallotProof {
85
84
bytes format_proof = 1 ;
86
85
}
87
86
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 {
90
89
string key = 1 ;
91
90
BallotProof value = 2 ;
92
91
}
93
92
94
- // Do not use Map, cause unordered in blockchain
95
- // Request of polling for all candidates.
93
+ // Request of voting for all candidates.
96
94
message VoteRequest {
97
95
VoteStorage vote = 1 ;
98
- repeated StringToCandidateBallotProofPair ballot_proof = 2 ;
96
+ repeated StringToBallotProofPair ballot_proof = 2 ;
99
97
bytes range_proof = 3 ;
100
98
bytes sum_balance_proof = 4 ;
101
99
}
102
100
103
- // Polling for each candidates.
101
+ // Ciphertext ballot for all candidates.
104
102
message VoteStorage {
105
103
bytes signature = 1 ;
106
104
Ballot blank_ballot = 2 ;
107
105
Ballot rest_ballot = 3 ;
108
106
repeated CandidateBallot voted_ballot = 4 ;
109
107
}
110
108
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 .
112
110
message CountingPart {
113
111
string counter_id = 1 ;
114
112
bytes blinding_c2 = 2 ;
115
113
bytes equality_proof = 3 ;
116
114
}
117
115
118
- // Pair of candidate index and the decrypted ballot he received .
116
+ // Pair of string ( candidate id) and CountingPart .
119
117
message StringToCountingPartPair {
120
118
string key = 1 ;
121
119
CountingPart value = 2 ;
122
120
}
123
121
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 .
125
123
message DecryptedResultPartStorage {
126
124
CountingPart blank_part = 1 ;
127
125
repeated StringToCountingPartPair candidate_part = 2 ;
128
126
}
129
127
130
- // Final result of all candidates .
128
+ // Fully decrypted result of a poll .
131
129
message VoteResultStorage {
132
130
repeated StringToInt64Pair result = 1 ;
133
131
}
134
132
135
- // Final result of each candidate.
133
+ // Pair of string ( candidate id) and number .
136
134
message StringToInt64Pair {
137
135
string key = 1 ;
138
136
int64 value = 2 ;
139
- }
137
+ }
0 commit comments