Bitcoin Forum
November 13, 2018, 07:08:27 PM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 »  All
  Print  
Author Topic: [Free Script] Untitled Dice - Run your own bitcoin dice site (no server needed)  (Read 62516 times)
dan
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
May 16, 2015, 08:17:46 PM
 #1

Update: I built this for the Moneypot API as it was when RHavar founded it. Since then, Moneypot is under new ownership and its API has possibly changed. I will not be updating this script. You'll need to know some Javascript to maintain it. I don't offer any technical support.


Untitled Dice v0.0.8
Run your own dice site without funding your own bankroll and without risking your own money


Live Demo:
https://untitled-dice.github.io



Source Code:
https://github.com/untitled-dice/untitled-dice.github.io


http://i.imgur.com/dTwOR01.png


What is it?

Untitled Dice is a bare-bones bitcoin dice casino built on top of the Moneypot.com gambling API that lets anyone run their own dice site by cloning and modifying this project.

Since Moneypot handles the user accounts, betting, faucet, and chat, Untitled Dice does not need a server of its own. It's fully client-side (just some javascript files), so it can be hosted anywhere including Github.

Features

- Chat box
- Hotkeys
- Faucet
- Provably fair verification
- Serverless: Host it anywhere that hosts html and javascript files
- Free bankroll: Since your users bet against Moneypot's bankroll, you risk no money and the profits are shared between you, Moneypot, and Moneypot's investors. See: https://www.moneypot.com/investment
- 1% house edge

Want to run your own dice site?

