Breaking Blockchain
Distributed Ledger Attack Vectors and Weaknesses
You ever see one of those TV shows or movies with a "computer expert" who tries hacking into someone else's device or account? Chances are, it went something like this:
Hacking, as it's known to most people, is the unauthorized attempt to exploit a weakness in a device or account usually with the purpose of taking control of said device or account, just to access something that isn't yours. The above video is obviously only for entertainment purposes; usually hacking is meticulous, time-consuming, and not that easy.
Blockchain systems and distributed ledger technologies, for all their intents and purposes, aren't immune to "hacking", but the methods of which they are performed are different than from the normal network or computer system.
Blockchain technology is extremely secure, but the inevitable side effect of any computer system are vulnerabilities. These vulnerabilities often reveal themselves once the system is put to the test on a test network. Every distributed ledger and consensus algorithm are faced with and must resolve the same set of attack vectors, including:
- Double Spend
- Penny Spend
- Spam and Denial of Service
- 51% attack
- Eclipse Attack
Bonus: Quantum Computing
Most of these attacks relate to Byzantine Fault Tolerance, a key characteristic of Blockchain security. Here's a great article explaining what BFTs are to the "average layman" by a fellow TKS member. If any of these attacks are successful, and the integrity of the system is compromised, the Blockchain can no longer be trusted. Breaking down and understanding the vulnerabilities of Blockchain are equally as important as the applications and investment strategies.
1. Double Spending
It's exactly as it sounds. Double spending is when a single node in a distributed network attempts to "spend funds twice" by attempting to send two transactions simultaneously. A successful Double spend would mean a person with $10 in his account could spend up to $20. On most blockchain systems, this is prevented with consensus algorithms like proof-of-work.
2. Penny Spending
A penny-spend attack is where an attacker spends infinitesimal quantities to a large number of accounts to waste the storage resources of nodes. Imagine spending 100 million pennies separately instead of spending 1 million dollars in one go.
3. Spam and Denial of Service
DoS attacks are infamous for blocked out websites and malfunctioning game servers. These days, DoS attacks are prevented by having good security systems that can find the source of the spam and block the address. Where it gets really difficult is if an attacker attempts a DDoS, or a Distributed Denial of Service attack. In a DDoS attack, instead of the spam coming from a single origin, the spam is coming from multiple addresses. Blockchain systems again turn to consensus algorithms to ensure an account can't spam the system.
4. 51% attack
The fundamental concept of voting and consensus; majority wins. In this case, majority means 51%, although in some systems, the number could be anything from 33% or 20% or sometimes even more than half. in a 51% attack, an attacker takes control of over 51% of a blockchain network. Obviously, this is ridiculously difficult; a hacker would have to simultaneously hack 51% of accounts on a network, or open enough unique accounts to make up 51% of a network. This is so inefficient and expensive you'd probably have better luck asking 51% of the world population for a penny each to get your money instead.
5. Eclipse Attack
This one's a bit technical and is a bit harder to pull off. A fundamental requirement of a Blockchain system is that nodes on the blockchain must remain in constant communication in order to accept, send, and compare data. As MIT technology review put it;
"An attacker who manages to take control of one node’s communications and fool it into accepting false data that appears to come from the rest of the network can trick it into wasting resources or confirming fake transactions."
From a hacker's standpoint, this is difficult to pull off but entirely possible and extremely problematic. This attack specifically takes advantage of miners who's sole purpose is to solve cryptographic hashes. The attacker could, in theory, have miners waste time on a nonsense hash, or a hash that has already been solved, while he takes his sweet time calculating the real hash; the one that will reward him upon successful completion.
Bonus: Quantum Computing
This one's a fun idea. Instead of computing the correct hash through trial an error, what if you could calculate all possible hashes simultaneously? Instead of needing to hack multiple accounts to have enough computing power to successfully carry out a DDoS attack, what if a single device had enough computing power to spam a network so fast, it crashes almost immediately. Classical computing is to Quantum computing as a Bow and Arrow are to a Minigun.
They both shoot things, but one shoots things a lot faster and would obliterate anyone dumb enough to bring a bow and arrow to a gunfight.
I classify attacks in two categories:
- @sshole attacks
- Selfish attacks
What's the difference? Attackers always have one or both of two possible reasons to act maliciously; either the attacker is deliberately causing problems just to be a nuisance (@sshole), or the attacker is attempting to take advantage of a security flaw for his or her self-benefit (selfish). Every type of attack can be put into one or both categories. Blockchain applications must be prepared for people to act according to human nature and for the occasional @sshole.
Blockchain Weaknesses
It's important to play devil's advocate for topics that often evoke strong emotional attachment from people in the field. This is especially important for emerging tech like Blockchain systems, and more broadly, Distributed Ledger Protocols.
Apart from pointing out system vulnerabilities, often times an evaluation of guiding principles is needed to thoroughly understand these flaws. What are Blockchain's guiding principles?
- Decentralization
- Security
- Scalability
These 3 principles make up the "Blockchain Trilemma". They are interlocked in a mutable relationship, meaning an increase or decrease in one will likely cause an increase or decrease in another. It's a trade-off. Blockchain is said to be decentralized and secure, but not particularly scalable. As devil's advocate, I'll poke some holes in all three principles.
Blockchain is not Decentralized
First off, It's important to understand that decentralized is just a beta form of distributed; a decentralized system is also a distributed system. But how is Blockchain not decentralized? According to the protocol, every transaction is recorded on the global ledger, regardless of its participation, hence ensuring a certain degree of decentralization.
However, where Blockchain isn't decentralized, is in its consensus algorithm. Proof-of-work has been criticized as being only half decentralized; after all, what's stopping a single entity from putting together enough computing power to mine coins more efficiently than the average Joe with a 2009 Macbook?
There exists computer hardware containing ASIC technology, specifically engineered to mine coins through more efficient proof-of-work computations. While the majority of people just use their computer's CPU, the small minority of people with powerful hardware would have higher chances of being rewarded coins.
Blockchain is not Secure
Apart from the 5 of many possible attacks a Blockchain system can face, there exists another problem that is arguably even worse than the 5 scenarios. This security flaw has less to do with the entire system and more to do with an individual node part of said system. Legacy computers and classical computers have always faced the password problem.
"Ten foot steel safe, only as strong as the guy with the key."
It doesn't actually matter if a Blockchain system uses SHA256 or SHA512 (Hashing algorithms), if a system uses Binary or Ternary (Like IOTA does), or if a system has a ton of nodes that need to be malicious for the entire system to be put at risk. If your password is compromised, all your security systems are irrelevant. This is why centralized systems suck; if someone has the key to the mainframe, he or she have access to everyone's stuff. This is also why the internet is supposedly protected by 7 different keys held by different anonymous individuals.
Should an individual gain access to the keys of multiple nodes in a network, he or she has the means to use these compromised accounts to his benefit. The attacker could drain all funds into his or her own account, use these accounts to spam or penny spend the network into submission. The good news is, this scenario is pretty easy to prevent; just take better care of your passwords. In Blockchain systems your password is often in the form of a cryptographic key. Experts always recommend keeping these keys either in your memory or on an offline device like a USB (Hackers can't do their thing to offline devices).
Blockchain is not Scalable
A well-known argument against Blockchain is how clunky it tends to be. Apart from slow transaction speeds, a ridiculously huge amount of storage space needed, and the incredible amount of energy needed for miners to mine, Blockchain doesn't scale too great. With these setbacks come limits to the number of coins that can be mined, the amount of storage space a ledger can use, and the acceptable energy threshold needed to support worldwide adoption of such methods.
Many Blockchain systems try pruning, which pretty works much like a disk cleanup on your computer. It pretty much means cleaning up the ledger and deleting portions that are no longer relevant or needed; after all, not everyone needs to have an exact copy of the ledger, if a large enough group of people have a copy of just a portion of a ledger, then they can all come together to fill in the gaps.
I could go on about why Blockchain isn't scalable, but this shouldn't make solutions built on Blockchain any less viable. Blockchain is the quintessential form of Distributed Ledger Technology, and each variation has its pros and cons; each protocol works better for different use cases, but more on that for another time. Scalability is the #1 priority for Bitcoin and Ethereum developers right now because it's becoming more of a pressing issue as Blockchain becomes more accepted worldwide.
What Blockchain is not
The Blockchain Trilemma is precisely why each Distributed Ledger Protocol is better for different use cases. If a system had to choose two of the following 3 principles, the system would choose the two that are most important for its purpose. A solution, that is to say, a protocol that is decentralized, secure, and scalable, would effectively break the Blockchain mold and likely become the sole DLT to steal the show.
Takeaways
A final note is just to not believe the hype and the criticism around Blockchain. In terms of development, you'll always have to do thorough research, but even from an investment standpoint, you should always understand what you're getting into. That means reading whitepapers, not the media. That means talking to developers, not other investors. That means understanding the potential risks and weaknesses, as well as the real-life applications and power. The attack scenarios outlined above are only a couple examples, the matter of fact is, Blockchain tech is pretty darn new, which means over time, more attack vectors and weaknesses will pop up.
Ultimately, creating security is a matter of cryptography, software engineering, and game theory; and we're getting better at it every day.
So I still recommend you start investing in the right cryptocurrencies :)