The Road to Smart Contract Gaming

The Road to Smart Contract Gaming

Since Bitcoin came into the public eye, a typical application of Bitcoin is DICE games. It is not difficult to see that this is determined by the advantages of Bitcoin. The core function of Bitcoin is payment, and one of the advantages of Bitcoin is the borderless and unlimited efficient payment on the Internet. Bitcoin, as a new payment method, can enable these DICE game websites to instantly connect with global users in terms of funding channels.

With the rapid development of the Bitcoin industry, more and more Bitcoin applications have emerged in the gaming sector. These applications are often not limited to accepting Bitcoin, but also other popular virtual currencies. In addition, there are applications that attempt to use virtual currency as an internal currency for purchasing props or for recording user points, so that the application of virtual currency in games is not limited to chips for DICE-type guessing games. However, according to the author's observation, this approach has many obstacles in terms of game operator needs, user needs, and laws and regulations. So far, the main application of virtual currency in the gaming industry is still as a funding channel.

Although the problem of funding channels has been solved, the application and development of virtual currency in the gaming industry is not all clear, and there are still several dark clouds threatening the financial security of users.

The first dark cloud: the custody security of funds
Centralized websites, that is, the operators of games, are the actual controllers of user funds. Whether it is multi-signature, cold wallet storage, or public disclosure of funds, the public identity of the controller cannot completely solve the problem of fund security. Since the popularity of Bitcoin, hackers have been stealing coins and the founders have been running away with the funds. The infinitely glorious Bitcoin trading website MTGOX, the altcoin trading website M.com.cn, and the domestic piggy banks were forced to close due to hacker theft. Many exchanges currently in operation have also experienced thefts and can only bear the losses silently. The managers of user funds can prove or demonstrate how safe their measures are, but no one guarantees that they will compensate users for their losses indefinitely when theft occurs. They can only wait with the users as victims for the police to solve the case and recover the funds. In other words, the responsibility of the fund custodian is limited. Therefore, some people ridicule the phenomenon in the circle: fewer and fewer people are running away, and more and more hackers.

A big part of the reason why Bitcoin is so popular is that it is a trustless payment system. But when it is combined with traditional industries, the problems it has solved are back. There may be tens of millions of dollars of virtual currency on the popular DICE website, but its fund manager may be only one or two people, and its security may be vulnerable to powerful hackers. It is a choice that every user who uses centralized services must make to entrust their funds to others for safekeeping and bear all the risks themselves.

The second dark cloud: Is the guessing game fair?
Before the application of encryption algorithms, DICE-type guessing on the Internet was not fair at all. The actual winning probability and lottery rules of the game were unknown to users, just like slot machine and fruit machine amusement parks, where operators could adjust the winning probability in a black box, and users simply saw the lottery results. Of course, the amusement park owner would not let users always lose, but overall, users were lambs to be slaughtered.

After Bitcoin was applied to the DICE game, users inevitably had higher requirements for the fairness of DICE. After all, people who knew about Bitcoin in the early days also knew some encryption algorithms. Take JustDice as an example. The website proposed an algorithm that seems quite reliable in principle to ensure fairness when gambling between players and websites. However, this fairness is only ideal. If a hacker obtains the random number generated by the server through some means, or an internal employee who can obtain the random number of the server participates in the game, he may rob the funds of the website or the banker, commonly known as the God of Gamblers. JustDice once had a God of Gamblers who retreated with a profit of 11,000 Bitcoins. You have no way to prove that he was just lucky, or that a hacker found a loophole, or even that an internal employee embezzled.

The issue of fairness has always been a major controversial issue in online DICE games. Even though the website has proposed many methods to try to ensure fairness, due to the essential structure of centralized operations, in theory there is basically no model that can ensure fairness.

The third dark cloud: the sword of compliance hanging over our heads
Even in countries where gambling is legal, it does not mean that gambling companies can be unregulated. The attitude of regulatory authorities towards the new virtual currency is also confusing and fluctuating. JustDice has already stopped operating in early 2015 on the grounds that the local competent authorities issued new regulations on virtual currency supervision. This is actually a good ending. If the local competent authorities suddenly seized and froze all the assets of the platform, users would be in tears. Although Bitcoin often has compliance disputes, the compliance of Bitcoin and the compliance of centralized websites or companies are completely different issues. The biggest difference is that Bitcoin essentially has no operating entity, so even if regulators in some regions prohibit the use of Bitcoin, it is destined to be only a local impact. But for centralized websites or companies, once their operating personnel and operating funds are subject to compliance restrictions and crackdowns in the registered area or operating area, it will be a devastating impact on them. Even if you can close the old company and open a new one, the same threat will continue to exist.

The continuous development of blockchain technology has opened up a new path to dispel these three dark clouds, which is the path of smart contract games introduced in this article.

Smart contracts are not mysterious. We can use the transfer operation of Bitcoin as an analogy. "A transfers his assets to B", this is a transfer operation, as long as A signs the message, the transfer will take effect. Transfer can be regarded as the simplest "contract". We can also define some other complex contracts, such as "A transfers funds to B, but B can only spend the funds after 1 year", which is also a transfer contract, but more complicated. We can also define some contracts that are not related to transfers, such as "bind A's address to the string myname, and all assets sent to myname in the future can be spent through the signature of A's address", which is actually a contract for registering a username. If the execution of these contracts is automatically completed through the blockchain, it is called a smart contract.

