Want to know how to create a secure blockchain payment system for your eSports app?
This is a complex question that requires the right expertise. In this article, we will discuss the development of secure blockchain payment systems in detail.
Building a blockchain-based in-eSports-app purchase/payment system
This development project involves the following steps:
1. Agree on a development approach
I recommend that you develop this in-eSports-app purchase/payment system as an Ethereum “Decentralized App” (DApp). Ethereum is a well-known public blockchain development platform. An Ethereum DApp is a web app with the following characteristics:
- The front-end can be in any language, however, the backend should consist of Ethereum smart contracts.
- A DApp is open-source, and it must execute on a decentralized blockchain network.
- The user community of the DApp decides the future course of the DApp based on consensus.
- A DApp uses a crypto token. It should be created using a modern standard cryptographic algorithm. No user of the DApp should hold the majority of the tokens.
- The app should store data in a decentralized blockchain, and it should follow modern cryptographic standards while doing so.
You can read more about DApps in “How to convert a web app into a Dapp”.
2. Build a development team
You need the following roles in your team:
- Business analysts (BAs);
- UI/UX designers;
- In-game asset designers;
- Ethereum blockchain developers with Solidity skills;
- A Project manager (PM).
Blockchain technology development skills are a niche. You might need to use a few learning resources. Consider these highly popular Udemy courses:
Hire expert developers for your next project
- Ethereum and Solidity: the complete developer’s guide;
- Ethereum: decentralized application design & development.
3. Get an Ethereum account
You can go ahead with the UI design, in-game asset design, and front-end development like you will do for any eSports app. However, you need to prepare for the Ethereum DApp development in parallel, as follows:
- You need Ether (ETH), the native cryptocurrency of Ethereum to deploy and run Ethereum DApps.
- Before you can purchase Ether, you should create an Ethereum account. Using the “eth-lightwallet”, an Ethereum wallet from ConsenSys, is the easiest way to do so.
- Follow their GitHub instructions to download and install it. You will need to create a public and private key. Secure your private key, don’t publish it on an online forum or website.
4. Get a suitable scalability solution for your DApp
The Ethereum network doesn’t scale well, therefore, you need to plan appropriately to achieve scalability for your DApp. You can do that as follows:
- Carefully analyze the security requirements for your DApp. If it doesn’t deal with very high-value transactions, then you might not need to use the fully decentralized Ethereum main network directly.
- You can use a sidechain for your DApp, which is called “DAppChains”.
- Loom Network offers DAppChains and SDKs to build DApps on them.
- You can use a different consensus algorithm like “Delegated Proof of Stake” (DPoS) for your DApp on this separate sidechain.
The DApp will be scalable and it will not congest the Ethereum main network. Read more about this in “How to scale an Ethereum Dapp”.
5. Download and install the required tools
You need to download and install the following tools for developing an Ethereum DApp:
- “testrpc”: You need this blockchain client for the ease of use it offers. It has a “Command Line Interface” (CLI). Check this GitHub instruction to download, install, and configure it.
- “Truffle”: You can use this to compile Ethereum smart contracts, test them, and deploy them. It also helps in the build-management. Truffle offers ease of use since developers can create separate folders for their different smart contracts. Follow these instructions to install and configure it.
- “MetaMask”: MetaMask is a browser extension to help you communicate with the Ethereum network even if you don’t run a full node. You will need this for testing your smart contracts. You can install either the Chrome or Firefox browser extension, and for that, visit their website. You need to create a password. You will have a 12-words private seed, and you need to secure it.
6. Configure the tools
The following configuration actions are required:
- Open “testrpc”. You need to run one instance of it.
- Configure the “aconfig.js” file since you will use Web3.js.
- You had noted down your public and private key information when you had set up your eth-lightwallet. You now need to update your “config.js” file with that.
You can use the instructions in “Getting started as an Ethereum web developer” for guidance.
You also need to point your MetaMask connection to Ropsten, which is an Ethereum test network. This will help you test your smart contracts. For this step, read the instructions in “Ultimate guide to convert a web app to a decentralized app Dapp”.
7. Familiarise yourself with the relevant ERC token standards
In this DApp, you will need two sets of crypto tokens, as follows:
- One set is for the players to buy/sell the in-game assets and participate in the eSports tournaments;
- The other set is to actually represent the in-game assets.
You need to grasp the following concepts here:
Hire expert developers for your next project
1,200 top developers
us since 2016
- The first set of tokens are “fungible” tokens, i.e., each has the same value as another at a given point in time. You need to use the ERC20 Ethereum token standard here.
- The second set of tokens is “non-fungible”, i.e., each one is different from the other. This is needed since the in-game assets are different from each other. You need to use the ERC721 standard for this.
Read “Noobs guide to understanding ERC-20 vs ERC-721 tokens” for more details.
8. Review relevant smart contracts to get ideas
You will need to implement the entire set of eSports in-game assets purchase functionalities. It will help if you can review smart contracts of similar apps. That’ll be the smart contracts in a blockchain-powered eSports app.
Well, you have some good news! “Gods Unchained” is a blockchain-based eSports game app. It’s backed by Coinbase. You can review the smart contracts of this app since smart contracts are open-source.
You can check how the various functionalities like in-app purchase of in-game assets, etc. work. A detailed review of the smart contracts of this app is available in “Uncovering information hidden in the smart contracts of Gods Unchained”.
9. Code smart contracts
Ethereum smart contracts are essentially pieces of code with “If-Then-Else” statements. These are open-source. They have predefined conditions, based on which they transfer cryptographic assets. You need to do the following:
- Use Solidity, the proprietary language of Ethereum. This is a smart choice of programming language for smart contract development.
- Code smart contracts in Remix, which is an “Integrated Development Environment” (IDE) for smart contract development. To use Remix, you don’t need to install anything since it’s a DApp.
- Keep in mind that you can’t modify smart contracts after you deploy them. This makes it important to write bug-free smart contracts. You should keep the logic as simple as possible. That will reduce the chances of error.
- There are also computing power requirements to consider. The more complex the smart contract is, the higher the computing power requirements. In the Ethereum network that translates to a higher “Gas price” i.e., users will need to spend more Ethers to use the app. This is another reason to keep smart contracts simple.
10. Test smart contracts
You need to test your smart contracts thoroughly. Take the following steps:
- Buy dummy Ether: You need to buy dummy Ether from MetaMask Ether Faucet to test the smart contracts in Ropsten.
- Check to ensure that your MetaMask connection to Ropsten testnet is still open.
- Toggle back to Remix. There is a small “+” sign at the top left, with the label “Create”. Click it to deploy your smart contract to Ropsten. You also need to confirm this action in MetaMask.
- Test your smart contracts.
11. Create your crypto tokens
Creating your own crypto tokens for the eSports in-app purchase system again boils down to coding more smart contracts. This time, you will need to use the ERC20 and ERC721 token standards. Test these smart contracts as well.
12. Buy real Ether
You can buy real Ether on Coinbase, an easy-to-use crypto exchange. You will need it to deploy your smart contracts on the Ethereum blockchain main network.
13. Deploy your smart contracts
Deploying your smart contracts involves the following steps:
Hire expert developers for your next project
- Check to ensure that the “testrpc” instance you had started is still running.
- Navigate to the Truffle directory where you saved your smart contracts.
- Use the real Ether you bought, and pay the “Gas price” for contract deployment.
- Run the “Truffle deploy” command to deploy the contracts.
- Note down the smart contract addresses since you will need them later.
Read “Blockchain software development using the Ethereum network” for more guidance.
You have just completed the project to create an in-eSports-app purchase/payment system using blockchain.
Planning an in-eSports-app purchase/payment system using blockchain?
Developing such a blockchain-based system is a complex project. Blockchain is a new technology, and Ethereum development skills are at a premium. You might need help to execute such a project.
Read “How to find the best software development company?” before choosing a development partner.
DevTeam.Space can help you here with its expert blockchain developers community. Write to us your initial blockchain payment development requirements via this form and one of our technical managers will contact you for more details.
Frequently Asked Questions
You will need to onboard some blockchain developers who have experience in developing payment gateways including payment processing for cross-border payments if required. You should then follow the steps in this article.
Blockchain can help you develop a decentralized finance app that does not require a central authority such as financial institutions. You can use blockchain as a blockchain payments system gateway for financial transactions in your applications. If you do, then you will be required to use crypto coins or other digital assets as a form of payment transfer instead of central bank digital currency.
There is no difference between a crypto token and a crypto coin. They are both a form of payment transfer, however, crypto coins are regarded as a form of currency whereas crypto tokens aren’t always.
Founder of DevTeam.Space
Hire Alexey and His Team
To Build a Great Product
Alexey is the founder of DevTeam.Space. He is among the Top 26 mentors of FI’s ‘Global Startup Mentor Awards’ and is a Band Of Angels Technology Expert.Hire Expert Developers