Designing Fair and Efficient Blockchain Games: A Case Study with Sui Network and DRAND

Written by escholar | Published 2024/02/01
Tech Story Tags: blockchain-games | games | efficiency | raffle-games | sui-network | smart-contracts | drand-beacons | verifiable-random-functions

TLDRvia the TL;DR App

This paper is available on arxiv under CC 4.0 license.

Authors:

(1)Eason Chen, Carnegie Mellon University;

(2) Justa Liang, Bucket Protocol;

(3) Ray Huang, Bucket Protocol;

(4) Pierce Hung, Bucket Protocol;

(5) Damien Chen, Bucket Protocol;

(6) Ashley Hsu, Bucket Protocol;

(7) Konstantinos Chalkias, Mysten Labs;

(8) Stefanos Pleros Mysten Labs.

TABLE OF LINKS

Abstract and Introduction

Background

Randomness Practice in Blockchain

System Development

Transaction Fee Comparison

Discussion

Conclusion and References

ABSTRACT

Randomness plays a pivotal role in modern online gaming. However, there have been controversies that the claimed winning probabilities in gaming do not align with reality, leading gaming companies to face legal challenges and even financial setbacks. Fortunately, blockchain-based games offer a solution to the transparency and fairness issue regarding randomness. Furthermore, emerging blockchain technology like Sui Network enhances the efficiency of smart contracts by eliminating traditional web3 barriers, such as inefficiencies and expensive transaction fees. This unlocks the potential for extensive decentralized gaming applications.

This paper aims to provide insights into designing a fair, verifiable, and efficient smart contract game on blockchain by the example of building raffles on the Sui Network. We explore efficient methods for implementing randomness on smart contracts, including DRAND committee-based decentralized random beacons and single private-key-based verifiable random functions (VRF). Subsequently, progress from basic to comprehensive smart contract design. By taking advantage of smart-contract native cryptographic primitives, we addressed limitations in developing blockchain games in general, such as data input and storage space constraints.

We propose corresponding solutions, encompassing the utilization of Object Tables, Delegate Object Creation, and Zero-Knowledge Proofs (ZKP) to optimize storage and input efficiency. After testing our designs, we found that the transaction fees for DRAND beacons and private-key-based house-owned VRFs are similar. Moreover, Object Tables incur higher overall transaction fees, while the ZKP setup fee is very cheap but becomes very expensive during the verification process. Moreover, we identified suitable designs for different application scenarios by comparing the pros and cons of different smart contract implementations. Our findings provide valuable guidance for future researchers and developers in building random, fair, and verifiable games with smart contracts, with a focus on gas optimization and security, among others.

CCS CONCEPTS

• Software and its engineering → Distributed systems organizing principles; Distributed programming languages.

KEYWORDS

Distributed Ledger Technology, Blockchain, Smart Contract, Zero Knowledge Proof, Verifiable Random Function, DApps

1. INTRODUCTION

Randomness is a crucial element within games [18]. These chance-driven rewards introduce thrill and anticipation, enticing players to engage and potentially win valuable prizes, attracting many players willing to spend money on it. In the game industry, the player count is projected to reach 3.38 billion in 2023, generating a revenue of $187.7 billion with a promising upward trajectory [17]. Games with randomized raffles and gacha mechanics contribute significantly to the game industry revenue stream because they encourage players to spend money until they get the desired prizes.

Nevertheless, there were doubts raised regarding the fairness of randomness among games. For example, in 2020, the game "Lineage M." advertised a 5% probability of obtaining a rare virtual item through a raffle. After spending $129,000 in the raffle, Taiwanese streamer Ding suspected the true probability was only around 2.3%. Subsequently, he filed a lawsuit against the operating company of "Lineage M." As a result of the lawsuit, the company had to pay Ding approximately $243,000 in compensation and also faced a government-imposed fine of approximately $60,000 [14]. Consequently, this prominent gaming company, which held Taiwan’s second-largest gaming market value, suffered significant damage to its reputation and stock price with a two-day consecutive limit down. Six months after the lawsuit, the company’s stock price had plummeted by 30%, reducing its market value by $1.4 million. Unfortunately, despite such painful lessons from the past, most games continue to conceal the true probabilities of their raffle.

Fortunately, players and game developers have started recognizing the importance of transparent randomness. One of the most promising methods to achieve such transparency is by leveraging web3 smart contracts in game development. These contracts ensure that winning probabilities are publicly visible, immune to tampering, and easily verifiable. Additionally, blockchains also guarantee that players have full ownership and transaction rights over in-game assets. Due to these reasons, games built on blockchain have experienced substantial growth in recent years. As of 2023, the product category on web3 with the most active users is no longer DeFi but Games [12].

Among these web3 technologies, the newly introduced Sui Network shows significant promise due to its low latency and transaction fees, cryptographic primitives availability, and high scalability, making it a favored choice among many game developers. However, it is crucial to highlight that integrating randomness and games into the blockchain, like Sui, involves several critical considerations. Neglecting the above can result in cost and programmability efficiencies and potential system crashes.

At present, despite the emergence of gambling-centric smart contract initiatives, there remains a noticeable void in scholarly and technical literature that comprehensively addresses the nuances of instituting randomness-driven games on modern high-caliber blockchains. In light of this, our manuscript seeks to serve as a beacon for forthcoming blockchain game creators, using the development of a random, equitable, and auditable raffle game on Sui as a case study. Our primary research inquiry is as follows:

• How can one construct a fair, verifiable, and cost-efficient raffle game employing smart contracts within the Sui Network?

1.1 Paper organization

In this paper, we will first review the background of web3 technologies and explain why the Sui is more suitable for game development than traditional blockchains. Next, we will describe several methods for implementing blockchain randomness, discussing advantages and limitations. Then, by progressing from simple to comprehensive designs, we elucidate the process of implementing a random raffle with fair, verifiable, and efficient smart contract designs on the Sui Network. We will discuss the advantages and limitations of each design and explore strategies to address these limitations. Finally, we will summarize the content above and provide an overall discussion and comparison of different designs.

This paper is available on arxiv under CC 1.0 license.


Written by escholar | We publish the best academic work (that's too often lost to peer reviews & the TA's desk) to the global tech community
Published by HackerNoon on 2024/02/01