Skip to content

Instantly share code, notes, and snippets.

@kibagateaux
Created May 2, 2018 20:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kibagateaux/60b17747a1e6c161f8d4b5243377688b to your computer and use it in GitHub Desktop.
Save kibagateaux/60b17747a1e6c161f8d4b5243377688b to your computer and use it in GitHub Desktop.
Accord Voting Standard
namespace org.accord_voting.decision
asset Decision identified by identifier {
// what is a decision's job, function, place in the system, how will it be used?
o String identifier
o String decisionValue // what the actual decsion is. maybe bytes or raw data instead?
o String election // explicitly define where the decision came from
o Boolean isVoid optional
o Boolean isPrivate optional
}
namespace org.accord_voting.vote
import org.accordproject.organization.Organization from github://accordproject/models/master/organization.cto
import org.accordproject.person.Person from github://accordproject/models/master/person.cto
asset Vote identified by identifier {
// what is a vote's job/function, how will it be used in the system?
o String identifier
o String voteID
--> Person voter // <Person> should be <Entity>. Needs to be abstract to accomodate individual citizens, NGOs, gov'ts, and smart contracts.
--> Person proxy optional // Someone who has been authorized to cast vote on original voter's behalf
o String voteValue // What the actual vote is. maybe bytes or raw data instead?
o String election optional // Explicitly define which election vote can be used in
o Boolean isPrivate optional
o Boolean isVoid optional
}
@mttrbrts
Copy link

mttrbrts commented May 2, 2018

Looking good!

What's the difference between the Vote's identifier and voteID?

Also, it might be helpful to represent the election as an Asset too so that you can include a uni-directional relationship to it from both a Decision and Vote?

@kibagateaux
Copy link
Author

Still working on naming conventions. voteID was supposed to be for the the voting system it originated from and identifier would be a vote type e.g. ballot, caucus, committee. I will probably remove voteID because I am making assets for protocols so that will be a relationship instead --> VotingProtocol votingProtocolIdentifier.

I haven't made an election asset yet I don't think "election" is the right word since these can be activated by token curated registries or other mechanisms. If you think it is important to have I can make it and we can work out the name later but I think it will take a different form if you think about it as more than just an election.

@iamchrissmith
Copy link

Agree, looks good. Couple more naming suggestions:
In each you have a Value (voteValue and decisionValue). If I understand the comments, these fields might be better identified as voteResult and decisionResult. The word Value, for me, evokes more of a weighting that might be used when comparing this vote or decision against another.

What does isVoid on Vote describe? Would that be for cancelled elections?

@kibagateaux
Copy link
Author

Agree result is better than value, that will be updated. isVoid means that the votes can't be used to calculate a decision anymore which could have many use cases - a cancelled election, that particular vote is found to be fraudulent, if you want to give everyone a chance to cast a vote to gather data but don't want everyone's vote to count towards the actual result, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment