Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC-1202 Voting Standard #1202

Closed
Tracked by #5111
xinbenlv opened this issue Jul 8, 2018 · 29 comments
Closed
Tracked by #5111

ERC-1202 Voting Standard #1202

xinbenlv opened this issue Jul 8, 2018 · 29 comments

Comments

@xinbenlv
Copy link
Contributor

xinbenlv commented Jul 8, 2018

The draft is actively work-in-progress, please see the latest here.

Please leave comments in this Github issue below.

@xinbenlv xinbenlv changed the title Early Feedback Request: ERC-TBD Voting Standard ERC-1202 Voting Standard - WIP Jul 9, 2018
@xinbenlv xinbenlv changed the title ERC-1202 Voting Standard - WIP ERC-1202 Voting Standard Jul 10, 2018
@xinbenlv
Copy link
Contributor Author

Request for review~

@evbots
Copy link

evbots commented Jul 17, 2018

Hey @xinbenlv, thanks for making this issue. I've been doing some thinking on a voting standard and share many of the same questions that you have outlined in this ERC. I've committed some initial thoughts about modeling a voting contract here. A voting standard could be modeled with the following primary considerations: (1) choices presented to voters (2) rules for casting votes (3) outcome logic. I've provided some further thoughts on those three points in the link provided above. I'll respond to your "Early Feedback Questions" questions below:

  1. I don't think you've duplicated any efforts in this repo. I am aware of a project called CarbonVote that was created during the DAO hardfork and I'm curious why a discussion around a voting standard did not evolve from that.
  2. I imagine that a simple standard would be a single use design, but I'm open to other ideas on this.
  3. I think proxy voting is pretty important, but this could be achieved outside the standard. By this I mean one could combine a voting standard with a third-party proxy contract to achieve proxy voting. I don't think the standard itself should make any mention of migrating or upgrading contracts.
  4. I think there are an infinite number of ways that a voting system could be designed. Therefore I think it's important that a standard be limited in scope and leave advanced implementations to projects to implement themselves.
  5. I don't have much of an opinion there. In theory this would be helpful.

@xinbenlv
Copy link
Contributor Author

Thank you Evan(@evbots) for the response and it's very inspiring. I will look into the example you provided and start to come up with a few implementation samples.

@evbots
Copy link

evbots commented Jul 17, 2018

No problem! I'm excited to collaborate on this. I've considered a few things that might make sense for a voting standard. In the process of voting, distributed parties probably need to be able to do the following things in a consistent manner:

  • query options for voting (read)
  • cast a vote (write)
  • query for the outcome of a vote (read)

The data passed and returned from the above methods should probably also be standardized, so that applications know how to structure payloads for voting and display voting outcomes (although given the vast number of ways an outcome could be determined, this might be challenging).

I think the methodology by which the outcome is determined (how the votes are counted) could probably fall outside the scope of a standard since those parties participating in an election or poll don't need to interact with those methods. Only the owner of the election contract has to determine and implement the outcome methodology.

A simple standard like above would allow dApp developers, wallet developers, and exchanges (just to name a few) to build simple voting interfaces for contracts requesting votes from arbitrary accounts or token holders.

I think there are probably other methods that could be considered for a standard as well, such as methods for determining who can vote or who can't vote. Interested to read your and other's thoughts on the matter.

@xinbenlv
Copy link
Contributor Author

We kindly request the community for comments, in particular, the following ERC and projects related authors:

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jul 22, 2018

