# Thread: I will give you half a Bitcoin if you can solve this problem.

1. ## I will give you half a Bitcoin if you can solve this problem.

EDIT: Sorry, I should have put this in The Playground, not quite used to the new website yet .

.5 BTC = around 450 USD at the moment.

Ok, imagine there are one billion tickets created. These one billion tickets are distributed extremely unevenly amongst an unknown number of accounts, each represented by an account number.

IE. One account has 50 Million, another only has 50k

One account may have as many as 100 million tickets, or as few as 1. An individual with one account may create as many additional accounts as he likes, and distribute his ticket(s) to said accounts freely.

Your task: design a voting system based on the following variables that assures fairness given the initial skewed distribution of tickets. In other words, someone with 100 million tickets is not 100 million times more powerful in terms of voting power compared to someone with 1.

Ideally one person's vote would equal another's regardless of the number of tickets one is holding.

Account Age
Account Balance

The closest I have come to solving this is

votingweight = ( 1 / similarity ) ^ (4/3) * (accountbalance)^(1/3) * (accountage)^2 (timesvoted)^(3/2)

Where similarity is a number that increases as two separate accounts make the same voting decisions repeatedly, indicating that they are controlled by the same person.

Here is what my solution looks like in PHP, however it is not perfect.
[spoiler]
Code:
```\$accountNumber = \$_POST['account']
\$option = \$_POST['option']

\$TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");
\$similarityModifier = file_get_contents(\$accountNumber . "/similarity.txt");
\$accountBalance = file_get_contents(\$accountNumber . "/balance.txt");
\$accountAge = file_get_contents(\$accountNumber . "/age.txt");

\$nxtAge = something goes here;

<!-- Times voted is retrieved and updated ---!>
\$filename = "\$accountNumber" . "/timesvoted.txt";
if (file_exists(\$filename))
{

\$oldData = file_get_contents(\$filename);
\$newData = \$oldData + 1;
file_put_contents(\$filename, \$newData);

}
else
{
\$newData = 1;
file_put_contents(\$filename, \$newData);
}
<!-- Times voted is retrieved and updated ---!>

\$TimesVoted = file_get_contents("\$accountNumber" . "/timesvoted.txt");
\$TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");

<!-- Account is added to vote ---!>
\$filename = \$TotalIssuesVotedOn . "/" . \$option . "votes.txt";
if (file_exists(\$filename))
{

\$oldData = unserialize(file_get_contents(\$filename));
\$oldData = array();
\$oldData['account'] = \$accountNumber;
\$oldData['weight'] = ( 1 / ( \$similarityModifier + 1 ) ) ^ (5/4) * ( \$accountAge ) ^ 2 ( \$accountBalance ) ^ (1/3)
\$newData = serialize(\$oldData);
file_put_contents(\$filename, \$newData);

}
else
{
\$oldData = array();
\$oldData['account'] = \$accountNumber;
\$oldData['weight'] = ( 1 / ( \$similarityModifier + 1 ) ) ^ (5/4) * ( \$accountAge ) ^ 2 ( \$accountBalance ) ^ (1/3)
\$newData = serialize(\$oldData);
file_put_contents(\$filename, \$newData);
}
<!-- Account is added to vote ---!>```
Code:
```\$optionOne = \$_POST['option1']
\$optionTwo= \$_POST['option2']

\$TotalIssuesVotedOn = file_get_contents("MasterVoteCount.txt");

\$DataOne = unserialize(file_get_contents(\$optionOne . ".txt"));

\$DataTwo = unserialize(file_get_contents(\$optionTwo . ".txt"));

{

echo "Option One Wins";

\$BankA = \$DataOne['account'];
\$newData = serialize(\$BankA);

file_put_contents("BankA" . \$TotalIssuesVotedOn . ".txt", \$newData);
}

else
{
echo "Option Two Wins";

\$BankA = \$DataTwo['account'];

\$newData = serialize(\$BankA);

file_put_contents("BankA" . \$TotalIssuesVotedOn . ".txt", \$newData);
}

\$splitfilename = "Issue" . "\$TotalIssuesVotedOn" . "/split.txt";

file_put_contents(\$splitfilename, \$split);
file_put_contents("MasterVoteCount.txt", \$TotalIssuesVotedOn);

if(\$TotalIssuesVotedOn < 4)
{
echo "completed";
}
else
{
\$var_a = \$TotalIssuesVotedOn - 1
\$var_b = \$TotalIssuesVotedOn - 2
\$var_c = \$TotalIssuesVotedOn - 3

\$splitA = file_get_contents("Issue" . "\$TotalIssuesVotedOn" . "/split.txt");
\$splitB = file_get_contents("Issue" . "\$var_a" . "/split.txt");
\$splitC = file_get_contents("Issue" . "\$var_b" . "/split.txt");
\$splitD = file_get_contents("Issue" . "\$var_c" . "/split.txt");

\$Bank1 = file_get_contents("BankA" . \$TotalIssuesVotedOn . ".txt");
\$Bank2 = file_get_contents("BankA" . \$var_a . ".txt");
\$Bank3 = file_get_contents("BankA" . \$var_b . ".txt");
\$Bank4 = file_get_contents("BankA" . \$var_c . ".txt");

\$AllBanks = array(  \$Bank1,
\$Bank2,
\$Bank3,
\$Bank4
);

\$SimilarAccounts = call_user_func_array('array_intersect',\$AllBanks);

\$var_d = array_sum(\$SimilarAccounts);

\$similarityAdded = .1 / (\$splitA * \$splitB * \$splitC * \$splitD);

\$var_e = 0;
while (\$var_e < (\$var_d - 1))
{
\$similarityModifier = file_get_contents(\$SimilarAccounts[\$var_e] . "/similarity.txt");

file_put_contents(\$SimilarAccounts[\$var_e] . "/similarity.txt", \$similarityModifier);

\$var_e = \$var_e + 1;
}
}
\$TotalIssuesVotedOn = \$TotalIssuesVotedOn + 1;```
[/spoiler]

