What Is a 51% Attack?

DEFINITION

A 51% attack is a blockchain vulnerability where a single entity gains majority control of the network's mining power or stake, allowing them to reorganize transaction history and double-spend funds.

Blockchains are designed as trustless systems where no single entity has authority over the network. They achieve this through consensus mechanisms like proof of work or proof of stake, which require a majority of participants to agree on the valid state of the ledger. This decentralized design assumes that honest participants will always control the majority of the network's resources. However, if a single actor or group manages to acquire more than 50% of the network's mining hash rate or staked tokens, this assumption is broken. This scenario is known as a 51% attack.

A 51% attack effectively centralizes a decentralized network for a short period. It allows the attacker to manipulate the consensus protocol to their advantage, often causing significant financial damage to exchanges and undermining confidence in the affected blockchain. While major networks like Bitcoin have grown so large that such attacks are theoretically possible but economically unfeasible, smaller blockchains remain vulnerable. Understanding the mechanics of these attacks is essential for developers and investors to assess the security profiles of different blockchain networks.

The Mechanics of a 51% Attack

A 51% attack relies on the longest chain rule or heaviest chain rule used by most blockchains to resolve disagreements. When two blocks are mined at the same time, the network momentarily forks. The protocol is programmed to follow the chain that has the most accumulated proof of work because it represents the majority decision of the network. Nodes automatically discard the shorter chain and reorganize onto the longer one.

In a 51% attack, the malicious actor does not play by the standard rules of broadcasting blocks to the network immediately. Instead, they begin mining a private version of the blockchain. Because they control more than 50% of the hashing power, they can mine blocks faster than the rest of the honest network combined. While the public blockchain continues to process transactions normally, the attacker is building a secret chain that is steadily outpacing the public one.

Once the attacker's chain is longer than the public chain, they broadcast it to the network. The honest nodes, following the hard-coded protocol rules, detect that this new chain has more accumulated work. They are forced to accept the attacker's chain as the valid truth and discard the blocks they had previously accepted. This rewriting of history is what enables the attacker to manipulate transactions that were already considered final by the rest of the network.

The Primary Goal: Double Spending

The financial motivation behind most 51% attacks is double spending. In a digital cash system, double spending is the equivalent of counterfeiting. It involves spending the same unit of cryptocurrency twice. In a secure blockchain, the consensus mechanism prevents this by verifying that the funds haven't been spent before adding a transaction to a block. However, an attacker with majority control can bypass these checks by rewriting the transaction history.

To execute a double spend, the attacker typically sends a large amount of cryptocurrency to an exchange and sells it for another asset or cash. This transaction is included in the public blockchain. Simultaneously, on their secret chain, they include a conflicting transaction that sends those same funds back to their own wallet instead of the exchange.

After the exchange confirms the initial deposit and releases the funds to the attacker, the attacker broadcasts their secret chain. Since the secret chain is longer, the network accepts it as the truth. The block containing the deposit to the exchange is orphaned or discarded, and replaced by the block containing the transaction to the attacker's wallet. The result is that the attacker keeps the original crypto and also has the money they received from the exchange. The exchange is left with a loss, having traded away assets for a deposit that the network now says never happened.

What Attackers Can and Cannot Do

A 51% attack does not give the attacker total control over the blockchain. Even with majority control, the attacker is bound by the cryptographic rules of the protocol. They cannot alter the fundamental properties of the ledger or access funds that do not belong to them.

An attacker cannot steal funds from other users' wallets because they do not possess the corresponding private keys. They cannot guess private keys or sign transactions on behalf of other people. Furthermore, they cannot change the issuance schedule of the token or print new coins out of thin air. The protocol rules regarding block rewards and total supply are validated by every node, and an invalid block violating these rules would be rejected by the network regardless of the hash rate backing it.

The scope of a 51% attack is limited to the transaction history. The attacker can reverse their own transactions to double spend, preventing specific transactions from being confirmed, or censor specific users by refusing to include their transactions in blocks. The damage is primarily focused on the immutability of recent history rather than the cryptographic security of individual accounts. This means that while the network's integrity is compromised, funds sitting in cold storage are technically safe from direct theft during the attack.

Real-World Examples

History provides several examples of 51% attacks, mostly occurring on smaller blockchains that share a mining algorithm with a much larger network. One of the most notable victims is Ethereum Classic (ETC). Because ETC uses the same hashing algorithm as Ethereum (prior to Ethereum's switch to proof of stake), miners could easily rent or redirect hash rate from Ethereum to attack the smaller Ethereum Classic network. ETC suffered multiple 51% attacks in 2019 and 2020, resulting in millions of dollars in double-spend losses for exchanges.

Bitcoin Gold (BTG), a fork of Bitcoin, experienced a similar fate. In 2018, attackers gained control of the network's hash rate and successfully double-spent roughly $18 million worth of BTG. The attackers deposited funds to exchanges, sold them, and then reorganized the chain to erase the deposit transactions. This highlighted the vulnerability of minority forks, blockchains that split from a major chain but fail to secure a significant portion of the original mining power.

These incidents demonstrate that 51% attacks are not theoretical edge cases but real risks for networks with low hash rates. They have forced exchanges to increase the number of confirmations required for deposits on smaller chains, sometimes waiting days before crediting user accounts to ensure the transaction history is essentially irreversible.

The Cost of Attack: Bitcoin vs. Altcoins

The feasibility of a 51% attack is almost entirely economic. It comes down to whether the cost of acquiring the necessary hash rate is lower than the potential profit from double spending. For a network like Bitcoin, the cost to attack is astronomical. An attacker would need to acquire more computing power than all existing Bitcoin miners combined. This would require billions of dollars in specialized hardware and electricity, along with the logistical nightmare of sourcing and powering millions of machines. Furthermore, attacking Bitcoin would likely crash its price, rendering the stolen or double-spent coins worthless.

In contrast, smaller altcoins are far cheaper to attack. The existence of hash rate marketplaces allows attackers to rent computing power for short periods rather than buying hardware. If a small blockchain uses a common algorithm like SHA-256 or Scrypt, an attacker can rent enough hash rate from a marketplace to overpower the network for a few hours. This turns a capital-intensive hardware investment into a manageable hourly rental fee.

Websites that track the theoretical cost of attacking various networks often show that while Bitcoin costs billions to attack, some micro-cap coins can be overwhelmed for a few hundred dollars per hour. This economic disparity explains why 51% attacks are virtually unheard of on the largest networks but remain a persistent threat for smaller, proof of work blockchains.

Prevention and Mitigation Strategies

Preventing 51% attacks requires increasing the cost and difficulty of acquiring majority control. For proof of work chains, the primary defense is simply growing the network's total hash rate. The more miners participating, the more expensive it becomes for a single entity to dominate. However, for smaller chains that cannot organically attract massive hash rate, developers often implement alternative defenses.

One common mitigation is the use of checkpoints. Developers or community leaders can hard-code specific blocks into the software as final and immutable. This prevents the client from reorganizing the chain deeper than the checkpoint, limiting the potential damage of a reorganization. While effective, this approach introduces a degree of centralization, as the developers effectively decide which chain is the valid one.

Another strategy is the transition to proof of stake. In this model, an attacker must acquire 51% of the staked tokens rather than computing power. Attempting to buy 51% of the total supply would drive the token price up drastically, making the attack prohibitively expensive. Additionally, if an attacker attempts a malicious reorganization in a proof of stake system, the network can slash their stake, destroying their funds. This provides a strong economic penalty that does not exist in proof of work, where an attacker's hardware remains intact even after a failed or malicious attack.

The Future of Consensus Security

As the blockchain industry matures, the threat of 51% attacks continues to drive innovation in consensus mechanisms. The shift toward proof of stake and the implementation of advanced finality gadgets are making it increasingly difficult for attackers to revert transaction history. For institutional stakeholders and developers, understanding these dynamics is crucial for evaluating the settlement assurances of a given network. While no decentralized system is entirely immune to majority collusion, the economic barriers protecting major networks have proven resilient, shifting the focus from theoretical vulnerabilities to practical risk management and vigilant network monitoring.

Disclaimer: This content has been generated or substantially assisted by a Large Language Model (LLM) and may include factual errors or inaccuracies or be incomplete. This content is for informational purposes only and may contain statements about the future. These statements are only predictions and are subject to risk, uncertainties, and changes at any time. There can be no assurance that actual results will not differ materially from those expressed in these statements. Please review the Chainlink Terms of Service, which provides important information and disclosures.

Learn more about blockchain technology