1. Clone this project's code (https://github.com/untitled-dice/untitled-dice.github.io) or get the latest stable release here: https://github.com/untitled-dice/untitled-dice.github.io/releases
2. Create an app at Moneypot.com (https://www.moneypot.com/apps/new)
3. Modify the config (most importantly the config.app_id) at the top of the app.js file (https://github.com/untitled-dice/untitled-dice.github.io/blob/2d3b14c7f5fae0c81a810fd62e378f7e63099d44/app.js#L4-L21)
4. Do whatever you want with the code. Rebrand it completely. Change the colors. Improve the code. Make it your own. Just keep an eye on this thread and the github repo to look out for any updates you may want to backport into your clone.

Questions?

Just ask here. Smiley

If you need 1-on-1 support, you can find me lurking on MoneyPot's Slack (http://slack.moneypot.com/), username is `dan` just like here. Smiley Though note that this is just a hobby project so I can only provide limited support as time allows.

FAQ

Q: My faucet won't work
A: The faucet uses Google ReCaptcha to prevent abuse, so you sign your website up with ReCaptcha here: https://www.google.com/recaptcha/intro/index.html - Once you register your site there, ReCaptcha will give you a site_key and a site_secret. Your site_key goes into the config at the top of app.js, and your site_secret goes into the "Edit App" page for your app - you will see a field called "Recaptcha Secret".

Q: What commands are available in the chatbox?
A: Only app owners and mods can use commands.
Code:
COMMAND                         DESCRIPTION
/mute <username> <duration>     Mute <username> for <duration>
/unmute <username>              Unmute <username>

EXAMPLES
/mute foo forever               Mute user "foo" forever
/mute foo 10 min                Mute user "foo" for 10 minutes
/mute foo 30 sec                Mute user "foo" for 30 seconds
/mute foo 1 day                 Mute user "foo" for 1 day
/unmute foo                     Unmutes user "foo"

TODO list and things I need to improve:

- Implement auto-better
- Implement an "All Bets" tab
- Let user set client-seed. It defaults to 0 right now.
- [Implemented in v0.0.7] Display timestamps in chat
- [Fixed in v0.0.3] Right now, the chatbox always scrolls to the last message every time someone chats. This is very annoying when you're trying to scroll back to read previous conversation because the chat will keep jerking you to the latest message. I need to fix it so that the chat only scrolls if you are viewing the latest message.

Changelog:

v0.0.8 (13 August 2015): Added configurable house edge (minor but often-requested feature)
- You can now configure the script's house-edge in the configuration settings at the top of app.js (default is 1%)

v0.0.7 (13 August 2015): Upgrades to Moneypot's new socket-/chat-server (Vastly improves the Untitled-Dice experience. Recommended upgrade!)
- Read more here: https://bitcointalk.org/index.php?topic=1062680.msg12135241#msg12135241
- Chat messages and mutes are now saved in Moneypot's database and will not be forgotten when the chat-server resets
- Mods now have the power to /mute and /unmute
- The UI instantly updates to reflect changes in the user's confirmed and unconfirmed balance (when they deposit bitcoin to your app's bitcoin address)
- Chat messages now have a HH:MM timestamp

v0.0.6 (3 June 2015): Very minor/skippable release
- Made bet validation errors more user-friendly: https://bitcointalk.org/index.php?topic=1062680.msg11524765#msg11524765

v0.0.5 (2 June 2015):
- Added Deposit and Withdraw dialog links to navbar so users can move money in and out of untitled-dice without navigating to Moneypot. Read more at https://www.moneypot.com/api-docs#dialogs

v0.0.4:
- Fixed bug where betting high would have house of edge of 1.02% instead of 1.00% - https://github.com/untitled-dice/untitled-dice.github.io/blob/1beabd04d13dd0d619498dc198b165c3a5c6b0d3/app.js#L67

v0.0.3:
- ChatBox only scrolls to last message if user is already scrolled to the bottom when someone chats
- Fixed a cross-browser compatibility issue (e.g. "Number.isFinite" error in Safari)
- Started adding version as a comment in app.js to help operators follow the changelog

My other work:

- http://plinkopot.com/
1542136107
Hero Member
*
Offline Offline

Posts: 1542136107

View Profile Personal Message (Offline)

Ignore
1542136107
Reply with quote  #2

1542136107
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1542136107
Hero Member
*
Offline Offline

Posts: 1542136107

View Profile Personal Message (Offline)

Ignore
1542136107
Reply with quote  #2

1542136107
Report to moderator
GreydonIselmoe
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


Credits [CRE] - Community Manager


View Profile WWW
May 16, 2015, 09:41:01 PM
 #2

How would I run this on my own domain?

Look great, though! I'm not entirely familiar with moneypot, but I do know that most other open source dice scripts tend to have backdoors hardcoded somewhere to send deposits to a specific address, or allow for an attacker (the developer) to enter and withdraw or mess around with existing code.

████████  The next evolutionary step in crypto-currency | Sidechain technology - Claimable - sha256   ███████
████████████████  C R E D I T S - [C R E]  ███████████████
◥ Proof of Work / Proof of Deposit mining system ◥ Official Website ◥ Bitcointalk Thread ◥ Exchange
arallmuus
Hero Member
*****
Offline Offline

Activity: 980
Merit: 1005


View Profile
May 16, 2015, 10:05:58 PM
 #3

Look great, though! I'm not entirely familiar with moneypot but I do know that most other open source dice scripts tend to have backdoors hardcoded somewhere to send deposits to a specific address, or allow for an attacker (the developer) to enter and withdraw or mess around with existing code.

You might want to take a look abit more into moneypot https://bitcointalk.org/index.php?topic=1020726.0

All I can explain about this is that if a site is build on top of moneypot then you could be sure that it will be verified by Ryan and his team since the bankroll will be from moneypot itself, so Ryan will make sure if the code has no backdoors or any exploit that might harm moneypot ( You could choose to provide your own bankroll as well )
dan
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
May 16, 2015, 10:16:49 PM
 #4

How would I run this on my own domain?

Look great, though! I'm not entirely familiar with moneypot, but I do know that most other open source dice scripts tend to have backdoors hardcoded somewhere to send deposits to a specific address, or allow for an attacker (the developer) to enter and withdraw or mess around with existing code.

Since you're not actually running your own webserver, you can host your casino anywhere that will host some HTML and Javascript files. This is known as a "static website" as opposed to a "dynamic website" (backed by a database/webserver).

So, Googling for "host static website" or "host static website with custom domain" should give you a good overview of your options.

The Untitled Dice live demo is hosted on https://pages.github.com/ which has a quick article on how to point a custom domain at your "{USERNAME}.github.io" domain: https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/

It looks like one of the easiest options would be to point a custom domain at a Dropbox folder. Here's a random article I found that recommends some services you might be interested in: http://www.maketecheasier.com/4-ways-to-host-your-website-on-dropbox/ (I Googled for "host static website on dropbox").

Re: Scripts with backdoors: Yeah, before I built this project, I first looked into getting some of the most popular casino scripts and then modifying them to talk to the Moneypot API. I thought it would allow me to leverage existing efforts and maybe rally some interest among turn-key script developers. But I wasn't impressed with the options and decided to write my own.
GreydonIselmoe
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


Credits [CRE] - Community Manager


View Profile WWW
May 16, 2015, 10:27:15 PM
 #5

Seeing how it uses moneypot as a bankroll, is it possible to configure untitled dice to use my local coindaemon? I'm trying to use this with an altcoin, that's why I ask.

Regarding backdoors, I see that Ryan would probably have screened this a bit and it's most likely safe. Thanks for your work!

████████  The next evolutionary step in crypto-currency | Sidechain technology - Claimable - sha256   ███████
████████████████  C R E D I T S - [C R E]  ███████████████
◥ Proof of Work / Proof of Deposit mining system ◥ Official Website ◥ Bitcointalk Thread ◥ Exchange
RHavar
Legendary
*
Offline Offline

Activity: 1484
Merit: 1110



View Profile
May 16, 2015, 10:48:48 PM
 #6

All the code is available as non-obfuscated, easy to read javascript, designed for developers to fork; so I wouldn't worry too much about any backdoors. It's really just a static website, that stores no funds or anything.

Which is actually a really neat thing. You don't need to worry about getting shut down (just reopen on a different file host) or think too much about security =)
joclixal
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
May 16, 2015, 11:34:38 PM
 #7

i try create app, for what App Secret at moneypot??
dan
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
May 16, 2015, 11:49:56 PM
 #8

i try create app, for what App Secret at moneypot??

An app_secret is for apps that run on a server. My script runs in the browser, so you don't need the app_secret (you can just ignore it).

To connect my script with your own Moneypot casino, you just need to set the `app_id` and `redirect_uri` at the top of app.js.

Also, your `redirect_uri` in app.js needs to be one of the redirect_uris you set for your app on Moneypot's "Edit App" page. Need more help?
joclixal
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
May 17, 2015, 12:04:53 AM
 #9

i try create app, for what App Secret at moneypot??

An app_secret is for apps that run on a server. My script runs in the browser, so you don't need the app_secret (you can just ignore it).

To connect my script with your own Moneypot casino, you just need to set the `app_id` and `redirect_uri` at the top of app.js.

Also, your `redirect_uri` in app.js needs to be one of the redirect_uris you set for your app on Moneypot's "Edit App" page. Need more help?
all done only 1 problem faucet not fuction always WAITING_FOR_SERVER?
look
http://dice.clixincome.com/
RHavar
Legendary
*
Offline Offline

Activity: 1484
Merit: 1110



View Profile
May 17, 2015, 12:30:41 AM
 #10

all done only 1 problem faucet not fuction always WAITING_FOR_SERVER?

You'll need to register on: https://www.google.com/recaptcha/intro/index.html  your site, and then get the "site_secret" and put it in the moneypot.com app admin page.

@Dan, probably should be added to the README
dan
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
May 17, 2015, 12:46:00 AM
 #11

Added an FAQ section to the first post that answers this question.

I will soon update the script so that it makes it more clear *why* the Faucet is failing.

Let me know if you still have trouble after setting up ReCaptcha, joclixal.
dan
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
May 17, 2015, 02:09:42 AM
 #12

If you have a fork of this script, you may want to pull in the v0.0.3 changes I just released.

It fixes some cross-browser compatibility issues. It also improves the chatbox by only scrolling to the latest message when the user is already near the bottom. That way, users won't be forced to the bottom of the chatbox every time a new message comes in.
elm
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000


View Profile
May 18, 2015, 01:05:17 PM
 #13

..............................

Which is actually a really neat thing. You don't need to worry about getting shut down (just reopen on a different file host) or think too much about security =)

what do you mean with one doesn't need to worry about getting shut down? thanks
unamis76
Legendary
*
Offline Offline

Activity: 1414
Merit: 1000


View Profile
May 18, 2015, 02:33:39 PM
 #14

Since the funds don't seem to be separated, depositing/gambling/withdrawing there or in any other spinoff of this site is exactly the same as playing on MoneyPot?
elm
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000


View Profile
May 18, 2015, 02:47:12 PM
 #15

Since the funds don't seem to be separated, depositing/gambling/withdrawing there or in any other spinoff of this site is exactly the same as playing on MoneyPot?

thank you for the question because it gives me a chance to add my question. if I would use moneypot investors will all my users need to register and deposit through moneypot?
RHavar
Legendary
*
Offline Offline

Activity: 1484
Merit: 1110



View Profile
May 18, 2015, 04:37:42 PM
 #16

Since the funds don't seem to be separated, depositing/gambling/withdrawing there or in any other spinoff of this site is exactly the same as playing on MoneyPot?

Users have their own balance for your site, it's completely separated from their normal moneypot balances and their balances at other "powered by moneypot.com" sites
RHavar
Legendary
*
Offline Offline

Activity: 1484
Merit: 1110



View Profile
May 18, 2015, 04:38:42 PM
 #17

if I would use moneypot investors will all my users need to register and deposit through moneypot?

Yeah, they will need to register an account with moneypot (there's a nice workflow, that's not too intrusive). While they don't need to go on moneypot.com to do the deposit (they can deposit directly from your app) the funds are managed by moneypot.com
RHavar
Legendary
*
Offline Offline

Activity: 1484
Merit: 1110



View Profile
May 18, 2015, 04:40:04 PM
 #18

what do you mean with one doesn't need to worry about getting shut down? thanks

I just mean there's no user-information, bitcoins, or any other sensitive information stored by the filehost. So if they do shut you off from hosting, you can easily reopen somewhere else (as opposed to having a huge database to migrate)
elm
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000


View Profile
May 18, 2015, 05:35:01 PM
 #19

if I would use moneypot investors will all my users need to register and deposit through moneypot?

Yeah, they will need to register an account with moneypot (there's a nice workflow, that's not too intrusive). While they don't need to go on moneypot.com to do the deposit (they can deposit directly from your app) the funds are managed by moneypot.com

just to be sure that I understood you right. lets say I will have 1k users so they all need to register with moneypot instead with my website?
thanks
PolarPoint
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


View Profile
May 18, 2015, 05:50:40 PM
 #20

This is a major step forward for anyone who wants to start their own dice site! It sounds very easy to build and owner do not need to fund his own bankroll. The commissions of moneypot is difficult to understand. If someone can work it out, I think small profits can be made.
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!