Decentralized computing and NFT infrastructure for game networks.

ABSTRACT:

The gaming industry is estimated to be 138 billion USD in 2022. Now competitive gaming e-sports are already a part of Asian sports and also Olympic committee is thinking about the inclusion of e-sports in the Olympics 2024. The e-sports segments amount to up to 7 quintillion bytes of internet traffic every month. Still, the main thing is this most of this data is controlled by game creators, cloud agencies, and centralized gatekeepers which gives us massive warnings ranging from security to latency. Most game creators have full control of the reward mechanism, arbitrarily changing any rule, and setting the price of any asset in the game which has no real-life value. Game producers also take a very vital role in this whole thing. I am writing this to create decentralized computation and token management infrastructure for game networks. Here I will focus on Ethereum Blockchain, IPFS, and ERC - Ethereum Request for Comment 1155 architecture to build a gaming-oriented public decentralized network. Index Terms—Cloud Gaming, Ethereum Blockchain, Decentralized Computation, IPFS - Inter Planetary File System, ERC 1155 - Ethereum Request for Comment.

INTRODUCTION:

Gaming is an emerging market in the entertainment industry which gives us annual revenue of 138 billion USD and it has a very big audience also (2,47 billion gamers all over the world ). Competitive gaming is another emerging market that can cross 2.97 billion in revenue by the end of 2022. E-sports were included in Asian Games 2018 for their first trial and after that Olympics 2020 (Tokyo) was also considered E-sports. Due to continuous change in the industry game makers are spending billions on the development and improvement of games. Easy access to the internet also helps it create more markets for online gaming, resulting in 7 quintillions of internet every month. Very few entities control the gaming industry now and they also act as gatekeepers of the gaming network and they are also controlling most of the gaming internet traffic. Gaming is no more act like leisure as the gaming industry has increased rapidly in the last 5 years. Gamers spend a lot of money in fiat to purchase in-game assets which have no real-life value. Only game producers can change the price of that asset and the game community does not have any no stake in it there are no real-life storage spaces and real-life marketplaces that can support this secure storage and trading of this asset.

This centralized network architecture can cause latency in gaming. The gaming community should have more stakes in the decision made by the gamin creators including prices in the game asset and the features of in-game assets.

Here I will discuss an architecture where game players are given a stake in the gaming industry. Decentralized computing architecture can give a solution to this type of problem by eliminating centralized game servers. Ethereum can give real-life values b converting their gaming assets to NFTs(Non Fungible Tokens) which are rear and blockchain-managed assets. These assets have real-world value you can trade with this beyond that game network. IPFS is a web 3.0-based peer-to-peer protocol. IPFS removes the need to centralize games to connect nodes to game networks which can potentially give less latency and a much more secure channel for gaming. Ethereum 2.0 aims to introduce proof of stake architecture into the leading networks and it also enables gamers to have a stake in the network which can be utilized to improve their game features. This can reduce complete control of game producers on the game and also help game developers to add new features with the consensus of the gaming community.

Cloud gaming aims to be more revolutionized nowadays in the gaming industry. The first few glimpses of Google and Microsoft are playable for latency in all the devices which is the cause of the player’s bad performance which is beautifully stated by Mark Claypool and David Finkel. B ryce Mariano and Simon G. M. Koo clearly said that cloud gaming is impossible if we use the current internet architecture. The research of Daniel Uribe and Gisele Waters discusses the advantages of decentralization by using NFT but that is completely limited to genemone research. It has some dependency on centralized server-based communication based on gaming limited inclusion of NFTs in gaming assets. The proposed solution has an advantage over the previous one as it is using IPFS and proxy contact which eliminates the need for a centralized gaming server this also reduce latency issue. For NFT-based game objects and to create and distribute game objects in decentralized it integrates Ethereum ERC-1155.

ETHEREUM BLOCKCHAIN:

A blockchain is a distributed immutable ledger with multiple blocks which is enchained together in such a way that it is unacceptable to change any transactions. It is a very big step forward to decentralized and distributed applications. Blockchain technology ensures transparency, quality, identification, organization, collaboration, and trustability. In a very simple language, an application is deployed in a network in such a way that it doesn’t provide comprehensive management over data for any execution in any server. No one in this structure can edit those previous transactions and every server have current data and execution logic. Distributed implies that any server or node is connected to each alternative node directly or indirectly. Ledger is an accounting term but we can consider it as a storage device from where we can store data and retrieve data.

Ethereum implementation is based on blockchain technology extending the practicality of smart contracts. Vitalik Buterin first planned the kernel of this in Nov 2013. The state of Ethereum denotes the balance in that account and the potential for the addition of data in that. The aim of Ethereum is t validate transactions from statements, update their status and continue to maintain the state as a current state until another transaction is approved. The main goal is to facilitate between those who are willing and otherwise they don’t have any means to trust each other. This could be for geographic separation and interfacing problems. or maybe for incompatibility, censorship, disposition, privacy, inconvenience, uncertainty, or expense.

SMART CONTRACTS:

Smart contracts are a set of rules which will verify and implement a contract. Smart contracts’ main work is to verify the credibility of transactions without any third party. Nick Szabo is a person who develops the concept of Smart contracts. Making Ethereum robust and scalable smart contracts play a vital role in that. Solidity and Vyper are the most famous language to develop smart contracts.

EVM-ETHEREUM VIRTUAL MACHINE:

Ether is a very famous cryptocurrency that's based on the Ethereum blockchain. Every transaction is expressed by a distributed cryptocurrency. Ethereum works as fuel for this operation. This can be used in many operations like financial applications, managing and storing data, and digital assets. conventional systems, management of identity, and ballot systems and it goes to those applications which require traceability resources and assets.EVM gives a surrounding for smart contracts in Ethereum.It is not only consists of solely sandbox, but fully isolated which suggests that the code is running within EVM has no access to the network, file systems, or any alternative process. Smart contracts have no access to other smart contracts. Ethereum prevents security challenges by using Deniel-of-Service attacks which is a main concern of the crypto business. EVM also helps us to interpret and execute the Ethereum programming language without any interference and with secure communication.

IPFS-INTERNAL PLANETARY FILE SYSTEM:

Blockchain is a very secure medium because of data storage its computational and network limitation which is not ideal for handling a large number of data. For storing a large amount of data and not economic to and a different type of file system IPFS is very useful. IPFS stands for an inter-planetary file system which is a decentralized file system that can store value with high integrity and resiliency. It synthesizes the concepts of the previpeer-to-peerpeer network as well as SFS, Git, Bit torrent, and DHTs. IPFS’s contribution is to connect evidenced techniques to one significant system than the sum of its component. It works as a platform for writing and deploying large-scale applications. IPFS is a new system for versioning and distributing massive data which is more useful to separate computation and storage across multiple nodes. IPFS is an open-source peer-to-peer globally distributed classification system which can store an share a massive amount of data with high throughput. IPFS is a protocol or a network that is designed for peer-to-peer hypermedia storing and sharing in a distributed network. In IPFS no nodes are privileged. IPFS objects are stored in native storage. Nodes transfer and connect these objects which represent the data structure. It uses a hash of the content to identify and share that content among all nodes. It also uses alternative technologies like Git for version control and MarkelDAG data structure for storing data. IPFS integrates MarkelDAG as a data structure with data addressability of ppeer-to-peerfile shearing. All the content is shared in a network and IPFS seeks to connect all the computing devices. It also evolves in websites. IPFS is directly comparable with one bitTorrent swarm exchanging objects inside one git repo. IPFS is compatible with the world wide web. IPFS provides a content-addressed block storage model with high throughput and with content-addressed hyperlinks. IPFS combines self-certifying namespace and distributed hash table with incentivized block exchange. IPFS has no failure point so the data transit can’t be changed by anyone. It also saves bandwidth and DDoS attacks where HTTPS also struggles. It has many ways to access its file systems as FUSE or File system upper case over HTTPS. A local file is available to the globe by this IPFS. All files are known as their hashes which makes them cache-friendly. Anyone who downloads the file will additionally serve the data to the other user of the network. IPFS protocol can be split into many sub-protocols which are assigned to different types of work like naming service, vice control, content addressed data structure MarelDAG, exchange protocol, content-based routing, network managers, and identities managers. IPFS is mainly aimed to replace HTTPS and it also serves as a global file-sharing protocol. Combining Quick UDP internet connections with (QUIC)network protocol at the transport layer for compatibility with gaming.

