1. 程式人生 > >Blockchain: how a 51% attack works (double spend attack)

Blockchain: how a 51% attack works (double spend attack)

This is a double-spend attack. It is commonly referred to as a 51% attack because the malicious miner will require more hashing power than the rest of the network combined (thus 51% of the hashing power) in order to add blocks to his version of the blockchain faster, eventually allowing him to build a longer chain.

So how is Bitcoin secured against this?

In reality these attacks are extremely hard to perform. Like mentioned before, a miner will need more hashing power than the rest of the network combined to achieve this. Considering the fact that there are perhaps even hundreds of thousands of miners on the Bitcoin blockchain, a malicious miner would have to spend enormous amounts of money on mining hardware to compete with the rest of the network.

Even the strongest computers on earth are not directly competitive with the total computational power on this network. And there are countless other arguments against performing a 51% attack. For example the risk of getting caught and prosecuted, but also electricity costs, renting space and storage for all the mining hardware, covering your tracks and laundering the money. An operation like this is simply put way too much effort for what it will give the attacker in return, at least in case of the Bitcoin blockchain.

Random guy with some mining hardware.

Are other blockchains vulnerable?

Another interesting story is though, regardless of how hard it should be to perform such an attack, that numerous 51% attacks have actually occurred in the past. In fact, an attack was performed quite recently (april 2018) on the Verge (XVG) blockchain. In this specific case, the attacker found a bug in the code of the verge blockchain protocol that allowed him to produce new blocks at an extremely fast pace, enabling him to create a longer version of the Verge blockchain in a short period of time. This example illustrates an event that can facilitate a 51% attack, although quite rare and often thanks to a bug in the protocol code. A credible team of blockchain developers will probably notice a bug like this and prevent it from being abused.

When examining this Proof of Work algorithm (the mining algorithm), it tells to us that more active hashing/computational power leads to more security against a 51% attack. Smaller blockchains that operate on this algorithm though, like a small altcoin, may be significantly more vulnerable to such attacks considering there is not way as much computational power for the attacker to compete with. This is why 51% attacks usually occur on small blockchains (Bitcoin Gold for example) if they occur at all. The Bitcoin blockchain has never been victim of a 51% attack before.

ASIC mining — enhanced mining hardware

This also brings us to one of the latest hot topics in blockchain recently; ASIC mining. ASIC mining is a mining technology developed by various early Bitcoin mining companies to enhance mining hardware, making it much more powerful. A lot of people in the industry are debating right now about whether ASIC miners make certain mining individuals or groups too powerful. The Monero (XMR) blockchain recently implemented a protocol update that blocked ASIC mining from being used to mine on its blockchain. As a result, the total hashing power on the network dropped by a staggering 80% (see below)!

The computational power on the XMR network dropped with 80% after ASIC mining was blocked!

This indicates how much power of the Monero network was in the hands of ASIC miners. If all participants on the network were using ASIC mining hardware, this wouldn’t necessarily be a problem. The problem is though, that big mining companies like Bitmain are suspected to control a large amount of the ASIC mining operations. Even though these organisations distribute this technology to individuals as well, they presumably only do so after using it for a long time themselves first. Some people in blockchain debate on whether this makes them too powerful or not. Ideally, a blockchain should be governed by as many individual miners as possible. This is what makes it more decentralised after all.

A look inside one of Bitmain’s mining facilities in inner Mongolia, China
Another huge mining facility.

Was this article helpful? Help others find it by applauding or sharing. Here are some other short but powerful and easy to understand explanations of blockchain:

You can follow me on medium if you want to stay tuned for more educational blockchain articles. Thank you for reading!