Bitcoin Forum
May 24, 2024, 03:53:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Apriori hash of the number of shifts in a list  (Read 864 times)
remotemass (OP)
Legendary
*
Offline Offline

Activity: 1117
Merit: 1016


ASMR El Salvador


View Profile WWW
March 13, 2013, 08:52:48 PM
Last edit: March 13, 2013, 09:12:57 PM by remotemass
 #1

Here is a simple way of finding - in a way that you coudn't cheat the winner - the winner in a contest with any number of participations.
You hash a random number with a reasonable number of digits, like 10 digits for instance, and publish that hash in advance.
Then you rule something like, the list of participants will be shifted (in one shift: the one that was in first place becomes in second place, the one that was in second place becomes in third place, and so on and so forth, till the last participant in the list that becomes on top in that shift) as many times as the random number that was generated, that you did know in advance, and that you had made its hash public.
The owner of the contest, cannot cheat because he doesn't know how many people will participate in total and the number of shifts will be set in advance.
Better than random.org, for sure Wink Yahoo¬!

~ In cryptography we trust ~

{ Imagine a sequence of bits generated from the first decimal place of the square roots of whole integers that are irrational numbers. If the decimal falls between 0 and 5, it's considered bit 0, and if it falls between 5 and 10, it's considered bit 1. This sequence from a simple integer count of contiguous irrationals and their logical decimal expansion of the first decimal place is called the 'main irrational stream.' Our goal is to design a physical and optical computing system system that can detect when this stream starts matching a specific pattern of a given size of bits. bitcointalk.org/index.php?topic=166760.0 } Satoshi did use a friend class in C++ and put a comment on the code saying: "This is why people hate C++".
misterbigg
Legendary
*
Offline Offline

Activity: 1064
Merit: 1001



View Profile
March 13, 2013, 09:12:18 PM
 #2

Hmm...this is equivalent to pre-generating a random number M and then calculating the winner as M mod N where N is the number of participants and M >> N.
remotemass (OP)
Legendary
*
Offline Offline

Activity: 1117
Merit: 1016


ASMR El Salvador


View Profile WWW
March 13, 2013, 09:18:33 PM
 #3

Yes, only that you could not know for sure if you would win or not in case you were the last participant when you are about to participate.
If you publish the random number instead of its hash you give some advantage to those that are about to be the ultimate participant.

But still the owner of the contest would have that advantage if he could participate himself. And him being able to paricipate himself would make it unfair as I suppose happens with provably fair games: if owner of provably fair game is allowed to participate and play himself, he gets an unfair advantage, as he never looses for participating.

[Edit: well, still in such a scenario he has to pay for bitcoin transaction fees, so may loose something for participating, actually]

{ Imagine a sequence of bits generated from the first decimal place of the square roots of whole integers that are irrational numbers. If the decimal falls between 0 and 5, it's considered bit 0, and if it falls between 5 and 10, it's considered bit 1. This sequence from a simple integer count of contiguous irrationals and their logical decimal expansion of the first decimal place is called the 'main irrational stream.' Our goal is to design a physical and optical computing system system that can detect when this stream starts matching a specific pattern of a given size of bits. bitcointalk.org/index.php?topic=166760.0 } Satoshi did use a friend class in C++ and put a comment on the code saying: "This is why people hate C++".
remotemass (OP)
Legendary
*
Offline Offline

Activity: 1117
Merit: 1016


ASMR El Salvador


View Profile WWW
March 13, 2013, 10:08:31 PM
Last edit: March 13, 2013, 10:27:06 PM by remotemass
 #4

I imagine this working great to ask people to tweet something mentioning the owner of the game in his tweet.
The rules of the game could be that each twitter - like that - that you make will add you to the list as many times, for each time you do it, as you had followers.

For intance, Justin Bieber would add 35,910,776 entries to your contest list each time he did tweet mentioning you and your contest.

This could be automated with bitcoin addresses and everything.
Twitter (or a competitor) could own bitcoin addreses associated with every twitter user account, and automate such games.

'Feedzebirds' comes to my mind...

{ Imagine a sequence of bits generated from the first decimal place of the square roots of whole integers that are irrational numbers. If the decimal falls between 0 and 5, it's considered bit 0, and if it falls between 5 and 10, it's considered bit 1. This sequence from a simple integer count of contiguous irrationals and their logical decimal expansion of the first decimal place is called the 'main irrational stream.' Our goal is to design a physical and optical computing system system that can detect when this stream starts matching a specific pattern of a given size of bits. bitcointalk.org/index.php?topic=166760.0 } Satoshi did use a friend class in C++ and put a comment on the code saying: "This is why people hate C++".
remotemass (OP)
Legendary
*
Offline Offline

Activity: 1117
Merit: 1016


ASMR El Salvador


View Profile WWW
March 13, 2013, 11:05:48 PM
Last edit: March 14, 2013, 01:31:47 AM by remotemass
 #5

You need to hash two times, sure, otherwise is would be easy to find which number it was, but with the second one becomes quite impossible.
So, you would publish in advance
sha256(sha256(randomnumber)) and also the maximum number of participants, exaggerated, and the closing date.
At the closing date you publish the random number for everyone to be able to verify the winner.



<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
<script>
    var hash1 = CryptoJS.SHA256(randomresult);
    var hash2 = CryptoJS.SHA256(hash1);
</script>

[Edit]: actually hashing it two times doesn't make it more secure. Only making the the range for the random number very large, which is not a problem as computers do such modulo operations, even with very large numbers, in fractions of second.

{ Imagine a sequence of bits generated from the first decimal place of the square roots of whole integers that are irrational numbers. If the decimal falls between 0 and 5, it's considered bit 0, and if it falls between 5 and 10, it's considered bit 1. This sequence from a simple integer count of contiguous irrationals and their logical decimal expansion of the first decimal place is called the 'main irrational stream.' Our goal is to design a physical and optical computing system system that can detect when this stream starts matching a specific pattern of a given size of bits. bitcointalk.org/index.php?topic=166760.0 } Satoshi did use a friend class in C++ and put a comment on the code saying: "This is why people hate C++".
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!