NFT-NON-FUNGIBLE TOKEN:

: Fungible is transferable. Ether is a fungible token and each and every token has an identical use and value. On the other hand, a non-fungible token has a unique value and identity. NFTs are non-dividable and non-mergable .The first token in Etherblockchain is ERC-20 which supports fungible tokens only. It is promoted by many ICOs which are based on the Ethereum blockchain.ERCs also have some predefined rules in smart contracts for implementing token measures in Ethereum. ERC-20 is responsible for providing smart contracts and the availability of tokens. Lack of support is the main drawback of that token for a new token standard ERC-721. ERC-721 supports Non Fungible tokens which makes this token has unique value and identity. Tokens are attached to the digital object by metadata which helps us in off-chain rendering or storage. The main drawback of these tokens is the lack of support for multiple tokens in a single smart contract. A game has many types of assets to support that it needs many quick contracts which can cause increase in gas fee and latency.

function ownerOf(uint256 _tokenId) external view returns (address);
 function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;
 function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
function approve(address _approved, uint256 _tokenId) external payable;
 function setApprovalForAll(address _operator, bool _approved) external;
 function getApproved(uint256 _tokenId) external view returns (address);
 function isApprovedForAll(address _owner, address _operator) external view returns (bool);

ERC–1155:

ERC-1155 is the latest token standard which is based on the Ethereum blockchain. It supports ERC-20 and ERC-721. It enables the game object to possess a real-world value. It can help multiple tokens in a single contract. It becomes much more effortless in mining and minting with the introduction of ERC-1155. ERC-1155 can also convert existing tokens and also produce new tokens. Though I will focus on gaming in this paper. It also helps us in documentation and networking.

//Batch transfer:
 function safeBatchTransferFrom(
   address _from,
   address _to,
   uint256[] calldata _ids,
   uint256[] calldata _values,
   bytes calldata _data
) external;
//Batch Balance: 
 function balanceOfBatch(
   address[] calldata _owners,
   uint256[] calldata _ids
) external view returns (uint256[] memory);
//Batch Approval:
  function setApprovalForAll(
   address _operator,
   bool _approved
) external;

function isApprovedForAll(
   address _owner,
   address _operator
) external view returns (bool);
//Receive Hook:
 function onERC1155BatchReceived(
    address _operator,
    address _from,
    uint256[] calldata _ids,
    uint256[] calldata _values,
    bytes calldata _data
) external returns(bytes4);

PROPOSED ARCHITECTURE:

This architecture decentralizes computation and token infrastructure for gaming networks. It takes the help of IPFS and Ethereum blockchain to distribute the computation requirements without any centralized agency in the gaming network. Independent nodes can provide computation-like rendering with the help of their local machine in exchange for rewards which are supported by Ethereum and this also incentivizes more nodes to participate in the network. It uses the ERC-1155 protocol to create a unique game object with a real-world value. We also can trade an object with another object or with currency and we also can mint new objects. These architecture are divided into the following 4 parts.

PROXY-COMPUTATION:

Decentralization is the most important stage in the proposed architecture. In this architecture, computation is distributed among all the nodes in the network instead of a centralized gaming server which eliminates the need for centralized gatekeepers in the network. Proxy is the many numbers of nodes willing to participate in the network by using their computational resources. To perform the computation proxies receive some rewards based on Ethereum which incentivizes proxies to participate in the network. The multiplayer game includes the real-time transmission of data about the game state to player nodes. Ins single-player game proxies are working as distributed rendering nodes by effectively replacing the slow and inefficient cloud gaming server.

