Securing Crypto With Game Theory

How to accurately predict human behavior and secure economic transactions

Callum Carlstrom
The Capital
Published in
7 min readSep 17, 2022

--

I often hear people who are new to crypto worry about the security of it. Can blockchains and cryptocurrencies be trusted? How do you know it’s secure to transact with someone?

Photo by GR Stocks on Unsplash

Although there are multiple aspects involved in answering these questions, at the core lies something called game theory. In this article, I’m going to give you a brief overview of what game theory is and how it helps us build secure and attack-resistant blockchain networks.

In short, game theory relies on nothing more than primal human behavior. The assumption that most humans are rational and want to move toward pleasure and away from pain. In the case of blockchain networks and their incentive structures, this is economic pain and pleasure.

Let’s explore it a little deeper.

How Game Theory Works

Game Theory is a mathematical framework for understanding strategic behavior between 2 or more rational agents in a competitive scenario. It’s the science of strategy and optimal decision making between competing actors. According to game theory, there are 3 elements that go into any ‘game’:

Players: The strategic actors in a game.

Strategy: The players plan of action given the circumstances.

Payoff: The outcome players receive after achieving a certain state.

Based on these parameters, we actually see game theory play out in almost all walks of life such as politics, economics, evolutionary biology, and warfare.

To better understand game theory in action, we often explore a theoretical scenario known as ‘the prisoner’s dilemma’. It goes something like this.

The Prisoner’s Dilemma

Two people have been arrested for a crime they are both guilty of. The prosecutor then interrogates them separately and offers them both a deal for a reduced sentence in exchange for a confession against the other. The prisoners are not able to communicate with each other.

If prisoner A rats out prisoner B, prisoner A gets 1 year in jail while prisoner B gets 8 years in jail (and vice versa). If both prisoners betray each other, they each get 5 years of jail time. Finally, if they both stay silent, they each get 2 years in jail. If we look at the matrix below, we can see the different scenarios clearly mapped out.

This matrix illustrates that if each prisoner pursues their own self-interests, that is, confesses and rats out the other prisoner, the results are suboptimal (they could both get 5 years). The best option would be cooperating with each other and staying silent. However, because the potential consequence of cooperation is so high (8 years in jail if the other doesn’t cooperate), game theory states that a rational actor will always betray the other.

If you want to go a little deeper into game theory and strategic decision making, I recommend this article from Investopedia.

So, how is the interrogation of prisoners relevant to cryptocurrency and securing blockchain networks?

How Game Theory Secures Blockchains

Through a combination of game theory, economics, and cryptography, decentralized financial systems such as Bitcoin and Ethereum are able to become fault tolerant and trustless. This happens at the mining or validation level, where nodes of the network collectively choose which blocks of transactions to accept into the ledger.

The combination of game theory and cryptocurrencies have given rise to the term ‘cryptoeconomics.’

Cryptoeconomics examines the behavior of participants in a network (the nodes) based on the network’s incentives and considers the most rational and probable decisions of these participants, just like the prisoners and their dilemmas. Let’s have a look at how game theory plays a central role in the two most widely used blockchain consensus mechanisms, Proof-of-Work and Proof-of-Stake.

Photo by GuerrillaBuzz Crypto PR on Unsplash

Game Theory in Proof-of-Work

The Bitcoin network is the most popular proof-of-work chain, so we’ll use that as an example.

The nodes on the Bitcoin network all form part of a distributed system. These nodes are based in many different locations around the world and don’t necessarily know each other. The Bitcoin network relies on the agreement of these nodes to validate blocks and transactions using BTC, the network’s native currency, as an incentive. This is also known as ‘mining’. But how can this group of nodes trust in each other’s resolve to do right by the network and invalidate malicious transactions? How can the Bitcoin network prevent a group of bad actors from disrupting it?

Depending on how familiar you are with Bitcoin and PoW consensus mechanisms, you might have heard that mining Bitcoin is an incredibly costly endeavor. The actual process of mining requires a huge amount of computational power which, in turn, incurs an electricity cost to the miner. Mainstream media often mention the tremendous energy demands from Bitcoin and question if it can become more sustainable. However, what’s rarely mentioned is that the cost remaining high is a vital component of securing the blockchain. With lower costs, security would decrease.

The Proof-of-Work consensus algorithm incentivizes the nodes of the network to act honestly by committing massive amounts of energy in exchange for a reward. If they don’t act honestly and try to process a malicious block of transactions, the other nodes will invalidate the block, and the malicious node is left to foot the energy bill without receiving the reward. In other words, miners who try to cheat the network will lose a lot of money in energy costs and receive nothing in return. The cost of energy is the upfront investment miners make to receive Bitcoin in the hopes that this will yield them a profit.

Therefore, game theory states that a rational actor will act honestly and keep the network secured by only processing valid blocks and not malicious ones.

Game Theory in Proof-of-Stake

In Proof-of-Stake, it works in a similar way, except we don’t have miners. Instead, we have validators who are segmented into proposers and attesters. Those who want to become an Ethereum validator must stake at least 32 ETH, the native currency of Ethereum (hence the name Proof-of-Stake). This locks up their ETH in a staking contract and means they can’t use it on the open market or across DeFi protocols.

Photo by GuerrillaBuzz Crypto PR on Unsplash

For every block, a validator is chosen at random to be the block proposer. Once they’ve proposed the next block of transactions, 128 other validators must attest the proposer’s block to confirm that it’s valid. This is sort of like a proofread of the proposed block. Once they give it their stamp of approval, the block can be added to the Ethereum ledger, and they receive rewards in ETH.

If a validator proposes or attests a fraudulent block, they will have their ETH confiscated. In the world of Ethereum, this is called ‘slashing.’ Validators can have varying amounts of ETH slashed, but the minimum slash is 1 ETH. The biggest slashing event to occur so far happened in early 2021 and saw one validator get 75 ETH slashed. In today’s market, that amounts to roughly $120,000.

This mechanism makes it prohibitively expensive to attack the Ethereum network and try to propose fraudulent blocks. The economic impact of doing so unsuccessfully would be devastating.

From a game theory perspective, we can then assume that a rational actor wouldn’t want to lose their ETH as this is an objectively valuable resource that can be sold for fiat currency on the open market. Therefore, all validators have a vested interest in acting honestly when processing new blocks.

We even have data to back up the power of game theory and the fact that most validators are rational actors in a proof-of-stake network. Since the introduction of staking on Ethereum, only 0.038% of over 400,000 validators have been slashed.

When it’s presented in this way, you can see the simplicity of game theory and how it is a perfect guide for building decentralized, trustless, and attack-resistant networks.

Conclusion

Although blockchain networks are technically complex, they are based on game theory, something we can all understand. The prisoners’ dilemma illustrates the simplicity of game theory.

Networks that are built on game theory are attack resistant and will start to shape the future of our economic societies and increasingly digital lives.

Using game theory as our strategic map, we’ll be able to see the utility and functions of these technologies continue to grow and evolve in the near future.

--

--

Callum Carlstrom
The Capital

On a journey in crypto & web3 • carlstrom.eth • Community @ anotherblock