Aptoide / AppCoins challenge for Pixels Camp
Every participant of Pixels Camp will have an AppCoins gift card with $5 worth of AppCoins credits. AppCoins is a cryptocurrency used by Aptoide and other app stores for in-app purchases. AppCoins credits is an easier way to use AppCoins without the need to pay Ethereum gas fees, using smart contracts to register the events in the blockchain and with collateral deposits.
Aptoide / AppCoins team challenges the Pixels Camp participants to develop a game (any game) where at each round, the participants deposit some AppCoins credits and the winner takes it all.
The steps would be as follow:
- Step 1 - Preparing the game
In the begin of the round of your game, you create a new wallet (ERC20) and ask the participants to transfer AppCoins credits to that wallet. The ammount of AppCoins should be the same among the participants. To make it easier, you can show a QR code with the wallet address, and the participant use their AppCoins wallet to scan it and do the transfer.
- Step 2 - Waiting for the participants
After a certain time (e.g. 30 seconds), if you have 2 or more deposits, it means you have enough participants and the show can start.
- Step 3 - Game on: do your magic
This is the creative part. You can choose a skills or a game of chance.
In a skills game, the participants usually perform some kind of action to achieve a goal. Among skills games are, or instance, Pong, Hangman or Dominoes.
In a game of chance, the luck plays the main role. Some examples of games of chance are Dices and Roulette.
The game can run in a browser or in a mobile app. Is up to you. In the first case, Pixels camp participants sit around a computer to play. In the second case, someone downloads the app and the players interact with that phone. Each participant needs to have the wallet installed in their phone to do the transfers.
- Step 4 - Game over: time to reward the winner
When the game is over, you transfer to the winner the amount of AppCoins credits deposited in the wallet in step 2. If you wish and the participants allow, you can keep a small margin to reward your effort. Every transaction shoould be visible in APPC explorer.
Besides wining Pixels Camp first prize, you go home with a lot of AppCoins credits to use in your favorite games.
What's next ?
Go develop your game and challenge the other Pixels camp participants to spend their AppCoins credits in it. Aptoide / AppCoins team is here to support you on the problems you have.
Step 1 - Preparing the game
- Create the wallet +INFO :
- Endpoint (GET): https://apichain.blockchainds.com/transaction/generate
- Response:
{
wallet=<wallet>,
private_key=<private_key>
}
- Participants - Wallet installation:
- AppCoins wallet installation: Install from Aptoide or Install from Play
- Description: After installing the wallet and redeem the Gift card, the participants may go to "Send" option in the navigation bar, and scan the QR code of the game wallet.
Step 2 - Waiting for the participants
- Monitor Wallet transactions +INFO:
- Website: https://ropsten.appscan.ga/
- Endpoint (GET): https://apichain.blockchainds.com/appc/wallethistory
- Parameters: wallet
- Response:
{
"result": [
{
"TxID": <txid>,
"amount": <amount_in_wei>,
"block": <block>,
"icon": <icon>,
"receiver": <receiver>,
"sender": <sender>,
"ts": <timestamp>,
"type": <type>
},
...]
}
Step 4 - Game over: time to reward the winner
- Obtain the nonce +INFO
- Description: Nonce represents the current number of transactions performed by a wallet. This is a relevant info since one has to sign his current nonce and provide that signature to transfer APPC Credits to another wallet.
- Endpoint (GET): https://apichain.blockchainds.com/transaction/nonce
- Parameters: wallet
- Response:
{
wallet=<wallet>,
nonce=<nonce>
}
- Sign +INFO
- Description: Sign any given message by providing the private_key of the signer wallet
- Endpoint (GET): https://apichain.blockchainds.com/transaction/sign
- Parameters: message, private_key
- Response:
{
signer=<signer>,
signature=<signature>
}
- Verify +INFO
- Description: Verify if a given signature indeed represents a specific message from a certain signer wallet
- Endpoint (GET): https://apichain.blockchainds.com/transaction/verify
- Parameters: message, signature
- Response:
{
signer=<signer>
}
- Transfer (deposits) +INFO
- Description: In order to transfer APPC Credits, the sender has to provide a signature to prove the ownership of that wallet. In order to avoid double spend, that signature can only be valid for one transaction, thus, the sender should sign his current nonce, as message, and provide that signature as an argument on this endpoint.
- Endpoint (POST): https://apichain.blockchainds.com/transaction/transfer
- Parameters: sender, receiver, amount, signature
- Response:
{
txid=<txid>,
status="COMPLETED"
}
Aptoide / AppCoins team is at the event venue and on-line in Gitter to help you to overcome any seatback. Feel free to reach out anytime: