Pages:
Author

Topic: In which language top gambling sites are coded ? - page 5. (Read 12759 times)

m19
full member
Activity: 186
Merit: 100
Any ideas on where the most gambling sites are hosted? Most of them use CloudFlare so you can't easily find the actual hosting provider.
legendary
Activity: 2394
Merit: 1216
The revolution will be digital
member
Activity: 109
Merit: 10
What about Primedice? Love to make one soon.
legendary
Activity: 2226
Merit: 1052
No, AJAX would be terrible, you would have A LOT of requests, basically every second. You really should use a socket for that.

However, you can definitely make a socket server in PHP. There are some libraries for it too: Ratchet, React, Wrench, PHudBase, PHPws, etc.

A socket is an open connection between the client (browser) and server with bidirectional communication. If you make a bet, you send the info through the socket (and you get the result) and if others bet you get the bets from there. So it's all real-time, you only connect once. There are different libraries/servers for this, Socket.io is a popular one made in node.js. Perfect for a dice site.

An alternative is indeed getting new data with AJAX requests. With that, the browser would make a connection/request every x seconds to see if there are new bets. Obviously for a dice site this would be pretty terrible and give big lag and other problems. However AJAX is useful for other purposes.

I was checking the All Bets section of www.onedice.me ...is not this data refreshing is done through Ajax ?
legendary
Activity: 1876
Merit: 1295
DiceSites.com owner
No, AJAX would be terrible, you would have A LOT of requests, basically every second. You really should use a socket for that.

However, you can definitely make a socket server in PHP. There are some libraries for it too: Ratchet, React, Wrench, PHudBase, PHPws, etc.

A socket is an open connection between the client (browser) and server with bidirectional communication. If you make a bet, you send the info through the socket (and you get the result) and if others bet you get the bets from there. So it's all real-time, you only connect once. There are different libraries/servers for this, Socket.io is a popular one made in node.js. Perfect for a dice site.

An alternative is indeed getting new data with AJAX requests. With that, the browser would make a connection/request every x seconds to see if there are new bets. Obviously for a dice site this would be pretty terrible and give big lag and other problems. However AJAX is useful for other purposes.
legendary
Activity: 2226
Merit: 1052
What is the problem with HMAC-SHA512? If there is no problem with it, why use a weaker alternative?

Speed? (No seriously.) You know what, maybe it was just a dumb question, who is going to notice the speed difference even when you have a few thousand players online at the same time on one server. But I had to ask it anyway. I did some quick research, and I think I won't go with MD5 or SHA1 at least.

Someone else made this speed test on the hash functions:

Code:
MD5     10.275190830230713, 10.155328989028931, 10.250311136245728
SHA1    11.985718965530396, 11.976419925689697, 11.86873197555542
SHA256  16.662450075149536, 21.551337003707886, 17.016510963439941
SHA512  18.339390993118286, 18.11187481880188,  18.085782051086426

atodorov.org/blog/2013/02/05/performance-test-md5-sha1-sha256-sha512/

And there's an older one here: http://www.cryptopp.com/benchmarks.html