DATA TRANSFER (IPFS+QUICK):

Consensus is a very important aspect when we discuss game networks. All the players who are playing that game should have a consensus regarding the state of the game. In the proposed architecture we are using IPFS technology for transferring related to the state of the nodes in the network. It eliminates the need for a centralized game server because all the nodes can communicate with each other. The data which are related to the state of the nodes can be exchanged with the Bitswap protocol. IPFS supports a wide range of protocols like UDP and QUIC is one f the most famous protocol uses by many game networks.

The steps involved in the computation are

  1. Game networks have a huge chunk of data of players related to their states. In multiplayer mode, all these data need to be synced with each other off-chain and in single-player mode, game rendering should perform off-chain so that gamers can directly send their state in the pool of proxies through IPFS.

  2. Proxies receive the data which is related to states and communicate with other proxies to sync with all the players but in the case of a single player, mode proxies receive data related to states and render according to that in the machine.

  3. Proxies receive synchronized data related to their state and render the data back to the player using IPFS.

  4. Players can connect as they are connected directly.

  5. All the valid transactions between the nodes are recorded in Ethereum smart contract.

DECENTRALIZED NFT MANAGEMENT:

In our proposed architecture uses ERC-1155 extensively as a universal token standard. Each and every token is based on ERC-1155 as it gives consistency to all the players in the game.

The important steps which are used in the distribution of NFT are discussed below.

  1. The game creator has to frame ERC-1155 by having a look in the game and attach it with game objects by using their metadata.

  2. The objects are rendered according to the instructions which are written in the smart contracts

  3. Player performs in the game and the basis of the performance in the game and these objects are added to their inventory by using the Ethereum wallet.

  4. The tokens received by a player can be exchanged ortradede with other players because of the support of NFT transfer in ERC-1155. The game object which is attached to the NFT is also transferred as the meta data is attached.

  5. Player can also mint NFT by removing meta data that is attached to the token and attaching meta data to another game object to it.

  6. Players are also eligible to convert their NFT to cryptocurrency without depending on any third-party application.

    FRAUD DETECTION:

    Game networks are prone to attack very frequently because of the tendency of cheating. To protect these networks from several attacks fail proof monitoring is required. In the discussed architecture all the nodes communicate with each other using IPFS which is integrated with the Ethereum blockchain. Each and every transaction performed by a player is stored in a blockchain which is an immutable ledger among all the participants. Fraud and anomalies can be easily detected as they are compared with the whole network and this way fraud nodes can be detected and eliminated from this network which helps us in fair play. A private blockchain network is use to reduce the latency in the network.

EXPERIMENTAL RESULT:

This portion discusses the efficiency of the proposed architecture. Depending of distributed proxies results reduce latency and improve reliability in the gaming network. The graph is showing the difference between the game servers and proxy computation.

CONCLUSION:

Our proposed architecture uses a decentralized network of Ethereum blockchain that ensures the availability of nodes. In centralized gaming , the availability of the game directly depends on the server but in a distributed scenario, there are independent proxies that are available throughout although the network should be large enough for there should be enough populated proxy nodes. Here I discussed the fully decentralized gaming network. HereI also discussed all difficulties of a centralized gaming network and proposed a protocol for fully decentralized gaming. As my proposed protocol is my proof of concept, it is highly advised not to use that in production. Ethereum 1.0 can slow down the network because of its consensus mechanism but we can improve that by using other stake-based blockchains. The smart contract programming language is a fully functional programming language that can cause several issues with NFTs’ usage of other languages such as Vyper can reduce some issues.

IF YOU LIKE MY POST AND WANT TO STAY UPDATED WITH ME PLEASE FOLLOW ME IN HASHNODE AND CAN ALSO SUPPORT ME IN :-

Buy me a coffee

Did you find this article valuable?

Support Kaustav Dutta by becoming a sponsor. Any amount is appreciated!