Smart contracts are not the patent of a certain virtual currency, they are just a technology. Even when Bitcoin was first invented, it already had the prototype of smart contracts. Currently, Bitcoin's sidechain and DACPLAY (game stocks) both fall into the category of smart contracts, but the implementation details and emphases are different. The following takes the DICE game on DACPLAY as an example to describe in detail what smart contract games are and why smart contract games solve the three major cloud problems.

DACPLAY's smart contract is described in the form of javascript code. Game developers can directly send a Tx (collectively referred to as a transaction with other operations such as transfer) through the P2P network to upload the complete contract to the blockchain. The complete code of the game currently running on DACPLAY can be found in the following link:
https://github.com/dacsunlimited/dacplay-game-samples/blob/master/DACPLAY/dice.js

From the code, we can see that this game contract is much more complicated than the operation of transferring money or registering a username. Like general guessing games, this game is also divided into the process of betting, winning, and distributing prizes, but the difference is that these processes are all completed automatically through the blockchain.

After the user places a bet, the user's chips will be automatically locked in a special account by the contract execution, and the user's betting record will be recorded in a list of pending prizes. This process is defined by the PLAY.evaluate function.

The winning rules are defined in the PLAY.execute function. When the winning conditions are met (in this case, the winning conditions are the 10th block after the betting block), the winning result list will be generated according to the pre-set winning rules. The winning rules use distributed random numbers as the basis to ensure sufficient security. Distributed random numbers are one of the important features of the DACPLAY blockchain. As long as the trustees (similar to the miners in Bitcoin, responsible for generating blocks) are not completely colluding, no one can know the results in advance. For details on the principle of distributed random numbers, please refer to the technical articles of the DACPLAY community.

You can also specify some details in the PLAY.execute function, such as setting the house advantage:
jackpot = game_data.amount * (game_data.odds) * (100 – BTS_BLOCKCHAIN_DICE_HOUSE_EDGE) / 100;
You can also set the game developer dividends here, for example, 1% of the winner's bonus. It can be seen that DACPLAY's smart contract is very free, and you can use JS code to describe all the logic you can think of.

In the PLAY.scan_result function, a prize draw transaction will be automatically sent to the blockchain based on the prize draw result list. Such transactions are collectively referred to as virtual transactions, which means transactions automatically generated by the blockchain protocol. After these transactions are parsed, the balances of the relevant accounts will be updated, and the prize distribution will be completed.

From the above process, we can see that there is no fund supervisor during the betting process, and the user's chips are automatically locked in the system. The lottery rules are determined by clear open source code and are based on distributed random numbers. There is no possibility of cheating by game developers. After the lottery, the blockchain automatically updates the winner's balance to distribute the prize money. The whole process does not rely on people and is a completely automated process.

Moreover, DACPLAY, like Bitcoin, is a P2P decentralized network, not operated by a certain company or other entity. Therefore, even if there is a compliance risk in a certain region, the risk will only be a local risk. The P2P network will not be closed due to the crackdown by the regulatory authorities in a certain place, and the user's funds will not be lost or confiscated.

At this point, we can understand how smart contract games break through the limitations faced by traditional centralized game platforms. Games based on smart contracts can provide users with more financial security and a more trustworthy lottery process. Just like the new digital assets and payment concepts brought by Bitcoin, smart contract games can also bring users a new concept of "safety and trustworthiness" in guessing games. We believe that this will be the future development direction of various random process-based applications.



<<:  The fake crowdfunding scam with a daily interest rate of 2% is worse than a nuclear explosion!

>>:  BitCluster claims to remove Bitcoin user anonymity

Recommend

11 Bitcoin Startups That Went Bankrupt in 2015

This year has been a year of further development ...

The importance of the pinky finger in palmistry

The symbolic meaning of the little finger The lit...

How is the fortune of a woman with a mole crying for her husband?

The mole of crying husband on a woman born under ...

The fate of a woman with thick palms

The fate of a woman with thick palms Thick palm w...

Celibacy palmistry! What does a man's long marriage line mean?

What does a man’s long marriage line mean? In phy...

Barclays Africa Bank joins R3 blockchain consortium

The R3CEV blockchain consortium has added its fir...

Palmistry Diagram: Creation Lines

Palmistry Diagram: Creation Lines Two slanted lin...

The shape of your legs can tell whether your love life is happy

1. Long legs People with long legs always give pe...

See your destiny from your facial features

Judging from the fate of people through their fac...

What kind of face is the most unfeeling woman?

Facial features can reveal a person's charact...

Strong regulation is coming? Where will Hong Kong's cryptocurrency OTC go?

Since 2021, the Chinese government has explicitly...

Is your appearance really given by your parents?

Is your appearance really given by your parents? ...

What kind of people are more likely to meet the right person?

In fact, for people, in addition to seeking caree...