---
title: Work-Optimal PRAM Algorithms
url: https://www.emergentmind.com/topics/work-optimal-pram-algorithms
type: topic
---

# Work-Optimal PRAM Algorithms

Selfish mining is a strategy in proof-of-work blockchains, such as Bitcoin, where a miner or a coalition strategically withholds newly discovered blocks and selectively publishes them to maximize their revenue at the expense of the network’s security and fairness. This attack exploits the incentive misalignment in longest-chain consensus protocols, and its analysis has led to a rigorous body of literature precisely characterizing its mechanics, profitability, game-theoretic equilibria, countermeasures, and empirical impact.

## 1. Formal Model and Strategy Mechanics

The canonical selfish-mining attack, as formalized by Eyal and Sirer, involves a mining pool controlling a fraction $\alpha$ of the total network hash power. The attack is governed by maintaining a private fork that leads the public chain by $\ell$ blocks, and strategically releasing blocks to invalidate honest work and gain a higher fraction of block rewards. The protocol’s dynamics are captured by a Markov chain where each state corresponds to the lead $\ell$ and transitions are determined by whether the selfish or honest miners find the next block [1311.0243]. The key rules are:

- If the attacker’s private lead is at least two, continue mining privately.
- When the public chain catches up, the attacker publishes just enough blocks to maintain its advantage or initiate a fork.
- In case of a tie, honest miners split their effort between the competing forks, parameterized by $\gamma$, the tie-breaking fraction favoring the attacker.

This mechanism causes honest miners to waste computational effort on blocks that are eventually orphaned, boosting the attacker’s effective block reward ratio above their nominal share.

## 2. Profitability Thresholds and Revenue Analysis

The profitability of selfish mining is determined by the parameter values $(\alpha, \gamma)$. The attack becomes profitable (i.e., yields a higher relative revenue $R(\alpha, \gamma)$ than honest mining) for
\[
\alpha > \frac{1-\gamma}{3-2\gamma}
\]
with the revenue function
\[
R(\alpha, \gamma) = \frac{\alpha (1-\alpha)^2(4\alpha + \gamma(1-2\alpha)) - \alpha^3}{1 - \alpha[1 + \alpha(2-\alpha)]}
\]
[1311.0243]. For the worst-case (naive) tie-breaking scenario $\gamma=0$, the threshold is $\alpha>1/3$; with uniform splitting $\gamma=1/2$, the threshold is $\alpha>1/4$.

A crucial insight is that these thresholds can be manipulated: large, well-connected pools can increase $\gamma$ by dominating block dissemination, reducing the threshold and making the system vulnerable to smaller colluding pools.

Ethereum adapts this model, introducing additional combinatorial complexity due to uncle/nephew block rewards and difficulty adjustment that accounts for both regular and uncle blocks. This leads to different profitability regions and further incentives for variant strategies [1904.13330].

Elastic hash supply magnifies the threat. When honest miners quit unprofitable mining, the attacker's share increases, potentially causing a runaway effect that destabilizes the chain once a critical $\alpha$ (empirically, $\sim$29%) is exceeded [2103.08007].

## 3. Advanced Strategies and Stochastic Modeling

Optimal selfish mining strategies generalize beyond the basic protocol to include stubborn mining (where the attacker withholds even when the public chain catches up) and L-stubborn mining (where the attacker matches honest blocks up to a parameterized stubbornness $L$ before switching to standard selfish mining). These strategies are formalized with Markov chains and analyzed using stochastic models [2501.03227].

Revenue, risk of double-spending, and profitability thresholds for these generalized strategies are derived in closed form. For example, the attack’s success probability as a function of the $k$-confirmation rule can be explicitly characterized, allowing protocol designers to choose $k$ with a clear understanding of the associated risks.

Reinforcement learning and MDP solvers have been employed to automate the discovery of optimal variants and to study multi-agent equilibria. Notably, with more than two selfish miners, honest mining often emerges as the only Nash equilibrium due to the instability of coalitions and diminishing returns for deviators [1912.01798].

## 4. Empirical Detection and Prevalence

Empirical evidence of selfish mining and cartels has been found in multiple cryptocurrencies using statistical analysis of block-mining sequences. Specifically, Type II binomial tests for consecutive block wins per miner detect anomalously frequent runs indicative of strategic withholding [2208.05748]. Table 1 summarizes detection rates across blockchains:

| Coin         | ≥25% anomalous periods | 100% anomalous periods |
|--------------|-----------------------|------------------------|
| Bitcoin      | 6.2%                  | 1.8%                   |
| Litecoin     | 5.1%                  | 1.0%                   |
| Monacoin     | 83.7%                 | 48.9%                  |
| Ethereum     | 14.3%                 | 4.8%                   |
| Bitcoin Cash | 74.2%                 | 40.8%                  |

