3 ms·
Here is how you can migigate sybil attacks: It has three pieces. 1. As people vote, a counter voteCount goes up. And also X = hash(X + latestVoterAddress). Yo
by EGreg 6y ago
Here is how you can migigate sybil attacks:
It has three pieces.
1. As people vote, a counter voteCount goes up. And also X = hash(X + latestVoterAddress). You become eligible based on X being the random number, rather than the block hash. The advantage here is we don’t have 40 minute limitation because X only changes as people vote and you can store as many historic X as u want.
Also how to store the last N historic values: you preallocate an array of N values and then you have a cursor that goes c = (c + 1) % N and it wraps around. That is how you can indicate which C to check and make sure you are still eligible. For example you can be eligible until 1000 new votes are cast.
We can combine with OR the randomness based on block hash (time based) and the randomness based on X (vote based) and you are eligible for 40 minutes or 1000 new votes whichever takes longer.
2. This is what I want to call Proof of Quality (PoQ) instead of Proof of Popularity (PoP). It’s not about how many people voted for you or how much capital was invested in you. But rather, whether people thought you were actually the best in a certain quality.
When you are eligible to vote, you should NOT be able to vote for whomever you want directly. You can vote indirectly, like in Mark Zuckerberg’s FaceMash: “who is more attractive, A or B?” And we update them with ELO rating formula as if they played a chess game. Then whoever gets highest ELO rating is the winner!
If there are a lot of candidates we can also have option for more than one (“choose most attractive from among A, B, C, D, E”) but arrow’s incompleteness theorem says two choices is the only way you can actually capture EVERYONE’s preferences
A variation of that is when you vote for some value to go up or down by 1% or some predetermined random % between 0 and 10. The result of everyone voting is what we use on-chain, eg when we combine the dot product of how much to issue for various tagged UBI categories etc.
What if we have only 2-5 candidates? Then this indirect voting thing wouldn’t work to prevent sybil attacks and we can only rely heavily on the “eligible to vote” where only 5% of people are eligible to vote at any given time. Someone with a lot of accounts can game that system. Luckily with our projects we will be voting for an ever growing number of candidates so we can use PoQ to determine top 10 in last 24 hours!
3. Your account address cannot proceed to vote for anyone else until you have voted in the current match-up in front of you (“Who is the most attractive, A B or C?”)
Just have a mapping in the smart contract which stores the random seed that made you become eligible. And don’t allow changing it until you voted. Have a parameter “votesPerSession” which allows a person to vote in up to votesPerSession matchups before they need to become eligible again. Thus #1 and #3 are used for rate-limiting them and #2 is for avoiding shilling specific items.