Bitcoin Forum
November 19, 2024, 11:08:11 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ETH ]*New Round Based Bet Game: Bet On Hash *  (Read 674 times)
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 02, 2016, 08:54:20 AM
Last edit: April 08, 2016, 11:39:41 AM by likegames
 #1

it's a round based bet game (6 players)
you bet on the first byte of the 6th players block hash (unpredictable, 50% chance)

to join:
send one byte data (0x01 or 0x81) with a bet amount of 1 ether to 0x0312855bb6e548578a36fa8de63b8f0d3d7d7dc2
 - or -
send one byte data (0x01 or 0x81) with a bet amount of 0.1 ether (100 finney) to 0x7753a9d834844cfde5c211ec3912b49f0d8b8e11
 - or -
send one byte data (0x01 or 0x81) with a bet amount of 0.01 ether (10 finney) to 0x615d2c5155ea9841f2a926c3a4953d140d407c99

(click address to check the verified contract)

if your data byte is less than 0x80 you bet the 6th players block hash first byte is less than 0x80
if your data byte is greater than or equal 0x80 you bet the 6th players block hash first byte is greater than or equal 0x80

if you lose your bet your bet amount goes to the pool for winners

if you win your bet:
   * you will get back 100% of your payment
   * you will win a proportional part of the winner pool (win amount = winner pool / winners - 1%)

payout is triggered when a player starts the next round

additional rules:
each address can only play once per round
every additional payment during the same round will be paid back immediatly
every payment below the bet value is considered as a donation for the winner pool
every amount that is exceeding the bet value will be paid back
if nobody wins in a round, the paid amounts will raise the winner pool for the next round


how to send a data byte together with Ether:

If you are using Geth or Ethereum Wallet (wich starts Geth in the background):
after typing
Code:
geth attach
in a command line, enter:
Code:
eth.sendTransaction({from: eth.accounts[0], to:'0x7753A9D834844cFDe5C211ec3912b49f0d8B8e11', value:web3.toWei(0.1, "ether"), gas:100000, data:"0x01"})
to send "0x01" and 0.1 Ether to address 0x7753A9D834844cFDe5C211ec3912b49f0d8B8e11.

Change "0x01" to "0x81" if you want to change your bet or change value and address if you want to risk more or less (see original post).

In the GUI of Ethereum Wallet (Mist) just click SEND and after entering the address and the amount click the ADD DATA button and enter 01 or 81 in the input field below the button.
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 03, 2016, 09:48:13 PM
 #2

Did anybody checked the code? It's not a pyramid game! It's more like a Dice Game (with a 2 digit dice) or playing Red or Black on Roulette.
askolein
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
April 03, 2016, 11:37:59 PM
 #3

Did anybody checked the code? It's not a pyramid game! It's more like a Dice Game (with a 2 digit dice) or playing Red or Black on Roulette.


I reviewed the code, it is very pro written, clear and performant.
The owner can never scam you, everything is made to keep your investement like it should be.
The owner can change the number of players, disable the game, stop the round BUT all theses actions always perform a full refunding for all players before.
This is OK IMO.  Wink
etherauction
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
April 04, 2016, 08:46:49 AM
 #4

Neat idea, but trivial to game: Anyone could write a contract that calls this one iff it would be the last player, and win every time.
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 04, 2016, 09:00:51 AM
 #5

Neat idea, but trivial to game: Anyone could write a contract that calls this one iff it would be the last player, and win every time.

That means you did not understand how it works (nor how contracts work). Not the last player wins! Read again ;-)
etherauction
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
April 04, 2016, 09:19:26 AM
 #6

Neat idea, but trivial to game: Anyone could write a contract that calls this one iff it would be the last player, and win every time.

That means you did not understand how it works (nor how contracts work). Not the last player wins! Read again ;-)

I think you're misunderstanding what I'm suggesting. Pseudocode for the contract would look something like this:
 - Read playersPerRound and players.length from the target contract (these variables are public).
 - If we wouldn't be the last player, return.
 - Otherwise, look at the first byte of the current block hash, and base our 'guess' on that. Submit that to the contract.

However, I think I'm mistaken - transactions can't access the hash of the block they're in, since it's only computed after the transactions run. It'd still be trivial for a miner to game this, though, by only including the transaction if it causes them to win.
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 04, 2016, 10:10:50 PM
 #7


However, I think I'm mistaken - transactions can't access the hash of the block they're in, since it's only computed after the transactions run. It'd still be trivial for a miner to game this, though, by only including the transaction if it causes them to win.

Theoretically may be. But I don't think it is really possible nor trivial in practice. There is not only one miner. And while the one tries to find a hash with and without his transaction other miners will already submitting new blocks. And btw. it would not be worth the amount he can win ;-).
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 05, 2016, 12:36:18 PM
 #8

Just added a new contract for those who want to play with more than 0.1 Ether.

To join send one byte data (0x01 or 0x81) with a bet amount of 1 ether to 0x0312855bb6e548578a36fa8de63b8f0d3d7d7dc2

In the best case you can win 4.95 Ether (almost 5 times of your invest)  Smiley

see original post or verified contract for more details.
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 08, 2016, 11:38:37 AM
 #9

Just in case somebody does not know how to send a data byte together with Ether:

If you are using Geth or Ethereum Wallet (wich starts Geth in the background):
after typing
Code:
geth attach
in a command line, enter:
Code:
eth.sendTransaction({from: eth.accounts[0], to:'0x7753A9D834844cFDe5C211ec3912b49f0d8B8e11', value:web3.toWei(0.1, "ether"), gas:100000, data:"0x01"})
to send "0x01" and 0.1 Ether to address 0x7753A9D834844cFDe5C211ec3912b49f0d8B8e11.

Change "0x01" to "0x81" if you want to change your bet or change value and address if you want to risk more or less (see original post).

In the GUI of Ethereum Wallet (Mist) just click SEND and after entering the address and the amount click the ADD DATA button and enter 01 or 81 in the input field below the button.
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 09, 2016, 10:52:20 AM
 #10

Already 2 Gamblers in round 16. Only 4 more needed to end this round ... Give it a try!
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 13, 2016, 03:32:28 PM
 #11


I reviewed the code, it is very pro written, clear and performant.
The owner can never scam you, everything is made to keep your investement like it should be.
The owner can change the number of players, disable the game, stop the round BUT all theses actions always perform a full refunding for all players before.
This is OK IMO.  Wink

Thanks for the review!
likegames (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 30, 2016, 11:27:59 PM
 #12

The game is still running and round 16 finished with 4 winners. Every winner was paid out 149% of their payment.
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!