This doesn't work as similarity can be defeated by voting randomly on issues that someone with multiple accounts doesn't care about...

2. If your dupe account detection isn't reliable (which it appears it wouldn't be, based voting patterns alone), this is unsolvable without changing the premises.

To solve it you would need to give some advantage to the more wealthy accounts, or have a better way of detecting dupes, like tracing where each account was funded from, which again is probably impossible given that presumably this is about anonymous cryptocurrency transacitons.

3. Are you designing a new altcoin?

4. Originally Posted by latch
Are you designing a new altcoin?
I wish, this is just the voting system for NXT. (New all time high on coinmarketcap.com btw )

Originally Posted by Deckard
If your dupe account detection isn't reliable (which it appears it wouldn't be, based voting patterns alone), this is unsolvable without changing the premises.

To solve it you would need to give some advantage to the more wealthy accounts, or have a better way of detecting dupes, like tracing where each account was funded from, which again is probably impossible given that presumably this is about anonymous cryptocurrency transacitons.
It is ok if more wealthy accounts have some advantage, but it can not be a linear advantage. On this premise I believe a solution is logically feasible.

5. Originally Posted by prometheus
I wish, this is just the voting system for NXT. (New all time high on coinmarketcap.com btw )
AHA! I thought you were who I thought you were. And I was right.

Just leave account balance out of the equation and allow one vote per account.

If you want account balance to have some factor in it but very little that you lower its influence relative to the other factor.

What is the range of the vote 'weight' variable you are aiming for?

6. Originally Posted by prometheus
It is ok if more wealthy accounts have some advantage, but it can not be a linear advantage. On this premise I believe a solution is logically feasible.
If the dupe detection is entirely unreliable then the obvious attack is to create ~infinite dupes. I just don't see how you would go about differentiating between multiple (genuine) individual accounts voting the same way and a bunch of dupes voting the same way.

7. i stumbled upon this thread, sorry i know its nearly 6 months old, but why ID each vote by an account name when a user can create more freely? can not the freely created user accounts have a separate, non-voteable ID? are you trying to avoid the user having to set up a unique account on initial acquisition of the coin?

8. a random number generator decides the vote

it's fair

9. I think the problem might need additional constraints, but I'd suggest including:

1. Machine learning like learning classifier systems to decompose voting patterns into vector spaces with don't care wildcards to determine voting patterns
2. Logarithmic discounting of vote counts along these vectors to linearize the vote counting function
3. Uncertainty quantification by introducing noise into the model to prevent overfitting
4. Calculate confidence intervals to see if you can unambiguously determine the popular vote

However, you might be able to improve things by introducing more complexity to the voting process. If you require essay style voting (not only how you vote but why) you can increase the expense of voting proportionally to the number of votes cast, as long as you can detect spam there (which is not too hard) . Basically you raise the cost for multiple votes and use computational linguistics to detect ballot stuffing. It would be harder to spam - sort of like a Turing test for vote counting.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•