A Deep Dive into Blockchain
Everything you need to know about this growing technology
Do You Trust Me? 😈
Our entire society runs on trust. You trust your boss to pay you. You trust the government to ensure your security. You trust your bank to not steal your money and run away. We blindly trust so many institutions and people without giving it a second thought.
But what if something happens? Your boss doesn’t pay you. The government falls. Your bank invests all your money into the stock market and the stock market crashes, leading you to lose all your savings (Ahem… Stock Market Crash of 2008). It seems impossible that these horrible things could happen. But the fact is, trust is the only thing that holds up these systems. Trust makes you vulnerable and susceptible to damage, but you depend on these systems. You have to trust governments, banks and institutions because there is no alternative. Well, there hasn’t been an alternative until Blockchain, which aims to create a no-trust dependent system. So you don’t have to trust that your bank will run away with your money. You don’t have to trust that your government will fall.
You might be asking yourself, ‘Blockchain seems amazing! How does it work?’ And it is truly amazing, but to get a deep understanding of how blockchain works and is used to disrupt current systems, you first have to understand how current institutions function.
The Issues with Centralization 🌐
Imagine you wanted to send money to your friend on the other side of the world. You wouldn’t mail them a cheque or send them physical cash. That would take too long. Instead, you would send money through Paypal or your bank’s e-transfer system. Fast and easily accessible… right? Wrong. Your bank needs to validate that the money coming from the account is you and you authorized the payment. Then, they need to verify that you’re sending the money to a trusted source, which probably had to be authorized beforehand by you. But before you know it, your friend just received $100 while you paid an extra $10 processing fee.
The idea of a bank or an institution facilitating transfer is the idea of centralization. Everything goes through them and everything comes out on either side. They see everything and no one can access your files. For the most part, this system works and we heavily depend on it as a society. But, there are a couple of issues that come up.
Vulnerability — Since everything is hidden and cataloged in a ‘secure’ database, it makes everyone’s’ info vulnerable. It would only take one database leak for all your credit card details to be leaked. We see this time and time again when big companies suddenly get hacked. It’s happened to eBay, Adobe, Canva and other big notable companies.
Fees and Financial Incentive — Like any other company, institutions that facilitate transfers want to make money. They usually do this by adding a processing fee to their service. You don’t really have a choice as you might rely on some of these institutions.
Power Instability — If only a handful companies facilitate all the transfers that our society needs, then it gives those companies a large amount of power. They can create changes to the system that could have indescribable effects. Now the likelihood of your bank changing up the system is very rare. It’s the fact they have the ability to do so which is so scary. They can leverage their position, which has been done before.
Slow Implementation — If there is a part of the company’s service that negatively impacts a part of the population, chances are that it’ll take months at best to fix the problem. This is because of the long drawn-out process of bureaucracy within big companies. Major changes take a long time, which really hurts those that need immediate change.
All, and I mean ALL these problems are solved with the idea of blockchain. As you’ve probably guessed it, blockchain runs on the opposite of a centralized system. Blockchains are decentralized, with many properties that make it very favorable to people. Here’s how blockchain works.
The Basics of Blockchain: a New Take on Transfer 💻
A blockchain is a decentralized peer-to-peer system of transfer. No one controls the blockchain yet it runs indefinitely. How can something be decentralized? It means that everyone helps to run the blockchain. You technically make up the blockchain. Blockchain runs on a singular concept, a block in which these blocks are chained together, hence blockchain.
Block + Chain:
A block stores a piece of information or data within it. These could be transactions, information or anything. The block is associated with a hash, which is a unique string of characters created by a special cryptographic function. Each hash is unique and is kind of like the id of the block. Each block also contains the hash of the previous block, which is where the idea of being chained together comes. Each block references the last hash and so on.
How Blocks are Created:
A block needs to be verified before it’s added to the current blockchain. The transactions need to be verified and to make sure that everything checks out. The way this is usually done is through proof-of-work. People need to verify that the block is legit by solving a really hard math question, usually done with a computer. But who would want to give up their precious computer power to create a new block? The incentive is usually that the blockchain will reward the user that verifies the block with a small amount of money. This is how bitcoin and ethereum work, and people that verify these blocks are called miners. They are called miners because they are mining for this money via their computer power. Most people first hear about blockchain and the concept through the concept of mining, yet it can be misleading. I’ll talk more about mining later in the article.
The Public Ledger:
The blockchain is accessible to anyone and anyone is able to look at any certain block. This transparency is what makes blockchain so different from a normal centralized system. In a centralized system, only the company or institution has access to the ledger. By making the ledger public, it allows everyone to monitor the health of the chain and see if anyone is trying to do anything shady.
It’s important to understand that the hash is dependent on the contents of a block. The slightest change of the contents can drastically change the hash. Because of this dependency property and the fact that everyone has access to view the blockchain, it makes the system unhackable. This is because if someone were to change the contents of a block for their own favour, it would change the hash and the block in front of it wouldn’t match the same hash. This way, the blockchain can easily recognize changes.
What Data Can Blocks Hold?
The idea is that anything can be embedded into these blocks. The biggest example is the transfer of money, in which a block holds the information that shows a transfer of money between users. But even cooler applications include proofs of realty, proofs of certain items and even pharmaceuticals.
Runs by itself via protocol:
Once the blockchain has started, it runs by itself forever. It doesn’t need anyone to watch over it. If it has enough miners and transactions, it’ll continue to work. This is because it’s run by a protocol and essentially lives on everyone’s computer. Unless the internet itself dies, then the blockchain will too.
Those are the basic properties of every blockchain. But as technology evolves, new properties will emerge…
Extra (But Useful) Properties of Blockchains ✔️
If the bare minimum requirements of a blockchain can be fulfilled, then anything extra can be added on. Many big blockchain companies create cool features to get more people using their blockchain. Some notable extra properties of blockchain include:
Probably one of the most popular features of a blockchain, smart contracts allow for virtually anything to be traded among people. It’s essentially just like a real contract yet is enforced by a protocol and once created, irreversible. It outlines requirements in which the protocol will verify and facilitates trade between two parties. For example, if I want to create a smart contract that pays me for every hour of work I give to my employer, my employer and I can create a smart contract and use sensors to track my hours. For every hour I do, the protocol will automatically take X amount of dollars from his account and put it into mine. Smart contracts can do so many things which is why they are so cool.
Blockchains aren’t completely secure. Sometimes, a hacker will get your account details on a blockchain and steal all your stuff. It happens, but it’s usually the fault of the owner of the account. It’s usually only a small amount of money, but if a hacker steals millions of dollars, that would be horrible. Thankfully, there’s a way to retrieve the money. Forking the blockchain means to go back to a certain point in time to a certain block and restart everything from that block. It would essentially be like nothing ever happened. But forking can only occur when 51% (or a majority) of the users on a blockchain want to fork. This puts the power of the blockchain in the hands of the collective, making it a more democratized system.
Some blockchains with currencies are experimenting with a price stability system, which essentially means that the value of their coin is constant. Companies do this by creating a protocol that matches the amount of coins in circulation and holds it in a private bank account. Any time the coin grows in value, they can instantly add more coins and vice versa. The USD coin is based on the American dollar and is always valued at $1 USD. This makes cryptocurrencies more reliable and easy to use.
Varying Degrees of Decentralization:
Many companies are creating blockchains that have lower levels of decentralization and are more centralized. For example, they might have all the basic blockchain properties except for a public ledger, making it more of a centralized system. Sometimes, a blockchain with more centralization can be better, depending on what the blockchain is used for.
Types of Blockchain:
There are 3 types of blockchain that all have their distinct advantages and disadvantages. The 3 types of blockchains are: public, private and consortium. They all work in various ways but are more or less still decentralized.
There’s a ton more, but these are some of the most notable ones.
Applications of Blockchain 📝
The applications of blockchains are endless. It can be used for almost anything. Here are some of the applications of blockchain that come to mind and are the coolest.
I can’t write an article about blockchain without mentioning cryptocurrencies. The first-ever blockchain was based on a cryptocurrency and is the most famous blockchain of all of them, Bitcoin. A cryptocurrency is a currency that can be traded over a blockchain, peer-to-peer. It uses all the fundamentals of blockchain and theoretically is the easiest blockchain to create. There are over thousands of cryptocurrencies.
SolarCoin is an energy trading blockchain with a currency. People can trade the energy they have in return for someone else’s solar coin, based on an agreed price. It uses smart contracts to facilitate trade.
Proof of ownership is also another exciting way blockchains are being used. People can own id’s that verify a certain item. It can represent a piece of jewelry or even a deed of a house. These id’s can be traded among people and subsequently the item itself.
Companies like HotSpot and Helium are creating blockchains where people can share wifi in exchange for money. The rates are typically lower and it uses smart contracts when applicable.
Challenges of Blockchain (and the Solutions)
Even though blockchain technology can be used for some really cool applications, there are still a variety of things that inhibit blockchain from being the best alternative out there.
Blockchains are notoriously slow when it comes to facilitating trade between users. The average time it takes to transfer money on bitcoin takes around 10 minutes per transaction. This is incredibly slow considering the time it takes centralized banks to do the same thing.
The solution to this problem is creating a lighting network between users. If two users agree that they are both trustworthy, they can create a direct link between themselves and transfer without having the blockchain needing to verify. Bitcoin has started to implement something like this.
Storing all the information about transactions takes up a lot of data and space. If everyone needs to have a copy of the blockchain, then it makes it infeasible to use the protocol.
The solution is automatically deleting the oldest part of the chain after X amount of years. This way, the chain can always have a fixed length and will run indefinitely.
Since lots of blockchains are anonymous, many people use cryptocurrencies and blockchains as a way to transfer money for illegal items. The dark web exclusively uses blockchain for their transactions
The solution to this is to create blockchains that aren’t anonymous. These would be considered private chains and would lead to more transparency.
Inefficient Use of Power
When everyone is trying to solve a cryptographic hash function when mining, sometimes multiple users will try to solve the same function, leading to an inefficient use of power.
The solution to this is to create a new protocol for mining. The proof-of-stake protocol has been proposed, where people bid coins (but don’t actually lose it) to mine a certain block.
- Blockchains are a decentralized system whereas most institutions are centralized
- Blockchains are made up of blocks which contain data and are linked together
- Hash functions are used to encrypt blocks
- Blockchains can be used to transfer items between two or more parties
- There are many challenges that blockchains face, yet there are new innovative solutions that are making the technology more feasible.
A Deep Dive into Blockchain was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.
Discover Past Posts