Clustering heuristics further reveal coordinated “mining cartels,” especially in Monacoin and Bitcoin Cash, with persistent deviations from honest mining expectations [2208.05748].

## 5. Countermeasures and Protocol Defenses

Multiple countermeasures have been proposed, ranging from protocol modifications to economic disincentives:

- **Tie-breaking randomization:** Modifying the honest mining protocol to relay all competing tips and break ties uniformly at random raises the profitability threshold, making selfish mining infeasible below $\alpha=1/4$ [1311.0243].
- **Dummy block or forced publication timers:** Imposing a hard time limit for block publication (e.g., inserting “dummy blocks” after a specified interval) guarantees that private forks cannot be withheld indefinitely and restores honest mining as the dominant strategy [2310.19170, 1605.02435].
- **Difficulty adjustment incorporating orphans:** Adjusting difficulty based on both included and orphaned blocks neutralizes the attack’s main profit vector for sub-majority attackers [1805.08281].
- **Adaptive learning-based fork resolution:** Employing learning automata to dynamically tune fail-safe thresholds for fork resolution decisions can raise the selfish-mining threshold to $0.4-0.46$, effectively making the attack impractical for all but the largest pools [2302.12096, 2301.11463].
- **Piggyback counterstrategy:** If an honest pool switches to “piggyback” mode upon detecting mining-rate slowdown due to a selfish pool, it can overtake the selfish fork and claim all future rewards, thereby neutralizing the incentive for deviant strategies [2304.06313].
- **Prevention in efficient proof systems:** In blockchains using efficient proof systems (e.g., proof-of-stake, proof-of-space), optimal selfish mining can be synthesized automatically using $\epsilon$-tight MDP analysis, revealing even larger vulnerability windows and motivating tight protocol design [2405.04420].
- **Protocol-specific tuning:** Systems like Bicomp adjust tenure length and PoW difficulty to push the break-even attacker fraction well above the classical threshold, achieving resistance against sub-majority attacks [1809.06289].

## 6. Impact of Decentralization, Pool Distribution, and Multi-Agent Dynamics

Recent work incorporates the distribution of honest hash power (“petty-compliant” pools), showing that greater pool decentralization can sometimes favor selfish mining by lowering the attack threshold due to weaker coordination among honest miners [2502.07410]. In multi-agent games, as revealed by deep RL and theoretical analysis, the instability of selfish mining coalitions impedes real-world exploitability, as any attempt at collusion is prone to defection and strategy shifts [1912.01798, 2202.08466].

Partial selfish mining broadens the strategy space by allowing attackers to release partial block data and attract rational miners, yielding even higher profits and further complicating the equilibrium structure [2207.13478].

## 7. Limitations, Controversies, and Open Directions

While the theoretical model of selfish mining is now well-understood, practical exploitability depends on real-world synchrony, propagation delays, miner rationality, and the accuracy of miner detection algorithms. Not all defenses are practical for immediate adoption, and some (e.g., reliance on block timestamps) may themselves introduce new vulnerabilities.

A persistent challenge is maintaining incentive compatibility as mining landscapes evolve. Protocol changes—such as hard-coded tie-breaking, fork resolution based on timestamps or weight, or learning-based mechanisms—must be weighed against backward compatibility, decentralization, and network efficiency.

Empirical evidence confirms that selfish and cartel mining have occurred, though not universally, and that strategic behavior is more easily sustained in altcoins with less hash-rate concentration. The ongoing shift towards hybrid consensus and efficient proof systems will necessitate further analysis of attack surfaces and optimal defenses.

---

**Key References:**  
- "Majority is not Enough: Bitcoin Mining is Vulnerable" [1311.0243]  
- "On profitability of selfish mining" [1805.08281]  
- "Insightful Mining Equilibria" [2202.08466]  
- "Partial Selfish Mining for More Profits" [2207.13478]  
- "Selfish Mining in Ethereum" [1904.13330]  
- "Variable Depth Hybrid Learning Automaton and Its Application to Defense Against the Selfish Mining Attack in Bitcoin" [2302.12096]  
- "Majority is not Needed: A Counterstrategy to Selfish Mining" [2304.06313]  
- "Mining Power Destruction Attacks in the Presence of Petty-Compliant Mining Pools" [2502.07410]  
- "SquirRL: Automating Attack Analysis on Blockchain Incentive Mechanisms with Deep Reinforcement Learning" [1912.01798]  
- "Fully Automated Selfish Mining Analysis in Efficient Proof Systems Blockchains" [2405.04420]

Source: https://www.emergentmind.com/topics/work-optimal-pram-algorithms