API has to make it easy for game developers [D], their users [G] to easily trade FreshCoins [FRSH]. Basic requirement from is simplicity above all, meaning that developers should have minimal knowledge about wallets, coins, mining, trading, etc.
In a perfect world, we would be able to provide modules for developers to include in their games, for easy purchase of FreshCoins.
Behind the scenes, actual coin trade has to take place for actual value of FreshCoin to be established. In the game, players will have some representation of FreshCoins (golden coins, tokens, bananas, whatever the developer decides). Developer will have to notify us of any in-game coin spending, that must be deducted from the player's wallet. Players will not have direct access (for now) to their wallets. Each player will have to be registered with FreshCoin API server in order for purchase to work.
The process should work somewhat like this for the system to work:
1. Developer is registered on FreshCoin API Server by Administrator, with following data
a) Developer name, entered by admin
b) Game name, entered by admin
c) Developer email, entered by admin, confirmed by developer on registration (click link in email that arrives)
d) Developer ID, unique id generated by server at the time when developer is registered
e) Developer Key, unique string generated by server at the time when developer is registered
f) Developer PayPal email, entered by admin, for payments
g) Developer FreshCoin wallet, automatically generated by server, and FreshCoins from Investment Fund are transfered here, can be controlled by FreshCoin API server only
i) Developer BitCoin wallet, either automatically generated by server or entered by admin, if developer wants to be paid in BitCoins
2. Developer should already have back-end server that takes care of his users/password/scores, etc.
3. Each developer registers his users, when they are registered in his game, in our system, with following data [ /api/user/register = uniqueid ]
a) User developer id, unique id under which is user stored in developer's database
b) User email, provided by developer must be confirmed by user (welcome email with link)
c) User FreshCoin wallet 1, automatically generated by server
d) User BitCoin wallet, either automatically generated by server or entered by admin
e) User unique id, generated by server at the time of user registration, and sent to developer
f) User FreshCoin wallet 2, automatically generated by server or entered by admin, to be used for collecting (earning) coins that user can be spent later, can be controlled by user
4. Buying FreshCoins in game
a) User initates coin acquisition in game, either by module that we provide, or by module that developer creates
b) Developer sends user unique id (3e) to PayPal [P], and PayPal generates payment page link
c) User is taken to payment page (url generated in 4b) to continue the transaction
d) After the transaction is complete, PayPal notifies FreshCoin API server, sending user id + payment amount [ /api/ipn/notify = uniqueid + amount ]
e) FreshCoin API server transfers amount of FreshCoins from developer wallet (1g) to user FreshCoin wallet (3c)
f) FreshCoin API server notifies developer server that user id has bought FreshCoins [ /developerserver/notify = uniqueid + amount ]
g) Developer server sends in-game representation of coins to user (golden coins, tokens, bananas, or whatever developer has created in-game)
5. Payout
a) Admin has to convert dollars to BitCoins (using money received via PayPal)
b) Admin has to distribute bitcoins accordingly to developers
c) Admin has to pay investors
d) This process has to be done monthly, weekly, or even daily if needed
e) Developer should provide statistics panel, so Admin can track how much money has everyone earned, for distribution
f) Some sort of public-open panel should be created so that investors can track the flow of coins