Introduction

When people think of blockchain technology, the first thing that comes to their mind is Bitcoin, decentralization and security. Cryptocurrencies have managed to prosper despite repeated attempts that have been made to disrupt their networks. One of the key reasons for that is Game Theory.

You might wonder what game theory is or how it can be useful in protecting the network of cryptocurrencies. This article aims to introduce readers to the concept of game theory and its application in cryptocurrency networks.

Game theory

Game theory is the study of strategic decision making by a group of people or organizations in an interactive environment. A game is defined by the number of players, the actions/strategies of each player, the payoff of each strategy and the best response/strategy of each player taking others’ best response into consideration.

Games are also categorized into zero sum games and non-zero sum games. Zero sum games means that one player’s gain is another player’s loss and non-zero sum games do not involve any such situation. Both players in a zero-sum game can gain or lose at the same time.

Now, there are different ways in which a game can be defined, namely a normal form game and an extensive form game. To keep things simple in this article, we shall only consider normal form games. These games are represented in a payoff matrix form.

The best way to understand what a game is and how it works is by watching this video. While watching it, do ask yourself — who are the players? What are their actions? What is the payoff for each action profile? What is the predicted outcome of the game?

The way in which the above way can be described is –

Let us see how we got the above payoff matrix –

Who are the players? — Steve and Tracey (Let us call Steve as 1 and Tracey as 2 for simplicity)

What are their actions? — This consists of all the actions that one person can take. Since both players have the option of either splitting or stealing, their actions are Split and Steal.

What is the payoff for each action profile? — Action profile is the set of actions of each individual player that has been played in that order. For example — (Split, Steal) means that player 1 plays split and player 2 plays steal. Similarly, (Steal, Steal) means that both players have played the Steal action.

Now, payoff depends of the action profiles in the following way –

Finally the outcome of the game can be found intuitively. If player 1 plays Split, then the best response for player 2 is Steal. When player 1 plays Steal, player 2 is indifferent between Splitting and Stealing. Since the game is symmetric, a similar intuition suggests that a predicted outcome of the game is (Steal, Steal).

Please note — Not all outcomes are profit maximising. In this game, both players would do better by Splitting but instead the predicted outcome suggests (Steal, Steal). In the game played by Steve and Tracey their action profile is (Steal, Split).

Each player in these games knows what their best response is to the other player’s moves and the other players also know the same. The players also know that the other players know this. Such games are called complete information games where all players know everything.

Now let us discuss the two most common topics that everyone must know when they learn about Game Theory — Nash Equilibrium and Prisoner’s Dilemma.

Nash Equilibrium

Any game with a finite number of actions possesses at least one solution called the Nash Equilibrium. Players select their optimal strategies based on the actions chosen by the other player. A Nash Equilibrium is that action profile which does not incentivize either player to deviate from the current situation.

Let us take the example of the Battle of Sexes game –

It is a 2 player game between a boy and a girl. The boy and the girl are happier together than staying separately. One of them gets a higher utility than the other depending on what action profile has been chosen. The boy wants to watch a cricket match which gives him a higher level of satisfaction than going to a theatre. A similar explanation can be given for the girl.

In this game, we see that, if the boy chooses cricket, the girl also chooses cricket. Similarly, if the girl chooses cricket, the boy also chooses. Since both players agree on the same action profile, (Cricket, Cricket) is a Nash Equilibrium. Using the similar technique, we could get another Nash Equilibrium at (Theatre, Theatre).

Always remember, Nash Equilibrium is never written as the payoffs i.e. (2,1) or (1,2). It is written in terms of the actions that are played. This game therefore has two Nash Equilibriums in pure strategy. Some games like matching pennies do not have any Pure Strategy Nash Equilibrium. In that case, players randomise their actions to maximize their gains.

Let’s take the example of matching pennies. 2 players play a game where both toss a penny they have. If the pennies match then player 1 takes player 2’s penny and thus gains 1 penny. If pennies do not match, then player 1 loses his penny to player 2.

Clearly, there exists no Nash Equilibrium in pure strategies. Both players randomise their actions depending on the payoffs they get based on the action profiles. You can use your logic of indifference to find out the probability with which the actions are played. In the above example, both players randomise their strategies with a probability of 0.5.

The main reason why the entire Blockchain Technology is secured and allows for decentralization is because of this concept of Nash Equilibrium which we are going to discuss later. Another important concept of Game Theory that everyone must know is Prisoner’s Dilemma.

Prisoner’s Dilemma

Two criminals have been caught by cops recently. It comes to their notice that the criminals were also involved in another crime which was far more serious than the crime they have committed now. The cops decide to interrogate them and find out more information about the other crime that they had done.