Usage for discussion and call for example(I will try to write some too)

  1. Joint Wallet contract approval process(multiple voter vote, when qurem reached, trasnfer token/approve
  2. Voting for Ranking (getTopOptions)
  3. Secret Vote
  4. Token re-issue
  5. Multi-Input Oracle Mechanism, select source of output or value of output based on voting
    ...

@yingogobot
Copy link

yingogobot commented Jul 23, 2018

Hi @xinbenlv thanks for making this issue. I think this issue is definitely helpful for Blockchain and DAOs governance. We have been working on a project that is a blockchain dispute resolution protocol, also using voting as the primary function of our jury community. So we have been thinking about Voting for awhile.

I have carefully read all your ideas and great feedbacks from @evbots . Here are some of my suggestions. If possible, I would love to collaborate on this with you guys.

  1. Option for setting the vote open time and close time, generally, i think all the votes should be done in certain amount of time, so the result will be useful and valuable.

  2. Option for setting the ratio of the winning option. by default, it's 51% vs 49%.

Let's use the example you provided, 'If John Smith should be our new CEO'. In order to have John as our new CEO, company decides we need at least 70% of the votes for YES. So we can set a the winning ratio as 70% when constructing the smart contract.

  1. Option for getting the votes each options got.

For instance, when a vote ended, we would like to show how much vote each option got, such as Option A: 555 votes. Option B 420 votes. Option C 1222 votes.

  1. this is just an idea related to weight, maybe when weight is not 1, user has to deposit the token into the smart contract for their votes. otherwise the weight is not very secure, since i can cast my vote then transfer all the tokens to my friend and they vote with the same weight again. You can take the reference from the voting for token listing from exchange platforms. so in that case, we might need to have a function which allow user to cast their vote along with their tokens.

  2. suggest to add another event called OnWinnerAppears, so some smart contracts or dapps which can be executed continually on this result, such as dispute resolution, can run automatically when they receive this event.

@fulldecent
Copy link
Contributor

fulldecent commented Jul 23, 2018

" but for secret voting people might not want to disclose a voting for certain issue even exis" is poor rationale for not supporting ERC-165.

Currently the use cases are focused on developer needs. Instead they should be focused on end user needs. We should standardize things because users demand interoperable systems, not because developers want other people to copy their ideas.

A strong EIP should review existing implementations of voting system and analyze how they would be served by this standardization. I have a hunch that actual voting systems will be much too complicated to standardize / or the scope of the standardized part will be very limited.

Also, thanks for the ping.

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jul 24, 2018

@fulldecent Thanks for your comment and advice William. I agree with your point that interface design should prioritize user's need of interoperable systems rather than developer's need.

We are thinking that ERC1202 shall be decoupled with ERC165 as whether to support ERC165 (or later if other detection standard mechanism being proposed and passed) is perpendicular to a ERC interface design itself. And I think we are going to recommend supporting ERC165. Question for @fulldecent: In which section in this EIP shall we put the recommendation to implement with ERC165? How about Backward Compatibility? Or we are also thinking about having a separate section of "Interactions With Existing ERCs"

Per your(@fulldecent) suggestion: we added outline to case study and add coding examples for a few existing or commonly used voting systems / rules, stay tuned for our update on these case study and coding examples as they might need take sometime to complete. Thanks for the advice, very valueable. We also hope to hear for other Ethereum community members to remind us of other worth noting voting systems / rules to be included.

And yes, after adding several case study outlines, I started to feel voting system as a standard can become increasingly complex. We like to seek experienced ERC standard authors for advice on how to trade off between simplicity and usability coverage on ward.

Thank you!

@bingen
Copy link

bingen commented Jul 24, 2018

This is a very interesting proposal, but as it has been said before, it looks like hard to achieve. There are so many variants in Voting that I don't think we can define a standard that fits them all. E.g., you are defining:

function vote(uint option) external returns (bool success);

but what about PLCR voting, where you need a commitVote function plus a revealVote one?
(Btw, I guess, this function is missing a param for the Vote Id, right? Or is it one contract per Vote?)
At Aragon we have thought a little bit about it, as we are trying to implement a TCR system where the Voting app can be easily swapped. You can see more details here. So we are going to define a minimum interface that covers these particular needs, but for example we'll leave the way votes are cast out of its scope.
Besides, we also have a regular Voting app that implements a forwarding interface to be able to execute actions automatically once the vote has been closed, in case you want to have a look at it (re: comment 5 by @yingogobot )
Anyway I'll keep an eye on this and try to help as much as I can.

@aodhgan
Copy link

aodhgan commented Jul 24, 2018

Of note for private voting

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jul 25, 2018

@bingen: Thanks for the response. On a separate thread, @frozeman also mentioned the PLCR voting. I intuitively think about the possibility of doing so, and I will add a coding example to implement a simple PLCR voting. Side note, you asked Or is it one contract per Vote. Please take a look at the advanced version of the spec, which has the "Vote Id"(issueId).

@aodhgan, Thank you! Despite as short as only 5 words, points us to a very interesting paper of privacy-friendly voting with zero knowledge proof. I think we have good candidate for what I called "sealed counting" voting too. There are a few other papers and I think we should do a research summary on what's published in the academia

I plan to prioritize updating the standard with these two advanced voting mechanism. Thank you all

@frozeman
Copy link
Contributor

I would also suggest checking if add claim checks on identities such as #725 and #735 in the voting process. The question here is only does this need to be standardised, or is it enough as an implementation choice.

@ainsleys
Copy link

ainsleys commented Jul 25, 2018

@xinbenlv and @aodhgan we (at Enigma) have also been working on enabling private voting for Ethereum contracts. We are still in testnet but will have a demo of a working secret vote contract in coming weeks. We are glad to follow this standards conversation, thank you for getting it started.

@bingen
Copy link

bingen commented Jul 25, 2018

Another interesting source to have a look at is Harbour:
https://github.com/HarbourProject/protocol

@xinbenlv
Copy link
Contributor Author

@frozeman: Thanks, I will add the consideration of interactions with ERC #725 and ERC #735 to the draft.

@ainsleys: Thanks for reaching out. Enigma is a very interesting project. I added the TCR blog post as a reference of the draft. Talk to you tomorrow

@bingen: thanks for the additional reference!

@chaitanyapotti
Copy link
Contributor

Can you also add an option to UnVote?

@xinbenlv
Copy link
Contributor Author

I think unvote can be supported, to keep it simple, vote can also do the trick. As an interface, the implementer of it can determine how to interpret vote() function. For example, a second vote() call can overwrite the previous vote, or a second vote can add to the previous vote.

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Dec 3, 2018 via email

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jul 4, 2019

Still looking for answers...

@xinbenlv
Copy link
Contributor Author

I watch "rock paper scissors" today and I am thinking that Commit-Reveal should actually have its own standard.

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jan 14, 2020

Hi all, since there is no further comments, we now propose to move this standard to Last Call with PR #2468

@3esmit
Copy link
Contributor

3esmit commented Jan 14, 2020

Update to last EIP template, for example, missing security considerations section.

Also, I'm interested in this EIP, but I haven't got time to try it and see what could be improved, if anything.

@xinbenlv
Copy link
Contributor Author

@3esmit thank you! The latest discussion ends around July 3rd, 2019, which is 6 months ago, so I didn't check the latest mandatory fields, thank you for bringing it to the attention. I will add them soon

@xinbenlv
Copy link
Contributor Author

xinbenlv commented Jan 20, 2020

We will put on-hold moving to Last Call and conduct several updates then come back.

@github-actions
Copy link

github-actions bot commented Dec 5, 2021

There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the stale label Dec 5, 2021
@xinbenlv
Copy link
Contributor Author

xinbenlv commented Dec 5, 2021 via email

@github-actions github-actions bot removed the stale label Dec 5, 2021
@xinbenlv
Copy link
Contributor Author

Hi all, I am close to finalizing the interface draft. I like to invite contributors who are interested to participate in building sample contracts. Please let me know if you are interested by replying here. or just send a PR

@MicahZoltu
Copy link
Contributor

Closing this for housekeeping purposes. Feel free to continue using this issue for discussion about EIP-1202.

Note: Before this moves to Review stage, the discussions-to link should be moved over to a thread on Ethereum Magicians.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants