[WIP] Satoshis - Bitcoin-based Minecraft Economy

Discussion in 'WIP and Development Status' started by Meta1203, Nov 20, 2012.

  1. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Hello all!
    I would like to introduce you to my new pet project: Satoshis!

    This plugin is a basic minecraft economy system... however, it allows users to add and subtract money to their accounts using Bitcoin, a relatively new, digital currency. Learn more about it here: https://en.bitcoin.it/wiki/Main_Page

    Features:
    • This uses real world money, so system/item protection is ususally necessary. (Unless you don't want anyone playing on your server.
    • Tax is a core part of the system, allowing the server owner to take a certain percentage of all in-game transactions for himself (Server upkeep/Greed).
    • Vault integration
    • Allocated Bitcoin addresses for configurable amount of time.
    • Bitcoin multipliers - One bitcoin does not have to equal 1 in-game coin. You could multiply one Bitcoin by 100, 500, or just 2. The value is in the config.
    SHOUTOUT TO PLUGIN DEVELOPERS!
    I would like some help with this plugin. If you could spare a little bit of your time, just PM me here, on BukkitDev, or on Github. I'll get back to you as soon as I can.

    Github:
    https://github.com/MetaServe/Satoshis
    BukkitDev:
    http://dev.bukkit.org/server-mods/satoshis/pages/main/

    This post has been edited 2 times. It was last edited by Meta1203 Feb 15, 2013.
  2. Offline

    egokick

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Brilliant, do you think this could be integrated with the physical shop plugin?
  3. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Lots of people are interested in this. I got close with the Bit Mines http://www.thebitmines.com. Let me know if you need development assistance. I'm just finishing up the core to this system and will be releasing it soon.
    Good Luck!

    Also I went the original route you did with setting up a dedicated bitcoind that I communicate with. This new way has some interesting security implications: http://code.google.com/p/bitcoinj/wiki/SecurityModel

    Also I wrote up a lot of information on ways to approach this if you're interested: http://www.shapeandshare.com/2012/11/25/bitcoin-and-minecraft-together-at-last/

    This post has been edited 1 time. It was last edited by Joshua Burt Nov 30, 2012.
  4. Offline

    V10lator

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Also make sure to get in contact with the Vault dev as soon as your API reaches a stable state so it will at best be supported when you release it.
  5. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Joshua (or Josh, if you don't mind me calling you that), what do you use for the bitcoind backend connection? I have been looking for a good jsonrpc API, but I cannot seem to find any that I can wrap my feeble mind around. jsonrpc4j seems to be a good choice, but it seems confusing.
  6. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    For the bit mines I did all the bitcoind communications in python using these libraries:
    Python json-rpc (http://json-rpc.org/wiki/python-json-rpc) module
    Python Bitcoin-python (https://github.com/laanwj/bitcoin-python) module

    For a Java implementation I'd also probably look at jsonrpc4j. I'll see if I can get a working demo implementable. Sometimes it makes all the difference. :)

    EDIT:
    Found this link:
    https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
    Might provide easier implementations. :) I'll start here.

    This post has been edited 2 times. It was last edited by Joshua Burt Dec 3, 2012.
  7. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  8. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  9. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Wow good find! The project hasn't been updated in 9 months so it will probably lack some of the wallet (un)encryption [lock & unlock] functions, but that shouldn't get in the way. They don't document the API for the project, but there is a sample application in the SVN repo that uses it and looks very easy to implement! :)
  10. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Excellent! I will start implementing this. Expect to see it in the repo soon!
  11. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Getting the dependencies usable during runtime was a bit more problematic for me then I thought it would be. I created a directory in the server folder called 'lib' and put this API library and all it's dependencies into it:
    bitcoin-client-0.4.0.jar
    commons-beanutils-1.8.0.jar
    commons-codec-1.2.jar
    commons-collections-3.2.1.jar
    commons-httpclient-3.1.jar
    commons-lang-2.5.jar
    commons-logging-1.0.4.jar
    ezmorph-1.0.6.jar
    json-lib-2.4-jdk15.jar

    I had to lanch Bukkit like this to get it to see the libraries:
    java -Djava.ext.dirs="C:\Program Files\Java\jdk1.7.0_07\jre\lib\ext;lib" -jar craftbukkit-1.3.2-R2.0.jar

    This post has been edited 1 time. It was last edited by Joshua Burt Dec 5, 2012.
  12. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Well, so far.. getServerInfo doesn't appear to work, but getBalance appears to..

    This post has been edited 1 time. It was last edited by Joshua Burt Dec 4, 2012.
  13. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Let me know if the move function 'bClient.move(..)' works for you. So far calling the function locks up both the bukkit server and the bitcoin client in my implementation. :/
  14. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Upon further research, I have found out that BitcoinJ's security implications are easily negligible, mainly using a "Transaction Stack". Once the transaction appears, simply push it to an ArrayList of Transactions, to be checked for confidence every couple of minutes or so. In your opinion, would this work? Also, do you think that the confidence levels and period of confidence check should be provided in a configuration file? I think that would empower the server owner a little more, but could cause him/her trouble with an incorrect configuration.
  15. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I agree! I spent time yesterday re-reading their security information on Finney attacks and automated online stores. I think the risk is negligible and well within the bounds of acceptable for this application. Since transaction confidence will change over time I really like your approach of reviewing it periodically.
    Definitely make the confidence level and interval configurable for admins as I think people will want to change this based on their specific use-cases.

    I’ve ditched the bitcoin-client work I did earlier this week validating the usefulness of the API and have started reviewing your code base. I’ll ping you on github for anything specifically related to the source.

    Good job so far! :)
  16. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    So, my last two commits were spent further implementing bitcoinj. However, it seemed almost too easy... I have a feeling that the code does not work/is insecure. Could you have a peek at my code and see what, if anything, is wrong? I'll work more on the bukkit side of the code tonight.
  17. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Well, @Sleaker just rejected adding Satoshis support to Vault, so we are out of luck in that department... I am suddenly thinking "Without Vault, why should anyone implement Satoshis in their plugin/I keep working on this plugin?" So far, the code has been nothing but buggy, accepting-but-not-really all deposits. I guess I am just tired. I thought that this would be a great plugin, but so far it has been nothing but a headache...
  18. Offline

    Sleaker

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    There's a common misconception here. There is no reason you can't implement the Economy API in your own plugin and register it just like Vault does. The reasoning behind me not putting a connector directly in Vault is pretty easy to understand. I would rather all code for your economy be in your economy, that way if there are problems or bugs in the connector I'm in no way liable for people complaining about losing their money.

    Like I said on github, I'm not comfortable with it in Vault, but that doesn't stop you from coding it yourself and registering it in your own plugin.

    This post has been edited 1 time. It was last edited by Sleaker Dec 14, 2012.
  19. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    No, I know why you do not want it in your code. You don't want any trouble if people lose their money through minecraft. I just wanted Vault integration due to the massive amounts of shop plugins that use it. I would have to make a good enough reason to the shop plugin owners why they should link their plugin to mine, instead or in addition to Vault.
    I am in no way mad at you, I just am a little disappointed that I could realize my plugin to its full potential.
  20. Offline

    Joshua Burt

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Sure thing! I'll take a look at the current code base.
  21. Offline

    Meta1203

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Okay, so...
    Vault is a go. @Sleaker showed me a way to implement Vault without modifying Vault itself. Unfortunately, I cannot control what other plugins do with my Vault implementation. While some plugins will be fine off the bat, most will need to have their configs edited to avoid monetary loss. For example, all "Something from nothing" features must be disabled to prevent overdrawing Bitcoin. I'll post a page on the BukkitDev page about this.
  22. Offline

    The_Architect

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    this sounds like good news,. so you think there is any chance we could maybe apply this to other coins? just kinda wondering because we have a project that I would not mind taking megacoins or quark or some others that are out there :)
  23. Offline

    Assist

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @The_Architect
    You do realize that this thread has been inactive for over a year?
  24. Offline

    The_Architect

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    does this mean it is dead? can some one reach out to the developer? also since the last person to respond here was the thread starter, so is it not possible that if he gets a response to it, that he will come back and discuss it further?

Share This Page