Skip to main content
QUICK REVIEW

[Paper Review] SquirRL: Automating Attack Analysis on Blockchain Incentive Mechanisms with Deep Reinforcement Learning

Charlie Hou, Mingxun Zhou|arXiv (Cornell University)|Dec 4, 2019
Blockchain Technology Applications and SecurityComputer Science67 references21 citations
TL;DR

SquirRL is a deep reinforcement learning framework that automates the discovery of attacks on blockchain incentive mechanisms by simulating strategic interactions among rational agents. It recovers known attacks like selfish mining and block withholding, and reveals novel flaws—such as the absence of a profitable Nash equilibrium in multi-agent selfish mining and a 30% reward amplification attack on Ethereum’s Casper FFG—demonstrating its power in uncovering vulnerabilities beyond theoretical reach.

ABSTRACT

Incentive mechanisms are central to the functionality of permissionless blockchains: they incentivize participants to run and secure the underlying consensus protocol. Designing incentive-compatible incentive mechanisms is notoriously challenging, however. As a result, most public blockchains today use incentive mechanisms whose security properties are poorly understood and largely untested. In this work, we propose SquirRL, a framework for using deep reinforcement learning to analyze attacks on blockchain incentive mechanisms. We demonstrate SquirRL's power by first recovering known attacks: (1) the optimal selfish mining attack in Bitcoin [52], and (2) the Nash equilibrium in block withholding attacks [16]. We also use SquirRL to obtain several novel empirical results. First, we discover a counterintuitive flaw in the widely used rushing adversary model when applied to multi-agent Markov games with incomplete information. Second, we demonstrate that the optimal selfish mining strategy identified in [52] is actually not a Nash equilibrium in the multi-agent selfish mining setting. In fact, our results suggest (but do not prove) that when more than two competing agents engage in selfish mining, there is no profitable Nash equilibrium. This is consistent with the lack of observed selfish mining in the wild. Third, we find a novel attack on a simplified version of Ethereum's finalization mechanism, Casper the Friendly Finality Gadget (FFG) that allows a strategic agent to amplify her rewards by up to 30%. Notably, [10] show that honest voting is a Nash equilibrium in Casper FFG: our attack shows that when Casper FFG is composed with selfish mining, this is no longer the case. Altogether, our experiments demonstrate SquirRL's flexibility and promise as a framework for studying attack settings that have thus far eluded theoretical and empirical understanding.

Motivation & Objective

  • To address the lack of systematic, automated methods for analyzing attacks on blockchain incentive mechanisms, especially in complex, multi-agent environments.
  • To develop a flexible, generalizable framework that enables empirical exploration of strategic behaviors in blockchain protocols without relying on theoretical assumptions.
  • To identify previously unknown vulnerabilities in real-world incentive mechanisms, such as those in Bitcoin and Ethereum’s Casper FFG.
  • To evaluate the robustness of existing theoretical models—like the rushing adversary model—under multi-agent, incomplete-information settings.
  • To provide blockchain developers with a practical tool for probing incentive compatibility and detecting exploitable strategies in early-stage protocol design.

Proposed method

  • SquirRL models blockchain incentive mechanisms as a multi-agent Markov decision process (MADP), defining state and action spaces based on agent views and capabilities.
  • It employs deep reinforcement learning algorithms (e.g., PPO, SAC) to train agents to maximize individual rewards in simulated adversarial environments.
  • The framework uses a general state representation that balances feature dimensionality and accuracy, enabling adaptation across different protocols and configurations.
  • Reward functions are designed to reflect protocol-specific incentives, such as block rewards and transaction fees, to guide agents toward profit-maximizing strategies.
  • The framework supports varying numbers of agents, including mixed types (e.g., honest, selfish, colluding), and can model dynamic changes like shifting hash rates.
  • It integrates with simulation environments that emulate consensus protocols, allowing for scalable and repeatable attack exploration.

Experimental results

Research questions

  • RQ1Can deep reinforcement learning recover known optimal attack strategies, such as the selfish mining attack in Bitcoin, in a fully automated manner?
  • RQ2Does the optimal selfish mining strategy identified in prior work constitute a Nash equilibrium in a multi-agent setting with more than two rational agents?
  • RQ3What vulnerabilities emerge when combining selfish mining with finality mechanisms like Ethereum’s Casper FFG?
  • RQ4How does the rushing adversary model break down in multi-agent, incomplete-information settings, and what are the implications for attack modeling?
  • RQ5Can SquirRL identify novel, empirically profitable attacks on incentive mechanisms that remain undetected by theoretical analysis?

Key findings

  • SquirRL successfully recovers the known optimal selfish mining strategy in Bitcoin, validating its ability to replicate theoretical results through RL.
  • The optimal selfish mining strategy from prior work is not a Nash equilibrium in the multi-agent setting, suggesting that no profitable equilibrium exists when more than two agents engage in selfish mining.
  • Empirical results indicate that the absence of a profitable Nash equilibrium in multi-agent selfish mining may explain the lack of observed selfish mining in practice.
  • SquirRL discovers a novel attack on a simplified version of Ethereum’s Casper FFG that allows a strategic agent to amplify rewards by up to 30%.
  • The attack demonstrates that honest voting is no longer a Nash equilibrium when Casper FFG is composed with selfish mining, undermining its assumed security.
  • The framework reveals a fundamental flaw in the rushing adversary model when applied to incomplete-information, multi-agent Markov games, challenging assumptions used in prior theoretical work.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.