The HMAC, if I understand it correctly, does two hashing calculations. So if MD5 = 20, and SHA512 = 36 ... (Okay okay, maybe it's a really dumb question.)

Quote
The main statement hashes all 10000 entries one by one. This statement is executed 1000 times in a loop, which is repeated 3 times.

So if I understand it correct it takes 18 seconds to make 30,000,000 SHA512 hashes according to that test? That's like 0.000006 second/hash? Sure MD5/SHA1 is 2x faster, but still it's basically nothing.

Better make sure your server, database, code (including client-side), etc. are all good than fixing non-issues :p

I think a simple PHP-MySQL dice site may run fine on amazon cloud with real time update achieved by Ajax. All those node.js, socket.io seems redundant !!!
sr. member
Activity: 323
Merit: 254
Dicebitco.in? its not safe after the issues. I would rather stay away from it

I dont think this thread was saying anything about the safety of the site, just what it's coded in..
legendary
Activity: 1876
Merit: 1295
DiceSites.com owner
What is the problem with HMAC-SHA512? If there is no problem with it, why use a weaker alternative?

Speed? (No seriously.) You know what, maybe it was just a dumb question, who is going to notice the speed difference even when you have a few thousand players online at the same time on one server. But I had to ask it anyway. I did some quick research, and I think I won't go with MD5 or SHA1 at least.

Someone else made this speed test on the hash functions:

Code:
MD5     10.275190830230713, 10.155328989028931, 10.250311136245728
SHA1    11.985718965530396, 11.976419925689697, 11.86873197555542
SHA256  16.662450075149536, 21.551337003707886, 17.016510963439941
SHA512  18.339390993118286, 18.11187481880188,  18.085782051086426

atodorov.org/blog/2013/02/05/performance-test-md5-sha1-sha256-sha512/

And there's an older one here: http://www.cryptopp.com/benchmarks.html

The HMAC, if I understand it correctly, does two hashing calculations. So if MD5 = 20, and SHA512 = 36 ... (Okay okay, maybe it's a really dumb question.)

Quote
The main statement hashes all 10000 entries one by one. This statement is executed 1000 times in a loop, which is repeated 3 times.

So if I understand it correct it takes 18 seconds to make 30,000,000 SHA512 hashes according to that test? That's like 0.000006 second/hash? Sure MD5/SHA1 is 2x faster, but still it's basically nothing.

Better make sure your server, database, code (including client-side), etc. are all good than fixing non-issues :p
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
What is the problem with HMAC-SHA512? If there is no problem with it, why use a weaker alternative?

Speed? (No seriously.) You know what, maybe it was just a dumb question, who is going to notice the speed difference even when you have a few thousand players online at the same time on one server. But I had to ask it anyway. I did some quick research, and I think I won't go with MD5 or SHA1 at least.

Someone else made this speed test on the hash functions:

Code:
MD5     10.275190830230713, 10.155328989028931, 10.250311136245728
SHA1    11.985718965530396, 11.976419925689697, 11.86873197555542
SHA256  16.662450075149536, 21.551337003707886, 17.016510963439941
SHA512  18.339390993118286, 18.11187481880188,  18.085782051086426

atodorov.org/blog/2013/02/05/performance-test-md5-sha1-sha256-sha512/

And there's an older one here: http://www.cryptopp.com/benchmarks.html

The HMAC, if I understand it correctly, does two hashing calculations. So if MD5 = 20, and SHA512 = 36 ... (Okay okay, maybe it's a really dumb question.)
legendary
Activity: 1876
Merit: 1295
DiceSites.com owner
What is the problem with HMAC-SHA512? If there is no problem with it, why use a weaker alternative?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Speaking of which, almost everyone is using HMAC-SHA-512.

Since HMAC is not broken, why not use HMAC-SHA-1 (which is what Google Authenticator 2FA uses) for the dice rolls? Or if that's questionable, why not HMAC-SHA-256?

In fact, HMAC-MD5 would probably work fine. (MD5 is broken, but not HMAC.)

You'll have a few gamblers trying to figure out the secrets.

Also, I thought I might ask here since all these sites are here, how do you get an unbiased roll of a 6 sided dice based on binary input (such as the hash result). The only thing I can think of is using the discard method. If I don't discard, there is a bias. On one hex digit, that's .25, on two, that's 0.015625.

Some sites use 5 digits, then discard if too high, for their million sided dice. I could use, maybe 12 hex digits for a trillion sided dice without discarding, while the bias may exist, it's too small at the point. (Who the hell is going to do a trillion rolls on one set of seeds to find out ... well, there's me ...)

So, as an alternative, I thought of inventing a new game using 8 sided dice instead. Much easier to map out to a hex digit, no bias. (Oh, I know I could just use a thousand sided dice, or a million sided dice like any of the top 5 dice sites, but I'm trying to do something different.)
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Please ask him how is he currently accepting payment from customers ? AFAIK PayPal does not allow to do gambling payment. Moreover, does he have a license ?

I'll ask. I don't know anything yet and can't make any assumptions, I was just guessing based on the story. (Also, supposedly a friend of a friend, so that's going to be a bit more difficult to track down.)
legendary
Activity: 2226
Merit: 1052
Hmmm..... you know, I recently heard about this guy in my country (Philippines) that runs an online casino. I don't know which one, but he has an office somewhere in Makati and he's got a staff of 100 people (probably customer support.)

I'm pretty sure it's not a bitcoin casino.

I'll try to get in touch, but it would seem I would have a difficult time getting an appointment; unless I point out to him that "Hey, if you accept bitcoin deposits, you save 3% from all those real-bank transaction fees."

Do you guys have a suggestion what I should use if I wanted to run my own dice site? Are all these sites using VPS or Amazon or something? Seems like Node.js is a good start.

I'd almost have to be some Massively Multiplayer Dice Playing Game, ... World of Dicecraft or something - I wouldn't use that particular name... (there's Dragon's Tale, too.)

And I'm left wondering if I just use IRC for the chat part, but then I'd have to worry about ops and channel maintenance.

Please ask him how is he currently accepting payment from customers ? AFAIK PayPal does not allow to do gambling payment. Moreover, does he have a license ?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Hmmm..... you know, I recently heard about this guy in my country (Philippines) that runs an online casino. I don't know which one, but he has an office somewhere in Makati and he's got a staff of 100 people (probably customer support.)

I'm pretty sure it's not a bitcoin casino.

I'll try to get in touch, but it would seem I would have a difficult time getting an appointment; unless I point out to him that "Hey, if you accept bitcoin deposits, you save 3% from all those real-bank transaction fees."

Do you guys have a suggestion what I should use if I wanted to run my own dice site? Are all these sites using VPS or Amazon or something? Seems like Node.js is a good start.

I'd almost have to be some Massively Multiplayer Dice Playing Game, ... World of Dicecraft or something - I wouldn't use that particular name... (there's Dragon's Tale, too.)

And I'm left wondering if I just use IRC for the chat part, but then I'd have to worry about ops and channel maintenance.
legendary
Activity: 2226
Merit: 1052
Yes, you need to run Node.js so you will need an own server (perhaps there are very few shared hosting packages that do support it.)

However you can always try it locally Smiley (and/or in a VM)

Thank U for the clarification...

Does anyone know how many concurrent connection a gambling site experience at most ? Here I'm talking about the Web Server connection... NOT DB connection.
m19
full member
Activity: 186
Merit: 100
We use mySQL & mongo for db (satoshibet)

Is not MongoDB a NoSQL database ? Can it go hand in hand with a RDBMS like MySQL ?

It could be they use MongoDB for session storage. Although I personally prefer Redis for that.

Using a good ORM you can query both MySQL and MongoDB with the same syntax. For example Waterline ORM can do this.
legendary
Activity: 2226
Merit: 1052
We use mySQL & mongo for db (satoshibet)

Is not MongoDB a NoSQL database ? Can it go hand in hand with a RDBMS like MySQL ?
member
Activity: 67
Merit: 10
We use mySQL & mongo for db (satoshibet)

That's an odd combo, are you using mongo to cache numbers? (if you don't mind me asking)
legendary
Activity: 1876
Merit: 1295
DiceSites.com owner
Yes, you need to run Node.js so you will need an own server (perhaps there are very few shared hosting packages that do support it.)

However you can always try it locally Smiley (and/or in a VM)
legendary
Activity: 2226
Merit: 1052
Well, for example pocketdice.io sends a PHPSESSID cookie, so it's safe to say they use PHP ( https://pocketdice.io/index.php works too Wink). Besides that, you can easily see the socket.io socket.


A socket is an open connection between the client (browser) and server with bidirectional communication. If you make a bet, you send the info through the socket (and you get the result) and if others bet you get the bets from there. So it's all real-time, you only connect once. There are different libraries/servers for this, Socket.io is a popular one made in node.js. Perfect for a dice site.

An alternative is indeed getting new data with AJAX requests. With that, the browser would make a connection/request every x seconds to see if there are new bets. Obviously for a dice site this would be pretty terrible and give big lag and other problems. However AJAX is useful for other purposes.

Is there any special server setup required to run Node.js & socket.io ? Can I try it on a PHP-MySQL shared hosting ?
Pages:
Jump to: