Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: 600watt on March 31, 2019, 06:46:54 AM



Title: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 06:46:54 AM
dear forum members,


I would like to start a betting game within this forum. a simple price prediction game about the price of btc end of the year. whoever wants to participate needs to pay some fraction of btc. winning bet takes it all. usually an escrow would be needed to collect the btc of the participants and later pays out to the winner. but since btc is programmable money I rather not rely on an escrow but on a smart contract that:

-controls the btc address that the betting game participants are using to pay their fee
-recognizes what the price is on a certain exchange at a certain time (bitstamp $ price on dec 31st 2019)
-recognizes which bet is closest to actual price
-transfers the btc to the winner automatically


is that possible? if yes, how complicated? whom can i ask to write it? how can I be sure the programmer is not scamming me/us?

plan is to make it as expensive as 0.1 btc to place a bet. for those who donīt want to risk that much it is allowed to for a pool (for example 10 members pay 0.01 and form a pool that can place a bet) my aim is 50 bets minimum, so the winner will collect 5 btc.


thank you  :)


edit:

some think that an entry price of 0.1 btc to too high. the idea is that members could team up and form a pool.  a team devides the entry price within themselves. if 10 members form a pool it lowers their individual entry for a bet 10x. they would only invest 0.01 btc. if that is still too much they can find more members to form an even bigger pool.



Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: machasm on March 31, 2019, 07:58:53 AM
I can't help with the smart contract but would suggest that the number of participants be increased and the entry price lowered. So it appeals to more people.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 08:07:52 AM
I can't help with the smart contract but would suggest that the number of participants be increased and the entry price lowered. So it appeals to more people.


entry price can be lowered by participants themselves. you can team up with as many members as you wish and form a pool. if, for example 2 participants form a pool then their entry is not 0.1, but 0.05 for each. when 10 members form a team then it is only 0.01 btc.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Pmalek on March 31, 2019, 08:14:04 AM
Smart contracts are a thing of Ethereum. Bitcoin can work with smart contracts only on a side chain. RSK is a smart contract network created for the Bitcoin network. https://www.rsk.co/
Not sure what else is available when it comes to smart contracts and bitcoin.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Globb0 on March 31, 2019, 08:47:27 AM
Yeah I was thinking the idea through. Some thoughts, not about the contracts bit.

Cost
0.1 might limit participants
0.01 if you get 10 times the people will be the same prize.
Community thoughts on this advised to be sought


Price guesses
The should probably a guess at fixed range instead of a set price say 3500 to 3549   (preset slots)


Other thoughts
Allowing multiple entries would enable someone who wanted to bet 0.1 to have the same odds as in the higher roller version

Rules set and guidance notes
Need some rules and guidance around what if a blank space wins, how do you determine the winner and when etc.
Perhaps on a blank, it goes to the next highest entrant, that might encourage a few extra higher bets with a big "luck" range


I was only thinking escrow tbh, I don't know much about smart contract except my million nothing tokens on ether somewhere.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: djhomeschool on March 31, 2019, 08:55:12 AM
Yeah I was thinking the idea through. Some thoughts, not about the contracts bit.

Cost
A - 0.1 might limit participants
0.01 if you get 10 times the people will be the same prize.
Community thoughts on this advised to be sought


Price guesses
B - The should probably a guess at fixed range instead of a set price say 3500 to 3549


Other thoughts
Allowing multiple entries would enable someone who wanted to bet 0.1 to have the same odds as in the higher roller version

Rules set and guidance notes
Need some rules and guidance around what if a blank space wins, how do you determine the winner and when etc.
Perhaps on a blank, it goes to the next highest entrant, that might encourage a few extra higher bets with a big "luck" range


I was only thinking escrow tbh, I don't know much about smart contract except my million nothing tokens on ether somewhere.


A - Uh no....
B - Maybe it's better to go for set price or closest to it.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 09:05:36 AM
Yeah I was thinking the idea through. Some thoughts, not about the contracts bit.

Cost
0.1 might limit participants
0.01 if you get 10 times the people will be the same prize.
Community thoughts on this advised to be sought


