Blockchain Hacking: 51% Attack

As we already know, miners are an important part of Bitcoin. The verification of transactions and, to a large extent, the security of the cryptocurrency depends on them. But they are not the only ones who face the incredible task of ensuring network security, especially when the threat of an attack looms.

51% Attack

With the advent of cryptocurrencies, we hear all the time about the threats of hacker attacks, repeated and DoS attacks. There are a lot of them, and they all threaten the security of Blockchain.

What kind of security are we talking about? What can happen?

To explain this and much more, we’ll tell you what threats exist. Today we will talk about what the 51% attack is, and what danger it poses to Bitcoin.

A bit of context

A bit of context

First of all, Bitcoin and other cryptocurrencies are based on a fundamental principle: decentralization. Thanks to this principle, all network participants have a copy of the blockchain account book. Participants are usually referred to as “nodes”.

Each copy reflects the same complete history of all transactions that have occurred since the beginning of the network. In Bitcoin, this means that every transaction since January 3, 2009 is on the blockchain of this network. But since there is no central node in Bitcoin, all nodes must have their own copy. So they check transactions and new blocks mathematically to make sure everything is OK.

These checks are very simple. But you should keep one thing in mind: checking transactions / blocks is not mining. Rather, this task means checking that the extraction task was correct and is a very simple mathematical operation. If the validation operation is successful, the nodes add a new transaction to their copy of the ledger, and if not, they discard it. After this action, the network is programmed to track the longest block chain (yes, there are constantly forking attempts that remain unsupported).

All this is handled autonomously thanks to consensus protocols. The bottom line is that if more than 51% of the nodes accept something as a majority, it is democratically decided that it is “true”. Thus, the chain that receives support from 51% of the network becomes the longest chain.

What’s the problem

But surely you will ask yourself: what is the problem in this scheme of work? What if more than 51% of the nodes decide to lie because they are connected to that lie and benefit from it?

What is theoretically possible has become impossible due to its technical complexity and cost. In addition, there are not many advantages that can be obtained from what we see in game theory (Nash Equilibrium).

As you may have already realized, each node makes the network more secure, which avoids the falsification of blockchain accounts. When we mention” nodes”, it is important to understand that they are not necessarily miners. These are all those computers that are connected to the Bitcoin P2P network. Miners are also nodes, but with activated functionality to solve mining problems, so to be a node, you don’t need to spend electricity on top of what a computer with an Internet connection consumes.

The security of Bitcoin (and any distributed system) is directly proportional to the decentralization of its nodes.

Source of the threat

Source of the threat

A 51% attack occurs when a single person or group controls 51% of the network’s computing power. In other words, it will have more computing power than all the other miners, and more participants to “vote” than the rest combined. A situation that could negatively affect this distributed electronic system by temporarily changing the operation of the network. It’s a theory. Even Bitcoin’s own whitepaper explicitly mentions the 51% attack scenario. In fact, living with this type of infrastructure was an unavoidable evil.

This debate is not just about the present. In the past, there have also been times of much doubt surrounding the  “specter” of a 51% attack on Bitcoin. Since the beginning of 2014, the cloud mining company Ghash.IO was dangerously close to 50% of the total hash (or power) of the Bitcoin mining network. This situation has created uncertainty for all those users who have just discovered the BTC. However, the company is currently no longer operational, and BItcoin’s hashing power is more distributed.

But how can this be done? Let’s look at a simpler example.

What it takes to destroy Bitcoin: Make a 51% attack.

The recipe is very simple, you just need to get 51% of the network, that is, about 6000 nodes.

In addition, you must have a sufficiently powerful network of miners so that you can always mine a block. So, whenever you mine a block, your 6000 nodes will check what you are doing, not what others are doing.

Of course, you need to do everything very quickly, in seconds.

Does this mean the end of Bitcoin and the continuation of the fiat currency regime?

Unfortunately for the attacker and for the world of all these good people, the answer is no. In practice, this is currently not possible. Nodes may be “cheap”, but miners are not, as is their electricity.

“But the bank prints money for free, it can buy anything it wants,” you might think.

It’s true. Due to the competition-based scenario, the attacker is required to make sure that his attack occurs continuously and in seconds, which is impossible, since each block is mined in 10 minutes, and in just a few seconds it will be detected.

However, imagine that this is done at a different time or in a different context.

The end result will be that the attacker will control the network, spending huge amounts of money. For what? For example, to make double expenses that may eventually pass. But it will be detected by the network, which will eliminate it by branching out and leaving it aside.

Many financial organizations dared to claim that Bitcoin could be easily subdued, and after a few months they had to correct this statement.

The Bank of Canada itself, among other things, had to correct this statement after it questioned the security of Bitcoin. After a deep understanding of the principles of the crypto asset, a study was conducted, the result of which guarantees that it is currently almost impossible to disrupt the Bitcoin network through a successful 51% attack.

Current situation in the network

There are currently more than 10,000 nodes. However, the scenario is not perfect. Why?

Bitcoin has millions of users, but only about 10,000 nodes. This means that almost all people using Bitcoin do not have their own node, they use third-party nodes: for example, users of online wallets, exchangers, etc.

On the other hand, as we explained, miners are a very important part. These are the ones that create the blocks needed to validate transactions. Without blocks, there are no secure transactions. Nodes can only check the work, that is, in this case, the work of the miners.

The problem is that within the mining capacity, we don’t know how many nodes there are, and more than 60% of the mining capacity is currently just 5 large pools.

Cost and consequences

Cost and consequences

In the case mentioned above, these organizations could use this advantage to perform operations:

  1. Reverse transactions and double spending with BTC
  2. To avoid evidence of transactions that should undergo a regular check
  3. Prevent other miners from mining valid blocks

Despite this, the time and investment that would be required to conduct such an attack is so high and complex that it would not be optimal for the individual or organization concerned. Let’s look at some actions that the attacker could not perform:

  1. Change the number of coins generated by each block
  2. Creating coins out of nothing
  3. Send coins that never belonged to him

However, hypothetical 51% attack scenarios on Bitcoin have been discussed for years, and many solutions have been proposed. For example, Gavin Andresen.

Gavin Andresen (developer of the Bitcoin project) added some details and explanations about this attack on his Gavintech website:

“Something like” ignore the longer chain that orphaned the current best chain if the amount (priorities of transactions included in the new chain) is much less than the amount (priorities of transactions in the part of the current best chain that will be lost)” would mean that 51% of the attacker would need to have both more hashing power and a lot of old high-priority Bitcoins to support a transaction denial-of-service attack. And they will run out of old high-priority Bitcoins pretty quickly, and they will be forced to either include other people’s transactions, or their chain is rejected.”

According to Gavin, protecting the network from a 51% attack will be relatively simple, forcing the attacker to have a very high priority for hashes and BTC power.

The time that the attack will last will be relatively short, and the attacker will quickly run out of high-priority BTC, and he will be forced to include transactions from others, or abandon his chain.

Conclusion

It is clear that there are more and more nodes, but we must continue to promote decentralization, and much depends on each of you.

We are not a simple community. In Bitcoin, you have power.

Bitcoin is an incredible technological, financial, political and social revolution, but it depends on each of us whether it will become stronger and stronger.