Okay, the user is asking about a 51% attack. They want to know what it is, the context it's relevant in (specifically Proof of Work blockchains), what an attacker needs to control, what they can do, and what they can't do. Let me break this down.
First, I need to define a 51% attack clearly. It's when an entity controls over 50% of the mining hash power. Since the user specified Proof of Work, I should focus on that and mention other consensus mechanisms briefly for context.
Next, the context: Proof of Work blockchains like Bitcoin and Ethereum (before PoS). They rely on miners competing to add blocks. The security comes from the cost of mining, so controlling 51% undermines that.
What the attacker needs: Majority hash rate. But I should clarify it's not just 51% of total network hash rate—it's about the effective hash rate they can control, possibly through renting or pooling. Also, they need to mine privately to avoid detection.
What they can do: Double-spend by reorganizing chains, censor transactions by not including them, and earn all block rewards but that's not really an attack per se. Should emphasize double-spending as the main threat.
What they can't do: Alter old transactions (too expensive), create coins out of thin air (protocol rules), break encryption, or steal funds from wallets. Also, they can't change consensus rules without broad agreement.
Need to stress that it's not instant—they have to consistently outpace the honest chain. Also, the cost is high, so it's economically irrational for large chains but possible for smaller ones. Mention real-world examples like Bitcoin Gold or Ethereum Classic.
Make sure to structure the answer clearly: definition, context, requirements, capabilities, limitations. Keep it technical but accessible, avoiding jargon where possible. Double-check facts about what's possible vs. impossible—like creating coins is prevented by the consensus rules, not just by having hash power.
Excellent question. Let's break down the 51% attack comprehensively.
1. What is a "51% Attack"?
A 51% attack is a situation where a single malicious entity or coalition gains control of more than 50% of the total mining hash rate (computational power) of a Proof-of-Work (PoW) blockchain. This allows them to monopolize the block creation process and rewrite the blockchain's recent history according to the ** Nakamoto Consensus** rules.
2. In What Context is it Relevant?
It is exclusively relevant to blockchains that use Proof-of-Work (PoW) as their consensus mechanism. The attack exploits the fundamental security assumption of PoW: that the majority of hash power is controlled by honest miners following the protocol's rules.
- Classic Examples: Bitcoin (BTC), Litecoin (LTC), Bitcoin Cash (BCH), Ethereum Classic (ETC), and many smaller PoW coins.
- Not Relevant to: Proof-of-Stake (PoS) blockchains (like Ethereum post-"The Merge"), Delegated Proof-of-Stake (DPoS), or other consensus mechanisms. They have different attack vectors (e.g., a "nothing-at-stake" or long-range attack in some PoS systems).
3. What Does an Attacker Need to Control?
To execute a 51% attack, an attacker must control >50% of the effective network hash rate for a sustained period.
How this control is achieved:
- Self-mining: Building or controlling massive mining farms (extremely capital-intensive for major chains like Bitcoin).
- Renting Hash Power: Using services like NiceHash to rent hash power from elsewhere. This is often the most economical method for attacking smaller chains.
- Pool Collusion: Convincing one or more large mining pools to act maliciously (politically or financially motivated).
- The key is "effective" control: Even if you don't own the hardware, if you can command >50% of the blocks being found on the network at a given time, you have the attack capability.
4. What CAN an Attacker Do? (The Immediate Powers)
With >50% hash power, the attacker can:
- Perform Double-Spending: This is the primary and most damaging goal. The attacker:
- Sends coins to a victim (e.g., an exchange) in a public transaction.
- Privately mines an alternative chain starting from a block before that transaction, where they instead send those same coins back to themselves.
- Because they have more hash power, their private chain will eventually become longer than the public chain. They then broadcast this longer chain, which the network will adopt as the valid history (due to the "longest valid chain" rule). The transaction to the victim is erased from history, but the victim may have already given up goods/services or credited the attacker's exchange account.
- Censor Transactions: They can simply refuse to include specific transactions in the blocks they mine. If they control the majority, the honest minority cannot outpace them. This can:
- Block transactions from certain addresses.
- Prevent transactions from ever confirming, effectively freezing funds.
- Bias the mempool (pool of unconfirmed transactions).
- Earn All Block Rewards & Fees: All newly minted coins and transaction fees from the blocks they mine go to them. While not an "attack" per se, it's an economic windfall that helps fund the attack.
- Temporary Network Disruption: By consistently mining empty blocks or withholding blocks, they can slow down transaction confirmation times for the entire network.
5. What CAN an Attacker NOT Do? (The Fundamental Limits)
Critically, >50% hash power does NOT mean "total control." The attacker is still bound by the protocol's consensus rules. They cannot:
- Create Coins Out of Thin Air / Steal Existing Coins: They cannot violate the consensus rules on coin issuance. The block reward is fixed by the protocol. They cannot increase it, mint coins to an address of their choice without mining, or spend coins they do not own (like taking coins from an arbitrary address). They can only spend coins for which they have the valid private key.
- Reverse Very Old Transactions (Deep Reorgs): While they can reorganize recent blocks, reorganizing blocks that are too old (e.g., 6+ confirmations in Bitcoin) becomes exponentially difficult and risky. Other nodes on the network will reject an extremely long reorg as invalid. The attack is most effective on unconfirmed transactions or very recent confirmations (1-2 blocks). Reversing deeply buried transactions would require a sustained, massive hash rate advantage that would be economically irrational.
- Alter the Past: They cannot change the historical record arbitrarily. They can only create a new, longer branch starting from some point in the past. The "past" before their chosen branching point is immutable.
- Break Cryptography: They cannot forge digital signatures, steal funds from wallets without the private key, or alter the underlying cryptographic primitives (SHA-256 in Bitcoin).
- Change Consensus Rules Unilaterally: They cannot force a change to the protocol itself (e.g., increase the block size, change the inflation rate). Any meaningful rule change requires broad social and economic consensus from the entire community, not just hash power. If they tried to mine blocks with invalid rules (by everyone else's standard), those blocks would be rejected by all honest nodes, and they would essentially be mining on a worthless fork.
6. Practical Realities & Why Bitcoin is "Safe"
- Cost Prohibitive for Major Chains: For Bitcoin, acquiring >50% of the current ~600 EH/s hash rate would require hundreds of billions of dollars in hardware, electricity, and facilities—an impossible feat without immediate detection and market collapse.
- Short-lived & Self-Defeating: The attack would be instantly noticed. The value of the cryptocurrency would plummet as trust evaporates. The attacker's massive holdings and the value of their mining equipment would become worthless. It's economically irrational for a large, valuable chain.
- Relevant for Small Coins: The attack is a real and recurring threat for small-cap PoW coins with low hash rates (e.g., Bitcoin Gold, Ethereum Classic have suffered multiple attacks). Renting hash power to attack them is relatively cheap and profitable via double-spends.
Summary
| Aspect | Description |
|---|
| Core Requirement | Control >50% of the effective mining hash rate. |
| Primary Context | Proof-of-Work (PoW) blockchains (Bitcoin, Litecoin, etc.). |
| What an Attacker CAN Do | Double-spend (main threat), censor transactions, earn all rewards. |
| What an Attacker CANNOT Do | Create coins, steal from others, break cryptography, change rules, or reverse deeply confirmed transactions. |
| Economic Reality | Feasible and profitable on small, low-hash-rate chains; prohibitively expensive and self-defeating on major chains like Bitcoin. |
The 51% attack is a stark illustration of the security-economy trade-off in PoW: security is directly proportional to the total cost of attacking the network, which is why a large, expensive-to-attack network like Bitcoin is considered highly secure against this specific vector.