Bitcoin Forum

Alternate cryptocurrencies => Service Announcements (Altcoins) => Topic started by: whysos3rious on May 14, 2016, 12:25:06 AM



Title: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on May 14, 2016, 12:25:06 AM
The first uncheatable Rock Paper Scissors Game on ETH with 2 players duels.

1) Encrypt your Hand with a secret (change it every time) on the website : matching-ethers.com/rps.

2) Send it with 0.1 ETH using the sendEncryptedHand function (in Mist).

3) Be matched with an opponent (follow progress on the real time website and cancel waiting if no opponent comes).

4) You have 2 hours to reveal your hand with the appropriate function.

5) Receive 0.198 ETH if you win or if opponent does not reveal. In case of draw, receive 0.1 ETH.

contract address : 0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32

abi (for import in Mist) and code
http://etherscan.io/address/0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32#code

Enjoy !!
(more details on the website)

http://whysos3rious.com/rps

!! EDIT : Contract ADDRESS UPDATED !!


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: Disruptor on May 14, 2016, 10:01:01 AM
Well done, the code and the website are impressive !

Finally a true RPS game on ETH, another developer made a version I saw but it was flawed and the first player would always lose.

Won my first hand on your game, yeah !


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 14, 2016, 12:33:23 PM
The code written, is not clear, difficult to audit.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 14, 2016, 12:49:27 PM
Thanks for the feedback guys.

The code is complex indeed because it has complex mechanics in order to implement the storage of encrypted hands, the revelation mechanism, the automatic payouts of expiration of duels.
However the lisibility should not be too much of a problem if you know solidity.
The variables names are very clear and there is nothing too fancy.

Also, I'll be happy to answer any question you may have on the code. Just ask :)

Regarding the audit of the code, thanks for your positive feedback Disruptor.
If anyone else who knows solidity wants to audit the code that would be nice. I can provide explanations if needed.

Also if you want to be confident on the security of the game, you can check the contract transaction on etherchain. All is being payout as annonced. After 20 players, the contract has no ether left in apart from the house cut.

Enjoy !



Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: killerjoegreece on May 14, 2016, 12:50:15 PM
The first uncheatable Rock Paper Scissors Game on ETH with 2 players duels.

1) Encrypt your Hand with a secret (change it every time) on the website : matching-ethers.com/rps.

2) Send it with 0.5 ETH using the sendEncryptedHand function (in Mist).

3) Be matched with an opponent (follow progress on the real time website and cancel waiting if no opponent comes).

4) You have 1 hour to reveal your hand with the appropriate function.

5) Receive 0.995 ETH if you win or if opponent does not reveal. In case of draw, receive 0.5 ETH.

contract address : 0xb39a89322379ed7d91dc2e8ae1b30989eaf91d41

abi (for import in Mist) and code
http://etherscan.io/address/0xb39a89322379ed7d91dc2e8ae1b30989eaf91d41#code

Enjoy !!
(more details on the website)

http://whysos3rious.com/rps

this project looks real nice. I will play soon :D


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 14, 2016, 01:47:58 PM
But i congratz you OP, nice idea to encrypt hands.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 14, 2016, 02:18:08 PM
Thanks for the support.

Yes if you use a weak secret (too small or too common), someone may try to bruteforce it. But bruteforce or other forms of hash decoding takes times.

So if you don't wait too long for an opponent and you use a long enough secret, there is no risk of being cheated.
That's the basic assumption of our lovely blockchains :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: sydhelly on May 14, 2016, 03:18:07 PM
I'm waiting for a challenger  8)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: sydhelly on May 14, 2016, 04:41:21 PM
and I won, nice !

Rematch ? :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 15, 2016, 07:19:23 AM
Hehe,
It's nice to see you guys are having fun on the game.

Anyways, everything seems to be working as intended and there is no bug with the contract.
The only transaction that failed was when a player tried to reveal his hand without a secret.
Just one quick question regarding the parameters :

Are you guys happy with the current settings ?

Is 0.5 ETH as gamble value appropriate for you or would you prefer to play only for 0.1 ETH for instance ?
What about the delay to reveal your hand ? Is 1h long enough, would you like more ?





Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 15, 2016, 12:18:02 PM
The only transaction that failed was when a player tried to reveal his hand without a secret.

Yes it was me :p

I succesfully sent from MyEtherWallet, but couldn't build succesfully the string data to reveal, but whatever, i knew i lost by looking at the revealing function the other used .

Everything is clean yes.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 15, 2016, 12:50:53 PM
Ok good to know that the pb with myetherwallet did not make you lose and that you had lost anyways :)
I hope you win next time :)

Thanks for the feedback askolein, much appreciated.