Both criminals are kept in solitary confinement to prevent them from interacting with each other. The cops do not have enough evidence to charge them for the previous crime but they do have enough to charge them for the less serious crime they have done. Each player is given an opportunity to betray the other by testifying against them or by staying silent and cooperating.

If 1 and 2 both betray each other, then they both serve two years in prison. If 1 betrays and 2 cooperates, 1 will be set free and 2 will serve three years in prison. Similarly, if 2 testifies and 1 remains silent, 1 will serve three years in prison and 2 will be set free. If both cooperate and remain silent, then both serve 1 year’s time in prison for the lesser crime they have committed. The game can be represented in the following matrix.

This game shows that despite having a better strategy profile available at hand, the players choose to betray each other as that is the best response for both the players. Betraying is a dominant strategy for both the players as under no circumstances will they choose to cooperate. Prisoner’s Dilemma games have many variants which help us investigate the idea of rational decision making among human beings. People choose to play those games that give them a higher payoff. But if the game is played multiple times then what should the criminals choose in the above example? Of course they must choose to cooperate as then they both get a better deal in the long run. Repeated games or iterated prisoner’s dilemma games can help influence players from not choosing their dominant strategy that gives them a lower payoff. For example, if both the criminals cooperate, for a finite number of periods then of course they will get a lower jail term as compared to what they would have received had they betrayed each other.

Examples include tit for tat games where one player copies the other player’s strategies in the next round. Thus, no player, who wants to maximize his returns would choose to deflect or betray the other player. Copying the player’s moves means that they are getting punished for deviating. As long as the other player does not deflect, he will not get punished and both players will maximize their payoffs.

Let us now see how Game Theory has been applied in case of cryptocurrencies.

Cryptocurrencies and Peer to Peer Networks

Cryptocurrency mining involves the process where all nodes in a network compete with each other to find the next block. New blocks in a blockchain network are found by using two of the most common consensus mechanisms namely Proof of Work and the Proof of Stake mechanism.

Miners in all cryptocurrency networks, help in the mining in return for the cryptocurrencies of that network. This makes mining profitable for them. Now, it might happen that the miners try to fool the network and not mine the correct block. This is where game theory comes into play.

There are two players that participate in any cryptocurrency’s existence. These are the users and the miners. While miners have the task of validating transactions and mining the blocks, users have the task of sending and receiving cryptocurrencies. Blockchain Technology is one of the many examples of a peer to peer network.

In the peer to peer network for cryptocurrencies, users are often punished for the misuse of their power. They even have an incentive to act honestly in the network. Let us now see what consequences miners face when they cheat.

Cheating and its Consequences.

The miners in any network can cheat by accepting an invalid transaction to earn cryptocurrencies and continue with it by adding more invalid blocks. Double spending is one of the most popular cheating methods. This breaks people’s faith in the network which ultimately leads to the network’s destruction and loss in value of the cryptocurrency. But we do not see that happening with most cryptocurrencies around us. This is not because people do not wish to cheat the system. People do not cheat with the system because it involves punishments which are costlier than cheating. These punishments can better be understood using the concept of Nash Equilibrium that you just read above.

Nash Equilibrium in Cryptocurrency Networks

In a prisoner’s dilemma game, each player selects the strategy that tries to maximize their payoffs without taking into account what the other player might choose. Mining can be considered as a repeated prisoner’s dilemma game where each node in the network continues to function in a way that maximizes their payoffs in the long run and improves the security of the network.

Each node in the network knows that cheating/validating illegitimate transactions will only lead them to spending a lot of computational resources for mining the block and then getting ousted by the network. This acts as a disincentive to the miners who plan on cheating. The Proof of Work mechanism causes mining to be a very costly process. For example, mining in the Bitcoin network requires special hardware called ASICs which are very expensive. Computational power also increases the electricity cost. It is also seen that the decentralization and security of a network also depends on the number of nodes. Greater is the number of nodes in the network, the more difficult it is for any node to accomplish an attack.

Mining in the Proof of Stake mechanism also revolves around game theory. Miners stake the cryptocurrencies in a smart contract before mining begins. Any misconduct or wrongdoings by a node will only lead to punishments which involve cryptocurrencies getting deducted from the staked amount. Cryptos deducted from the staked amount only mean that their probability for validating transactions and getting rewards reduces. Eventually, if the staked amount falls below the minimum requirement that is mentioned in the smart contract, these nodes cannot stake at all.

Lastly, all nodes compete with each other to get the cryptos and earn higher rewards. Cheating in a network only reduces people’s faith in the crypto which ultimately reduces its value. Users of cryptocurrencies would not value a network filled with nodes who cheat and affect the security of the network. This ultimately leads to the loss in value of the cryptocurrency. Game theory has therefore been important to create a decentralized network as that of cryptocurrencies.