A 51% attack is a type of cyber attack when a miner or a group of miners gains control of more than 50% of the power of the network’s hashing power. This majority power of miners can then be used for double-spending, censorship of transactions, halting the network and other malicious activities.
A 51% attack can happen with any blockchain network with a proof-of-work consensus mechanism, e.g. Bitcoin , Litecoin, and Ethereum. Blockchain networks are secured by miners, who are responsible for validating transactions, creating and adding new blocks to the blockchain, and securing the network. If one miner or a group of collaborating miners control more than 50% of the network’s mining hashrate, they can rewrite the blockchain’s history and even double spend coins.
A double spend is a form of fraud in which the same cryptocurrency is used more than once by the same user to make multiple transactions. A malicious miner operating with majority hashing power is able to spend coins, then come up with an alternative version of the blockchain that doesn't include the spent coins, meaning they can reversethe payment and spend the coins again on another transaction.
On top of double-spending, majority hashrate holders also have the ability to censor transactions they don’t like and even halt the entire blockchain network. In theory, a nefarious miner could refuse to include some transactions or even halt all the transactions in the network just by taking control of more than half of the hashing power. Therefore, 51% attacks pose a serious security risk to Bitcoin and other Proof of Work blockchains.
While it is possible to conduct a 51% attack on any blockchain that uses Proof of Work consensus, the cost of orchestrating such an attack is significant. It’s almost impossible to attack Bitcoin since the cost of control 51% of the network’s hashrate is very high. This is due to the fact that it is difficult to acquire the hardware necessary to create enough hashpower to bring down the entire Bitcoin network.
In conclusion, 51% attacks pose a serious security threat to any blockchain that uses a proof-of-work consensus mechanism. Fortunately, the high cost of a 51% attack makes it virtually improbable to attack Bitcoin, Ethereum, and other major blockchains. That being said, smaller proof-of-work blockchains are much more vulnerable to 51% attacks. Finally, miners should always be aware of the risks of a 51% attack and act accordingly.