Bitcoin Forum
May 07, 2024, 01:04:16 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does Satoshi Dice allow for instant transactions?  (Read 2256 times)
luke.watson (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250



View Profile
March 25, 2013, 05:25:57 PM
 #1

I have made a Bitcoin game which I will want to release.. at some point which will take Bitcoin as payment and allow players to win a prize, like all the best casino games..

But i'd like it to be instant theres not a lot of point having a game which you have to wait 10 minutes each time to play I need a way to make it instant like Satoshi Dice and other similar sites

I understand Satoshi Dice runs on 0 confirmations, is this a safe way to run a game, surely people can double spend their money before the transaction has been confirmed?

I dont really understand how it works so could someone please explain how Satoshi Dice works securely?

I will also need a bit of advice on setting up and IPN so my server knows when a payment has gone through

Cheers Luke
"I'm sure that in 20 years there will either be very large transaction volume or no volume." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
March 25, 2013, 05:45:07 PM
 #2

It's not impossible dude, but he(SatoshiDICE) has already accumulated enough Bitcoins to replenish anything he loses.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1032



View Profile WWW
March 25, 2013, 06:30:40 PM
 #3

0 confirmations are inherently untrustable, SatoshiDice has already learned that through successful double-spends which reclaim gambling bet losses. Very few bets are currently notified of win/loss status before being included in the blockchain - SatoshiDice uses a proprietary formula to determine for themselves what zero-confirmation transactions they think are trustable.
elgreco
Full Member
***
Offline Offline

Activity: 147
Merit: 100



View Profile
March 25, 2013, 06:59:30 PM
 #4

"The SatoshiDice Bitcoin game operates with zero confirmations, meaning the time it takes for you to send a transaction and receive your winnings is near-instant. Bets are evaluated as soon as the client picks up the broadcast. This is safe because it always builds the answering transaction with the output of your bet transaction. This means a blockchain that does not contain your bet cannot contain the site's answer."

1E1GrECoNP1RpvWe72kS5cDZozA47nUFs4
gendal
Member
**
Offline Offline

Activity: 74
Merit: 14


View Profile
March 25, 2013, 07:05:55 PM
 #5

"The SatoshiDice Bitcoin game operates with zero confirmations, meaning the time it takes for you to send a transaction and receive your winnings is near-instant. Bets are evaluated as soon as the client picks up the broadcast. This is safe because it always builds the answering transaction with the output of your bet transaction. This means a blockchain that does not contain your bet cannot contain the site's answer."

The risk SatoshiDice is taking is that you might be employing this strategy:

* If I win, I let the transactions confirm and collect my winnings
* If I lose, I very quickly double-spend the coins I had used in my bet, paying a sufficiently high transaction fee that this transaction is more likely than the original transaction to be included in a block.

This way, I capture my wins and can cancel some (most?) of my losses.

Follow this strategy sufficiently often and it would be net positive over time.

I imagine SD have algorithms that look for this behaviour and cut you off pretty quickly if you try it.

The point is: their "use the output in the input" technique prevents you from double spending winning bets... but, of course, what you really want to do is double spend the *losing* bets!


[Edited - got output and input the wrong way round]
elgreco
Full Member
***
Offline Offline

Activity: 147
Merit: 100



View Profile
March 25, 2013, 07:25:19 PM
 #6



The point is: their "use the output in the input" technique prevents you from double spending winning bets... but, of course, what you really want to do is double spend the *losing* bets!


Ah... makes sense. Didn't think about it that way. Figured whatever you were doing to trigger the doubles-spend would have to be done before you even got a confirmation of a win. But yea, that does leave room for shenanigans.

1E1GrECoNP1RpvWe72kS5cDZozA47nUFs4
luke.watson (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250



View Profile
March 25, 2013, 08:04:20 PM
 #7

Okay so 0 confirms = not safe unless you are Satoshi so I wont worry with that, I guess my site cant be instant but I'll have to look into building user accounts so people dont have to pay per game they can buy 5/10 goes and use them whenever...

Which API do people suggest using I've been looking at this one
https://github.com/blockchain/receive_payment_php_demo which looks like it would do the job with a bit of editing, is there one that people would suggest over it due to ease of use/personal preference?
farlack
Legendary
*
Offline Offline

Activity: 1311
Merit: 1000



View Profile
March 25, 2013, 08:24:21 PM
 #8

Satoshi dice is only instant for cheap bets.
You bet 1 btc you're waiting like 8 minutes
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!