# Users' Perceptions of Key Blockchain Features in Games
## 3 Research Methods
### The Artifact  
The artifact developed in this study is a blockchain-based mobile multiplayer game prototype. The game is a turn-based racing game where players tap their cars for them to move forward. The game demonstrates blockchain features, as the cars, including their attributes, such as name, color, and speed, are blockchain items. Additionally, the user accounts are managed via smart contracts. In the current version of the game, players receive a prize in the form of coins for participating in races, which can generate more cars.  
Figure 1 illustrates the garage screen view of the designed game. Racer names are generated randomly and work as a seed for the blockchain to calculate attributes for the racer object. The column \"Dice\" shows the speed value of the car, which consists of three dice-related attributes, which are represented in the format \"xDy + z.\" Here, x refers to the number of dice thrown, whereas D is short for dice, y represents the number of die sides, and z is a constant modifier added to each result. In addition to the dice values, the blockchain stores several other values, like the racer's level, its model and color, the number of wins, and the races it has participated in. The model and color of the racers are values stored in the blockchain, but apart from other attributes, they are represented visually, as shown in a table format on the garage page (Figure 1).  
For blockchain implementation, the platform used was Loom, which is meant for decentralized applications and includes a software development kit (SDK). For development, testing, and data gathering purposes, we used the testnet provided by Loom called Extdev instead of the Ethereum or the Loom mainet. Extdev is free for development purposes and has the same functionality as the mainnet, including a web platform that enables examining the generated blocks. Both the Ethereum and Loom mainnets require tokens that have real-world value.  
The smart contracts of the application were written in a Solidity language and built and deployed with Truffle. Smart contracts define the way the data is stored in the blockchain, and the functions used to manage the blockchain and applications built on it. Visual Studio Code (text editor) with a Solidity extension was used for development, while Visual Studio 2019 was chosen for Unity development. Loom's SDK enabled implementing queries to the blockchain as if they were built locally. This made it possible to retrieve relevant data from the blockchain.  
As indicated by [PERSON] et al. [15], designing smart contracts for the artifact plays a key role in blockchain implementation. The smart contracts followed many of the principles by [PERSON] et al. [26] to make them modular and service-oriented. The smart contract functionality in the game in this study was based on well-defined autonomous tasks and was, therefore, authority-free, which means that there were no privileges or exclusive rights written in the code of the blockchain interactions. To minimize the risks of smart contract-related logical errors and software bugs, it was decided to have only the racer and account data stored and managed on the blockchain while everything else is handled by the client. Well-defined and autonomous smart contract tasks also help to reduce complexity and therefore reduce the mentioned risks.  
The account is identified based on the private key. When creating an account, the \"GenerateKeys()\" function is called. Based on this key, the client will use a hash function to calculate its address, which the blockchain will use to identify the user. \"GetAccountName()\" is called without parameters as the contract knows who is calling based on the address.  
Figure 1: Garage view of the game.