What do you think about the gambling value btw ? Would you prefer to play for less money ?


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 15, 2016, 04:58:04 PM
Gambling value is good.

 0.5 ETH is not negligible, yes and loosing is hard for your ego :p.
 Playing with 1 ETH would be WAY too much with such odds.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 15, 2016, 07:00:03 PM
Ok great thanks a lot for your feedback askolein.

If the players want I could decrease the bet value to 0.25 or 0.1 ETH to play more for fun and less for ETH :)

Let me know what you think :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 15, 2016, 07:20:15 PM
I mean, why not, try with 0.1 and see ! :)  ;)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: DustBluster on May 16, 2016, 02:59:04 AM
Another nice DApp with some good looking code and a useful and clean web interface.  Well done!  :D

The encrypted hand approach you've used is an elegant solution to submitting and later revealing secret information.

The only security risk that stands out is that when the website encrypts a hand it sends the plaintext password to a Node.js server for encrypting.  The Node.js server is presumably under the game authors control, so in theory they could see a player's password and determine what hand was played before choosing what hand to play against it.  The page includes instructions for technically savvy users to encrypt the hand themselves.  I'm not assuming the author has any malicious intent, just identifying that trust is required when using the website to encrypt a hand.

Personally, 0.5 ETH is too much for me for a game of luck.  I'll wager bigger on games of skill and bluffing, but only take very small risks when the outcome is based on luck.  At 0.1 ETH I might play a little.

Good work :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 16, 2016, 09:06:38 AM
Hi Dustbluster,

Thanks a lot for your nice review.

Yes you are right, If I wanted I could monitor the encryption process on the server and know the first player's hands.
I, of course, don't do it a since I want this game to be succesful and fun. My goal is not self profit, I think I won't even repay the server cost at current rates, I do trading for profit but games are mostly for fun :).

Althought, since I can't convince you that I don't monitor the hands, this is why I also explain how user could do it themselves with web3.js if they don't trust my server.

Anyways, I guess that with time and the positive feedback of several happy players, I'll earn some trust :)


Thanks also for the feedback on the wager amount, I'm working on releasing the 0.1 ETH today.



Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 16, 2016, 10:08:30 AM

Yes you are right, If I wanted I could monitor the encryption process on the server and know the first player's hands.
I, of course, don't do it a since I want this game to be succesful and fun. My goal is not self profit, I think I won't even repay the server cost at current rates, I do trading for profit but games are mostly for fun :).


I personnaly uses another Keccak-256 hash online, with my secret + choice, eg : w8w8w9d2@@paper, and send the output. No deal with the website ;)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 16, 2016, 10:36:23 AM
Yes that's a nice idea aswell, any online keccak256 generator works too (warning the sha3 of ethereum is not the same as other algorithm named sha3, so you should really use keccak256 and not other sha3).
Be sure to add 0x to the crypted hash if the generator did not add it itself.



Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 16, 2016, 10:49:34 AM
Taking into account the feedback of the community and the first players of the previous version, I released this morning a new version that allows you to play R.P.S. for only 0.1 ETH.

Win : 0.198 ETH
Draw : 0.1 ETH refunded

You now have 2 hours to reveal your hand once you are matched with an opponent.

I also fixed a few display bugs on the website.

Enjoy !


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 16, 2016, 10:08:10 PM
A more fair function would be to have only one function to reveal, testing the 3 sha3 hand hash comparison and finding out. It would then make the other player to ignore the first reveal, so nobody know yet who wins.

Then, it would allow the players to bet and leave, free to play or not, and if they do not play after 2 hours, both players are refunded, and nobody knows who would have won.

What do you think ;) ;)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 17, 2016, 09:04:31 AM
It is indeed possible to use a single function to reveal that would cost a bit more gas tho. It would keep the move more hidden in the sense that you would not know which function the player used. But you could still see on the EVM (ex on live.ether.camp) what was the move of the player since you have to store the true move somewhere once revealed.

But anyways, I don't understand the next part of your message. You said : ""Then, it would allow the players to bet and leave, free to play or not, and if they do not play after 2 hours, both players are refunded, and nobody knows who would have won.""

