Bitcoin Forum
August 09, 2024, 11:15:26 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Game development <--> Currency APIs?  (Read 1008 times)
dtothemt (OP)
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
July 14, 2013, 02:31:53 AM
 #1

I'm pretty new to BTC and other coinage being created. I want to create some games that use micropayments or perhaps some betting games.

I would like to know how to setup a payment system that applications (eg games), can interact with. Is there any kind of documented API that application developers can use?

Like for example if I wanted to take payments from players in a game, and credit their account with in-game currency that they can use for in-game purchases?
franky1
Legendary
*
Online Online

Activity: 4312
Merit: 4630



View Profile
July 14, 2013, 02:54:33 AM
 #2

depends if you want to link it to a bitcoin-qt, or blockchain.info wallet to control the fund inputs.

the laymans wording of what is required is
create a new bitcoin address when a user signs up to your service. log this public key on the members database and put the private key somewhere safe away from the game server.

have an api that checks the balance of the public keys and then adds value to the memebers balance in the game database.

blockchain.info has some great API's which can be used with their wallet to inform the game server that a payment has been made, aswell as sending commands to then sweep the funds to a more secure and private address away from possible hacks.

it may be best you seek advice in the developers sub forum. but this should also get you started
http://blockchain.info/api/blockchain_wallet_api

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
halfawake
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500


View Profile
July 14, 2013, 03:04:12 AM
 #3

Sounds like a great idea, though I agree this should probably be in the development forum.

I have a question though: why bother with a separate in game currency?  Why not just use bitcoin as the currency of the game?

BTC: 13kJEpqhkW5MnQhWLvum7N5v8LbTAhzeWj
dtothemt (OP)
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
July 14, 2013, 04:46:53 PM
 #4

Well, it might work as leaving it as BTC. I'm just concerned about security though. If someone hacks the in-game currency, they might wreak havoc in-game, but if someone manages to get into the BTC wallets, that'd be far more devastating.

Also, sorry about the wrong forum. If a mod would like to move this, that's fine. I was under the impression that the dev forum was strictly for BTC itself, and not other/related projects.
franky1
Legendary
*
Online Online

Activity: 4312
Merit: 4630



View Profile
July 14, 2013, 05:01:00 PM
 #5

Well, it might work as leaving it as BTC. I'm just concerned about security though. If someone hacks the in-game currency, they might wreak havoc in-game, but if someone manages to get into the BTC wallets, that'd be far more devastating.

Also, sorry about the wrong forum. If a mod would like to move this, that's fine. I was under the impression that the dev forum was strictly for BTC itself, and not other/related projects.

the actual bitcoin stays safe in offline wallets once you sweep them from users individual addresses.. so they are safe..but what the last person meant was rather then having the game DATABASE call the balance.. gold or rabbit credits.. how about just name them bitcoins or satoshi's depending on how much division you want.

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
coinprize
Member
**
Offline Offline

Activity: 98
Merit: 10


Invest NASDAQ in Bitcoin


View Profile WWW
July 15, 2013, 01:52:48 AM
 #6

Check out here: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)

Kris
Donator
Hero Member
*
Offline Offline

Activity: 640
Merit: 500


View Profile
July 15, 2013, 08:23:34 PM
 #7

So I am thinking that the purchase will happen in-game ? therefore we need some sort of overlay with an iframe to allow for the invoice to be shown. One could use BIPS embedded Invoice each time a player wants to purchase "gold" https://bips.me/embedded simply generate this invoice with a custom variable containing the players "user id".



However this would require a system able to receive Instant Payment Notifications from BIPS as to update the in-game currency.

Another way would be to create a C# framework, I have chosen C# as this is one of my main languages. This C# framework could be created as an dll to be included with say BIPS as namespace, and included in games. This would give the possibility of simple running:

BIPS.CreateInvoice(100, 'USD', 'Gold', 'userid', function(err, res) {

  /**
    Example response (Bitcoin address, and amount)
   */

  ShowInvoice(res.address, res.amount);

});

private function ShowInvoice(string[] address, double amount)
{
    /**
    Display a nice payment window to the user using DirectX Hardware Overlay.
   */
}

Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
July 16, 2013, 01:58:13 AM
 #8

There is always the http://bitcoindevkit.com It works with PHP and Bitcoin JSON or any JSON RPC bitcoin server like Blockchain.info there is a C++ version coming out in the future but for now you can link into the PHP CLI with your game Smiley
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!