Price guesses
The should probably a guess at fixed range instead of a set price say 3500 to 3549


Other thoughts
Allowing multiple entries would enable someone who wanted to bet 0.1 to have the same odds as in the higher roller version

Rules set and guidance notes
Need some rules and guidance around what if a blank space wins, how do you determine the winner and when etc.
Perhaps on a blank, it goes to the next highest entrant, that might encourage a few extra higher bets with a big "luck" range


I was only thinking escrow tbh, I don't know much about smart contract except my million nothing tokens on ether somewhere.


I also thought of the range but we are still thinking for best rules etc

I maybe would think closest to a price like for example I choose  7000 than between a determined number let us say 20 "still thinking what would be good" nobody can choose anything between 6980 and 7020 or so, maybe higher number?

cause of-course many chose later on because its not fun to get someone a dollar above your price, certainly not when there is some @stake from your own pocket.

and a blank never can win if the closest to it wins...

if 0.1 is to high then maybe 0.05 or so? cause the option to make a pool is still their and its the same thing ...

also I don't know is it best one player one guess or could we allow more guesses from a single person? its stays the same and its better for the price pool of-course ...

still everybody keep the idea's coming

THX and sure its a good idea from 600watt


also we can ask a good forum member to HOLD the send BTC, maybe for a game like this one will do it for free, cause its all that goes in goes to the winner 




Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: LoyceV on March 31, 2019, 09:13:46 AM
I tried something similar (https://bitcointalk.org/index.php?topic=2933474.0) with a 0.001BTC buy-in, and nobody joined.
Micgoossens runs free prediction games (https://bitcointalk.org/index.php?topic=5122750.msg50363991#msg50363991), and got 155 entries in the most recent one.

I don't think you'll find anything close to 50 participants willing to pay 0.1BTC.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 09:37:53 AM
I tried something similar (https://bitcointalk.org/index.php?topic=2933474.0) with a 0.001BTC buy-in, and nobody joined.
Micgoossens runs free prediction games (https://bitcointalk.org/index.php?topic=5122750.msg50363991#msg50363991), and got 155 entries in the most recent one.

I don't think you'll find anything close to 50 participants willing to pay 0.1BTC.

maybe, but also never know it maybe could intrest more other people... like they do a raffle for an item, there the host wins some, here the winner takes all and their is a chance to play with a small amount and maybe to win some FULL BTC, and if it wouldn't work then it was just a try :)
but i like the idea


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 10:08:58 AM
I tried something similar (https://bitcointalk.org/index.php?topic=2933474.0) with a 0.001BTC buy-in, and nobody joined.
Micgoossens runs free prediction games (https://bitcointalk.org/index.php?topic=5122750.msg50363991#msg50363991), and got 155 entries in the most recent one.

I don't think you'll find anything close to 50 participants willing to pay 0.1BTC.


maybe if we team up and try again it will gain some traction. I plan to find some sponsors who are willing to spice up the amount that can be won. I already have one member who is willing to donate 1 btc for this game.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 10:20:36 AM
Yeah I was thinking the idea through. Some thoughts, not about the contracts bit.

Cost
0.1 might limit participants
0.01 if you get 10 times the people will be the same prize.
Community thoughts on this advised to be sought


Price guesses
The should probably a guess at fixed range instead of a set price say 3500 to 3549


Other thoughts
Allowing multiple entries would enable someone who wanted to bet 0.1 to have the same odds as in the higher roller version

Rules set and guidance notes
Need some rules and guidance around what if a blank space wins, how do you determine the winner and when etc.
Perhaps on a blank, it goes to the next highest entrant, that might encourage a few extra higher bets with a big "luck" range


I was only thinking escrow tbh, I don't know much about smart contract except my million nothing tokens on ether somewhere.


I also thought of the range but we are still thinking for best rules etc

I maybe would think closest to a price like for example I choose  7000 than between a determined number let us say 20 "still thinking what would be good" nobody can choose anything between 6980 and 7020 or so, maybe higher number?

cause of-course many chose later on because its not fun to get someone a dollar above your price, certainly not when there is some @stake from your own pocket.

and a blank never can win if the closest to it wins...

if 0.1 is to high then maybe 0.05 or so? cause the option to make a pool is still their and its the same thing ...

also I don't know is it best one player one guess or could we allow more guesses from a single person? its stays the same and its better for the price pool of-course ...

still everybody keep the idea's coming

THX and sure its a good idea from 600watt


also we can ask a good forum member to HOLD the send BTC, maybe for a game like this one will do it for free, cause its all that goes in goes to the winner 





ranges seem a good idea.

how about $50 slots? if one wants to bet $6100 the bet would cover a range between 6100 and 6149.99 

if winning/actual price is not covered by bet then the closest one wins. it is possible that the actual price will be right in the middle of two bets. then both bets win 50% of price.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 10:42:33 AM
I tried something similar (https://bitcointalk.org/index.php?topic=2933474.0) with a 0.001BTC buy-in, and nobody joined.
Micgoossens runs free prediction games (https://bitcointalk.org/index.php?topic=5122750.msg50363991#msg50363991), and got 155 entries in the most recent one.

I don't think you'll find anything close to 50 participants willing to pay 0.1BTC.


maybe if we team up and try again it will gain some traction. I plan to find some sponsors who are willing to spice up the amount that can be won. I already have one member who is willing to donate 1 btc for this game.

WoW with free gifts it surely Will get Some traction
Then it get way more interesting for people to join with Some extra to win
Nicely done

And Maybe Some taking more than 1 slot as well.... etc


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: LoyceV on March 31, 2019, 10:47:11 AM
cause of-course many chose later on because its not fun to get someone a dollar above your price, certainly not when there is some @stake from your own pocket.
I came up with the (rather complicated (https://bitcointalk.org/index.php?topic=2933474.0)) system of signing a message, posting the signature, and keeping the message private until everybody has joined. That gives all participants equal opportunities and you can't choose a dollar above someone else's guess.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 10:50:08 AM
Like also if someones friend is interested and wanna bid under a members name...?

Like i take my price and Maybe Some friend of me wanna participate as well and i take another guess for them or so....

I think it could gain Some traction but we Will see ofcourse and the donated BTc Will surely make it very appealing to participate imo


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 11:13:15 AM
cause of-course many chose later on because its not fun to get someone a dollar above your price, certainly not when there is some @stake from your own pocket.
I came up with the (rather complicated (https://bitcointalk.org/index.php?topic=2933474.0)) system of signing a message, posting the signature, and keeping the message private until everybody has joined. That gives all participants equal opportunities and you can't choose a dollar above someone else's guess.

it would be indeed a good thing if participants would not know what others picked. i am afraid though that if we start to make signing messages mandatory we will lose participants who need/want it easy. how about that bets be set only through PM towards "game managers" (for example micgossens) who then publishes the bet but leaves out the picked value. it would look like

"april 24th 2019: member mr example has placed a valid bet on $xxxx. btc fee is paid."

if two bets want the same spot, the later incoming bet gets notified that slot was taken already and that he/they need to pick a different slot.  on a certain date AFTER the betting is closed, all real bet values get published.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Last of the V8s on March 31, 2019, 11:21:56 AM
the slots are way too big as currently envisaged - $50. all the most sensible slots would get snapped up very quickly

smart contracts are not a thing in bitcoin.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 11:30:30 AM
the slots are way too big as currently envisaged - $50. all the most sensible slots would get snapped up very quickly

smart contracts are not a thing in bitcoin.



can there be script that executes such a contract? if not then we would have to have an escrow or mic or me are doing this.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Last of the V8s on March 31, 2019, 11:44:14 AM
the slots are way too big as currently envisaged - $50. all the most sensible slots would get snapped up very quickly

smart contracts are not a thing in bitcoin.

can there be script that executes such a contract? if not then we would have to have an escrow or mic or me are doing this.

no. it's totally unrealistic at this stage. maybe Augur or something is working on that sort of thing but it's not safe and not necessary.
escrow is fine and proven


further thoughts - you might have to pay the escrow
actually keep the number of entrants small, keep it down to known forum entities, otherwise you will have to have address signing.
people may be more willing to take part if a % of the pot goes to a charity


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: LoyceV on March 31, 2019, 11:58:38 AM
it would be indeed a good thing if participants would not know what others picked. i am afraid though that if we start to make signing messages mandatory we will lose participants who need/want it easy. how about that bets be set only through PM towards "game managers" (for example micgossens) who then publishes the bet but leaves out the picked value. it would look like
I choose signed messages to make it provably fair: everyone is responsible for keeping his own guess safe. The problem with using a game manager is that it can't be verified he doesn't share the numbers in private, and even if he doesn't share them, he can never prove that he didn't. One way or another, it can lead to drama.

we would have to have an escrow or mic or me are doing this.
A multisig escrow could work too.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Last of the V8s on March 31, 2019, 12:04:07 PM
random slots for entrants would solve some of the problems but create others  :-\
just a thought


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 12:31:31 PM
I also would ask someone "minerjones or someone" to just make a BTC address receive all the participating BTC's....

but not myself, cause a highly trusted member would be more satisfying for people I think to participate.... 

and I think we can maybe find someone who's willing to do this for free, a community game "free escrow donation if we are lucky"




Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on March 31, 2019, 12:36:56 PM
it would be indeed a good thing if participants would not know what others picked. i am afraid though that if we start to make signing messages mandatory we will lose participants who need/want it easy. how about that bets be set only through PM towards "game managers" (for example micgossens) who then publishes the bet but leaves out the picked value. it would look like
I choose signed messages to make it provably fair: everyone is responsible for keeping his own guess safe. The problem with using a game manager is that it can't be verified he doesn't share the numbers in private, and even if he doesn't share them, he can never prove that he didn't. One way or another, it can lead to drama.

we would have to have an escrow or mic or me are doing this.
A multisig escrow could work too.


very good idea!


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: El duderino_ on March 31, 2019, 12:58:50 PM
whats a multisig escrow?  sorry  ::)


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: LoyceV on March 31, 2019, 01:24:01 PM
whats a multisig escrow?  sorry  ::)
I'm going to be lazy: https://en.bitcoin.it/wiki/Multisignature :)


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Hueristic on March 31, 2019, 04:42:04 PM
Here is another idea, instead people forming pools.

You can add to the contract code to pay out the number of bets multiplied by the number of entrants bet level and then the contract will subtract that and continue to the next place winner if the first did not empty the account and so forth.

Then anyone could send what ever amount they wanted even more than .1


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: vit05 on April 04, 2019, 04:08:37 PM
Your topic reminded me of a game called secondstotrade. It was a fun game and lots of people relied on it. Until that was proven to be a scam. Smartcontracts is a very interesting idea to build a game like that, but it is still not easy to achieve using the Bitcoin framework. Eventually you will need some confidence in a person. And this is always complicated.


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: Hueristic on April 04, 2019, 05:47:39 PM
I would get in touch with these guys at rootstock and see if they will provide the code for you.

https://blockgeeks.com/guides/ultimate-guide-rootstock-blockchain/

It would bring attention to their project which looks like its aim is to make ETH redundant and I'm all for that. :D

If you do you might want to mention changing from RSK would be a good idea it just brings to mind risky. Lol


Title: Re: smart contract (btc) that pays out winning bet in price prediction game?
Post by: 600watt on April 08, 2019, 09:21:56 AM
I would get in touch with these guys at rootstock and see if they will provide the code for you.

https://blockgeeks.com/guides/ultimate-guide-rootstock-blockchain/

It would bring attention to their project which looks like its aim is to make ETH redundant and I'm all for that. :D

If you do you might want to mention changing from RSK would be a good idea it just brings to mind risky. Lol

i will try that, nice link!
i asked some people at the understandingbitcoin conference in malta and they said it is not possible to write a script that securely/safely executes a bet. but maybe rootstock has a solution.

if it does not work via a script/contract then we have to do it with escrow and multisig. maybe we ask some guys well known in the community with a good reputation and do a 3 out of 5 multisig including micgoossens and me.