Why would it allow more to bet and leave than in the current game ? Right know you can bet and immediatly reveal once your are matched.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: sydhelly on May 17, 2016, 02:21:10 PM
We need more player for this game, I waited 2 hours for an opponent to finally come :(


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: askolein on May 17, 2016, 03:30:35 PM
It is indeed possible to use a single function to reveal that would cost a bit more gas tho. It would keep the move more hidden in the sense that you would not know which function the player used. But you could still see on the EVM (ex on live.ether.camp) what was the move of the player since you have to store the true move somewhere once revealed.

But anyways, I don't understand the next part of your message. You said : ""Then, it would allow the players to bet and leave, free to play or not, and if they do not play after 2 hours, both players are refunded, and nobody knows who would have won.""

Why would it allow more to bet and leave than in the current game ? Right know you can bet and immediatly reveal once your are matched.


I wasn't clear, forgive me ;)

I meant, that, right now, you force people to reveal in less than 2 hours. I imagined this game to be less "stressfull", like, nobody is playing, i bet, i leave, i'm 50% sure i'm going to get back in 2 hours, if i don't, i won't loose, both players will be refunded.


But yeah, speaking of the EVM, you are right, somewhere there must be the "play" saved.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 17, 2016, 03:48:46 PM
Yes that I can do.

Maybe 24hours would be the best time for expiration then.
so you have time to sleep, if it's late :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: dearbesz on May 17, 2016, 07:20:38 PM
how can i join here? :D


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 17, 2016, 08:44:21 PM
0) Import the contract in Mist using the contract address and the contract ABI :

ABI at the bottom of this page : http://etherscan.io/address/0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32#code
contract address : 0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32

1) Encrypt your Hand with a secret (change it every time) on the website : matching-ethers.com/rps. ex input : secret = mamamia and hand = rock ex output : 0x694175464a29105b9e3743992e59ab09559add0bc3d8b16e0e0945f55f68b8f0

2) Send your encryped hand code (ex: 0x694175464a29105b9e3743992e59ab09559add0bc3d8b16e0e0945f55f68b8f0) with 0.1 ETH using the sendEncryptedHand function (in Mist).

3) Be matched with an opponent (follow progress on the real time website and cancel waiting if no opponent comes).

4) You have 2 hours to reveal your hand with the appropriate function. (ex: use revealRock with input your secret)

5) Receive 0.198 ETH if you win or if opponent does not reveal. In case of draw, receive 0.1 ETH.


How to interact with the contract ?

In mist wallet you open the contract that you have just imported and there you can see the interface of the contract. There you can select several functions.

For step 2 you need to use the function named sendcryptedhand . This function asks for an input of 32 characters: use the code you generated at step 1

At step 4 when you will reveal your hand, you use another function on the same page in mist : for instance revealRock and you provide your secret.


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 18, 2016, 07:31:43 AM
The website will be down this morning for a small update.
Stay tuned :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 18, 2016, 09:32:41 AM
The website is back up.

The contract has been updated following your request, the expiration time is now 24hours.
You can now play and come back in time to reveal, you can even sleep and reveal the next day :)

To play don't forget to import the new contract :
0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32

http://etherscan.io/address/0xDD88C4D189585B650a3FE3d0E39147fcca59Ec32#code

Enjoy !!


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: sydhelly on May 18, 2016, 12:56:00 PM
Thanks for the update, that's nicer like that indeed


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 19, 2016, 08:10:16 AM
Ok everything seems to be working properly on the new contract :)


Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 23, 2016, 05:47:21 AM
Don't forget to change your secret every time you play and to use 10 letters/numbers.

You can keep the website open or notepad to store your secret until you reveal.



Title: Re: Play RPS with [ETH] - Uncheatable with crypted Hands !!
Post by: whysos3rious on May 23, 2016, 10:17:43 AM
Crypted RPS was featured on Ether Camp's Blockchain Paparazzi !

A nice review of the game and it covers all the features very well.

Also a reminder to use secure enough passwords :)

http://blog.ether.camp/post/144800327903/the-blockchain-paparazzi-playing-rock-paper


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: sydhelly on May 23, 2016, 02:49:29 PM
Congrats on the article !  8)


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on May 26, 2016, 11:02:03 AM
Thanks for the support guys, happy you like it  :D


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: sydhelly on May 26, 2016, 02:10:49 PM
I have to say, it's nice to be able to play every day with opponents on your game, the wait is never too long now !

Are you planning any new games ?


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on May 28, 2016, 12:37:43 PM
Are you planning any new games ?

Yes :)
There will be more games on the platform www.whysos3rious.com
Can't be too specific for now, but expect some news shortly, maybe 2 wooks ? ;)


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on May 31, 2016, 10:13:23 AM
Expect a game of pure luck :)


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on June 10, 2016, 11:48:27 AM
New game lauching soon :)
Expect more news today !  :D


Title: Re: [ETH] Play Rock Paper Scissors - Featured on ether.camp blog !
Post by: whysos3rious on June 11, 2016, 03:32:46 AM
My new game :
The Rouleth

https://github.com/Bunjin/Rouleth

Launching in 12 hours !

http://imgur.com/9Tmqqor