All articles

How To Create A Secure In eSports App Purchase / Payment System Using Blockchain

Want to know how to create a secure eSports app purchase and payment system? 

This is a complex question that requires the right expertise.

If you get the payment system along with all other parts of your app right, then huge financial rewards await your company. Here’re a few amazing case studies of companies who hired DevTeam.Space to build their software products:

  1. eTournament Management Application – eGaming Management Web Application
  2. CSGO Team Management Project – Web-based Management Program
  3. eSports Tournament Project – Web Application For Tournaments


A short introduction to eSports
The global market for eSports
The challenges that plague eSports
Blockchain: A brief introduction
How can blockchain help in the eSports industry?
Building a blockchain-based in-eSports-app purchase/payment system
Planning an in-eSports-app purchase/payment system using blockchain?

A short introduction to eSports

eSports are video games, with the following key characteristics:

  • Participants treat these as professional sports.
  • The prize money can be massive in some cases.
  • Famous eSports players enjoy large fan followings, and they also get notable sponsorship deals.
  • Large tournament pay-outs, sold-out arenas are common occurrences.
  • I have explained eSports earlier in “How to develop an eSports tournament website?”.


The global market for eSports

The global market for eSports is experiencing rapid growth. The following facts clearly indicate this explosive growth:

  • This industry generated $655 million in revenues globally in 2017.
  • A high growth rate saw this revenue jump to $865 million in 2018.
  • With a CAGR of 22.3%, this market will likely generate $1.8 billion in revenue in 2022.

Read this Statista report for more information on this.

The challenges that plague eSports

Like every emerging industry, eSports face certain challenges. These are as follows:

  • Players lack financial security: They invest a lot of time and energy, however, they have no guarantee of adequate return.
  • Organizers and teams lack sufficient financial incentives.
  • Service providers don’t have access to a fair system that rewards them appropriately.
  • It’s hard to invest in eSports since there’s no uniform portal that facilitates secure participation in eSports.

An emerging blockchain project named “eByte eSports Blockchain” describes these challenges well on their website.

Blockchain: A brief introduction

Blockchain, the potentially transformative technology emerged a decade ago, as the underlying foundation of Bitcoin, the famous digital currency. It has the following distinct characteristics:

  • It’s a “Peer-to-Peer” (P2P) network.
  • Every computer in a public, permissionless blockchain network has the same authority.
  • These are called “nodes”, and each node has the complete record of all transactions on the blockchain.
  • This gives the network the characteristics of a distributed database with every node duplicating the entire ledger of transactions. This is why we call it the “Distributed Ledger Technology” (DLT). Read more about it in “How to use blockchain to secure your code?”.
  • If a hacker compromises one server, there is no impact on the network. The other servers are intact, therefore, the network is still up.
  • The system groups transactions into blocks and each block has the cryptographic hash of the earlier block in its’ header. This gives it the schematic look of a chain. This is the reason for the name “Blockchain”.
  • Participants in a blockchain network use digital signatures, which use modern data encryption technology. This enhances security.
  • Blockchain also uses consensus algorithms. This makes the transaction validation process decentralized, and highly computing-intensive. This protects the blockchain from tampering and makes the network very secure.
  • Ethereum introduced smart contracts, i.e., pieces of code that execute autonomously and transfer cryptographic assets automatically. They are tamper-proof and transparent.

Read more about these characteristics of blockchain in “How to build your own blockchain using Node.js”.

How can blockchain help in the eSports industry?

Blockchain can help eSports in the following ways:

  • In-game purchases will become easier, thanks to cryptocurrencies.
  • Developers and entrepreneurs get a secure environment for developing their games.
  • Buying and selling in-game assets will be easier with blockchain.
  • Players can have interoperable profiles.
  • Blockchain will enable players to truly own, and securely store their in-game assets.
  • Players have better control over the favorite games.
  • Developers can collaborate with players better, and create rarer varieties of in-game assets.

I have explained these benefits earlier in “How blockchain could redefine the gaming industry”.

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 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 skill;
  • Testers;
  • A Project manager (PM).

Blockchain development skills are a niche. You might need to use a few learning resources. Consider these highly popular Udemy courses:

3. Get an Ethereum account

You can go ahead with the UI design, in-game asset design, and the 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 are 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.
  • “Web3.js”: Web3.js is an Ethereum JavaScript API. This is very useful since you can communicate with the Ethereum network using it. Read these instructions to install 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:

  • 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 are “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 is also the computing power requirements to consider. The more complex the smart contract is, the higher is the computing power requirements. In the Ethereum network that translates to 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 a 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. Read “Create your own crypto-currency with Ethereum” for guidance. 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 involve the following steps:

  • 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.

Frequently Asked Questions

How to create a blockchain payment gateway?

You will need to onboard some blockchain developers who have experience in developing payment gateways. You should then follow the steps in this article.

Can I use cryptocurrency for my payment gateway?

You can use blockchain as a payment gateway for applications. If you do, then you will be required to use crypto coins as a form of payment transfer.

What is the difference between a crypto token and crypto coin?

There is no difference between a crypto token and 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.

DevTeam.Space is a vetted community of expert dev teams supported by an AI-powered agile process.

Companies like Samsung, Airbus, NEC, and startups rely on us to build great online products. We can help you too, by helping you to hire and effortlessly manage expert developers.

LinkedIn Facebook Twitter Facebook Messenger Whatsapp Skype Telegram