-
Notifications
You must be signed in to change notification settings - Fork 2
/
vote.proto
50 lines (44 loc) · 1.63 KB
/
vote.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
syntax = "proto3";
package netvote;
// index in this array represents index of option in question on ballot
// value of each entry represents number of points each option is given
// points: [0,0,3,5] means 1st gets 0, 2nd gets 0, 3rd gets 3, 4th gets 5
// ranked: [3,2,4,1] means 1st is 3rd choice, 2nd is 2nd choice, 3rd is 4th choice, 4th is 1st choice
message PointsAllocation {
repeated uint32 points = 1;
}
// index in this array is not meaningful
// value of each entry represents the index of chosen option in question on ballot
// [0,5] means choose the 1st choice and 6th choice
message IndexSelection {
repeated uint32 indexes = 1;
}
message VoteChoice {
oneof choice {
// choose one index from choices (default)
uint32 selection = 1;
// write-in value (any string, could be anything)
string write_in = 2;
// allocate points amongst selections (points or ranked choice)
PointsAllocation points_allocations = 3;
// choose which indexes to allocate 1 vote to (multiple choice)
IndexSelection index_selections = 4;
// if true, then ignored
bool abstain = 5;
}
}
message BallotVote {
repeated VoteChoice choices = 1;
}
message Vote {
// set by encryptor before encrypting (uint64 for footprint/cost)
uint64 encryption_seed = 1;
repeated BallotVote ballot_votes = 2;
// weight is only set by the gateway, default 1.0
// tally will use 1.0 if no weight is set
string weight = 3;
// if true, then tally will ignore this vote upon decryption
bool decoy = 4;
// set by voter before signing
string signature_seed = 5;
}