Blockchain

Understand the Blockchain, Ethereum and Bitcoin in 20 Minutes

Understand the Blockchain, Ethereum and Bitcoin in 20 minutes

Bitcoin is known by everyone now, but do you understand how it works?

With Bitcoin, it is very possible to create digital-only nations, cryptocurrencies that are based on the universal basic income model, as well as performing international transactions without a 3rd party…but how does it really work behind the scenes?
All of that may sound out of your grasp but that’s what this article is for.

In this post, we’re going to cover:

  1. The history of Bitcoin and blockchain
  2. Why should you care about the blockchain?
  3. Cryptography in cryptocurrencies and the blockchain
  4. Cryptocurrency hashing
  5. Understanding the Bitcoin blockchain
  6. Understanding Ethereum
Understand the blockchain and Bitcoin in 20 minutes Click To Tweet
The history of Bitcoin and blockchain

The first question to ask yourself is this; why was Bitcoin invented?
To answer that, we have to go almost a decade back to understand the purpose behind Bitcoin’s (and the blockchain technology) invention.
In 2007, the global economy faced a crisis in line with the bursting of the US house and property bubble. This event brought down the value of securities linked to the U.S. real estate significantly to critical levels.
One of the biggest contributors to this failure was easy access to subprime loans (loans given to individuals with poor credit scores or have difficulties repaying the loans) as well as the overvaluation of subprime mortgages.

All of these loans and financing options were given out like candy back then as there was a consensus that believed on the theory that housing prices in the US would continue to rise like a bull market.
Unfortunately, that was not meant to be. The economy crashed almost overnight and official findings by the Financial Crisis Inquiry Commission determined the entire financial crisis was caused by failures in financial planning as well as too much lending in the market.

The crisis was avoidable but greed and a lack of foresight from third parties ultimately burst the bubble of the US housing boom. The world believed that third parties such as banks and financial institutions had enough integrity and responsibility to handle the finances of billions.

As the financial crisis has proven, trusted third parties are not invulnerable. The crisis resulted in evictions across the country, foreclosures as well as bailouts by the government; the event is considered as the worst financial event since the Great Depression.

In response to this, Satoshi Nakamoto (a person or entity whose identity is unknown as of today) introduced a whitepaper called, “Bitcoin: A Peer-to-Peer Electronic Cash System.” The whitepaper believed that banks and institutions should not be completely relied on to process transactions.

Instead, he proposed Bitcoin, an electronic payment system based entirely on mathematical proof and cryptography techniques. The idea was simple; Satoshi wanted to produce a currency that is: independent of any central authority, transferable electronically, more or less instantly, with very low transaction fees.

This laid the foundation to the blockchain technology which is going to impact how data is transmitted in the future. In the next section, we’re going to explain the blockchain in-depth.

Why should you care about the blockchain?

Understanding the blockchain technology is necessary if you want to understand what can be achieved with it
Understanding the blockchain technology is necessary if you want to understand what can be achieved with it, why it works, how to actually use it as well as knowing how it can affect future technologies in a positive way.
If you are skeptical about the idea of cryptocurrencies, this section will help you to understand why that is a view that has to change moving on.
This introduction will bring you through a number of concise but easy to follow introductory lessons that explain the fundamental principles and concepts that are required to understand blockchain technologies, of which Bitcoin is the most known and widespread application.

Cryptography in cryptocurrencies and the blockchain

cryptography is the science of encrypting (or codifying) messages so that only the sender and receiver can read the message
Bitcoin, the blockchain, and every other cryptocurrency are the result of three things:

  1. Cryptographic techniques
  2. Security protocols
  3. Trustless transactions

In a nutshell, cryptography is the science of encrypting (or codifying) messages so that only the sender and receiver can read the message. Even if the message is to be intercepted, it is written in such a way that only the sender and receiver can understand it.

At its core, cryptography has to solve a number of problems to make sending messages secure. One of the things that cryptography solves constantly is ensuring that a message will not be modified along the way.
It must also ensure that the sender’s identity is verified e.g the sender of the message must be the one who is actually sending the message, not anyone else.
These problems are the core ideas of the blockchain technology and what it is trying to achieve in the future.

Ever since the World War, symmetric (or private key) cryptographic techniques have been used to encrypt messages between two parties. The Enigma machine was a famous example of transferring messages cryptically for war purposes.
Let’s clarify this point with an example.

Alice and Bob want to communicate with each other about a private matter. To keep it confidential, they need to find a way to encrypt and decrypt messages so that no one else but them can understand the messages.
They can, for example, change every letter of the alphabet to numbers to encrypt their messages. They can also decide to use random, nonsensical words to replace normal words in their messages.

Another way to encrypt and decrypt messages is by using asymmetric or private key encryption (PKE). This is the most important part of the blockchain technology.
How PKE works is very easy to understand. In PKE, you have two keys: a public key and a private key. Data that is encrypted by one can only be decrypted by the other.
The easiest way to understand this concept is by using an analogy. Think of:

  • Public keys as a normal lock
  • Private keys as the keys to the lock
  • The message or data that is being sent or received as boxes

For example, when you want to send a message securely, you encrypt it which is the same as locking a box with a normal lock. Everyone can see this box but they cannot modify or access the box because they do not the keys to the lock (your private key).
Public keys are actually the “send to” addresses in Bitcoin, so when you send someone money, you’re really sending it to their public key.

The encryption process can work in either direction which depends on your needs. There are two purposes for encryption: authentication and confidentiality.

Authentication

Authentication is the act of ensuring a message is really sent from the sender.
Authentication is the act of ensuring a message is really sent from the sender. If Alice wants to send a message, she will use authentication to let everyone know the message is really sent by her and not by anyone else.
In other words, think of authentication as a unique digital signature to let everyone know that the message is really sent by you.

Alice does this by encrypting her message with her private key, making ciphertext (encrypted text). Anyone who gets a copy can attempt to decrypt the message it with her public key, which is known to everyone.
If you get confused, the boxes and key analogy may help you. To authenticate the message, Alice is giving everyone a copy of her private key to unlock box in order to read the message.

If the message is able to be decrypted back into plain text, then you can be assured that the message is really sent from Alice.
WikiLeaks founder, Julian Assange, uses this technique to ensure his readers that all of the content on the website is released by him.

Confidentiality

In the blockchain; money sent by someone can only be accepted by the person who is supposed to receive it.
If Bob wants to send a secret message to Alice, he will encrypt the message with Alice’s public key and send it to her. With the box analogy, Bob locks his message in a box with Alice’s lock.
Only Alice is able to open her own lock as she is the only one who has the keys to the lock. This is exactly the same as using her private key to decrypt the message.

If the message is able to be decrypted in plain text, Alice can read it and can be assured the message was intended for her to see. If the message cannot be decrypted, this means the message is not for her. This is the same as not being able to unlock a lock because you don’t have the right keys for it.
This ensures that only the person who the sender intends to send the message to is able to read the message. The same thing applies to transactions in the blockchain; money sent by someone can only be accepted by the person who is supposed to receive it.

Authentication AND confidentiality

Authentication in Blockchain
When you need both authentication and confidentiality, it get’s a little complicated so you might have to focus a bit more on this section.

Consider this situation.
Alice want to send a message to Bob. However, Alice wants to ensure that Bob is the only person who can read and understand the message. At the same time, Bob also wants to make sure that Alice is the one who sends the message.
For this to happen, Alice has to encrypt or lock the message twice, once with her private key and one more time with Bob’s public key. When Bob gets the message, he has to decrypt it twice, once with his private key and once with Alice’s public key.
Why does Alice have to encrypt it twice and why does she have to do it once with Bob’s public key?

It’s helpful to not think of locks too strictly as if its real life. In the blockchain world, anyone can lock their data with someone else’s lock. This means Alice and everyone else has the ability to lock or encrypt their messages with Bob’s public key.
However, nobody can unlock or decrypt the message except Bob as he is the only one who has access to his private key. Everyone can use Bob’s lock to lock their messages but Bob is the only one who has the keys to unlock the locks.
Remember the part about authentication that we talked about earlier?

Alice uses her private key to encrypt the message to put her own unique stamp on it. This way, Bob can use Alice’s public key to verify that Alice is the one who sent the message, not anybody else.
By encrypting the message with her private key, Alice guarantees that the content of the message is what she actually wrote. By doing this, the message that is sent to Bob cannot be modified along the way even if it is intercepted by someone.
If the message is able to be decrypted, Bob can be assured that Alice is the one who sent it because her public key decrypted it and it was intended only for him because his private key is also able to decrypt the message.

Hashing

A hash is a short description of compression of a piece of data.
Another important concept in the blockchain world is hashing. A hash is a short description of compression of a piece of data.
A hash is created using a mathematical function and algorithm (also known as a hash function) that delivers an output based on the input.

It is also a one-way function; we can’t go backwards with it because we’re actually destroying or losing data in the process of creating the hash.
You’re taking a large number, doing some fancy math, and producing a smaller number. It’s impossible to go backwards, because that smaller number can correlate to several (many) larger ones, and it’s impossible to know which.
A very basic example of a hashing algorithm with a one-way function is this.

You have a hashing algorithm that counts the number of vowels in a word or phrase.
In the input, you type in the word blockchain. The output (result) of the hashing algorithm gives you 3, the number of vowels in the word blockchain.
Every time you run the algorithm on the word blockchain, you get the same output no matter what as there will always be 3 vowels in the word.

However, you cannot take the output “3” to get the word blockchain. For example, the words freedom, special, and piano all have 3 vowels in them but they are very different words.
This happens because you are taking a large data (the words) and compressing it into a smaller output which are numbers in this case. That same number can be related to many more data points which are not exclusive to the input.

How does hashing relate to cryptography and the blockchain?
When you store important data, like passwords, it’s not wise to store them in plain text. If someone hacks into your database, sensitive data stored in plain text is a recipe for disaster.
To avoid that, you use a hashing algorithm. The algorithm changes the password into random, gibberish phrases. You only store the gibberish, and when someone tries to login, you apply the hashing algorithm again to the input. If the hashes match, the user is able to login without you ever knowing his or her real password.

When your database is now compromised, they won’t have access to the real passwords. However, a hashing algorithm is not invulnerable. If you have a weak algorithm, hackers can easily reverse engineer their way to cracking the passwords.
Another case may happen when multiple people use the same password; the hashes will then look the same. This is the #1 reason why cryptocurrencies use extremely secure encryption protocols to verify transactions in the blockchain.

Understanding the Bitcoin blockchain

The blockchain is basically a public, digital ledger (or account book) where transactions are recorded
The blockchain is basically a public, digital ledger (or account book) where transactions are recorded. This record verifies transactions by verifying blocks of data in the digital ledger.
Before Bitcoin, we needed a trusted third-party to keep a ledger of our transactions with real money. For example, you’d trust VISA or MasterCard to authorise your credit card transactions and your bank to debit or credit your account correctly.
If Alice sends Bob $100, the bank would debit Alice’s account and credit Bob’s account. They would then update their ledger and we would have to trust the bank to verify our accounts correctly as well as their integrity in handling our hard-earned money.

With Bitcoins, everyone in the network has a copy of the ledger as it is public and not owned by anyone. Therefore, there is no need for middle or intermediaries to verify transactions on the blockchain.
One of the properties of the blockchain is it is immutable. This means once a transaction is confirmed on the blockchain, it cannot be removed, modified, changed, or reversed.

Why is it called the blockchain?

The basic unit of the blockchain is a block of transaction data
The basic unit of the blockchain is a block of transaction data. This data does not appear on its own, instead, each successive block that is added to the blockchain includes information of the previous block.
Each block has a reference to the previous block, and this is what places one block after another in time which leads to the term blockchain. Since data cannot be changed, you can track transactions all the way to the very first group of transactions ever made in a blockchain network.

Think of the blockchain as pages on an accountant’s book. Each new page must include information from the previous pages to properly calculate the balances in an account book.
Hence, you cannot fake information unless you’ve changed data from previous pages in the accountant’s book.

The same principle applies to the blockchain; each upcoming block will be stacked on top of the previous block and it MUST contain references to the data of previous blocks.
On average, it takes about 10 minutes for a new block to be added to the blockchain. It might be quicker in some other cryptocurrencies but 10 minutes is the average rate in the Bitcoin blockchain.

How does the blockchain verify transactions and what do miners do?

Unlike normal transactions, you don’t literally send your money in an envelope, hand it to the bank (or a central authority) who then sends it over to your recipient.
Unlike normal transactions, you don’t literally send your money in an envelope, hand it to the bank (or a central authority) who then sends it over to your recipient.

Instead, each transaction on the blockchain is verified by solving mathematical puzzles with the help computers. People (or computers) who solve these puzzles and therefore verify transactions on the blockchain are called miners.
Like normal workers, miners receive incentives for verifying transactions as well as keeping the network safe and efficient. This incentive comes in the form of cryptocurrencies.

For instance, if a miner verifies transactions in the Bitcoin blockchain, it will receive bitcoins as a reward. For the Ethereum blockchain, the miner will receive Ether as a reward.
If a transaction is valid and the puzzle is able to be solved by the miner, the transaction will go through and be confirmed on the blockchain.
This is why cryptocurrencies and the blockchain are regarded as decentralised platforms that do not involve trusting a third-party with your funds or data.

When you receive information from strangers in the Bitcoin network, you can check for yourself that the block solutions are correct and are confirmed on the blockchain on websites like Blockchain.info.
Because the math problems involved in confirming a block on the blockchain are so hard, it is impossible for an attacker to fake a block or to verify fraudulent transactions on the blockchain.

Earlier on, we mentioned that a new block is added roughly every 10 minutes in a blockchain. However, you have to understand that it only takes 10 minutes when the network works together to solve the mathematical puzzle of a block.
If you were to use your laptop or computer to solve a block’s puzzle, it may take years for you to solve it even if you have an extremely high end setup.

Therefore, it is extremely unlikely for a hacker to attack the network as the hacker is not only facing the computing power of a single user, but rather the entire network.

Confirmations

By design, each block in the Bitcoin blockchain takes about 10 minutes to be verified.
By design, each block in the Bitcoin blockchain takes about 10 minutes to be verified. Usually, when you perform a transaction that involves Bitcoins, you might see a phrase that goes something like “6 confirmations needed”.

As you may have imagined, 6 confirmations is the number of times that a block has to be confirmed which works out to around 60 minutes or an hour for your transaction to go through.

Why 10 minutes per block?

The choice of 10 minutes was an arbitrary choice but the reasoning behind it is simple; short confirmation times could lead to stability while long confirmation times is too inefficient to work as a currency.
As more computers and miners join the network, the speed at which each block is added gets faster and faster each second.

To compensate for this improvement in speed, Bitcoin recalibrates the confirmation time by changing the difficulty of the math problems to ensure it’d take 10 minutes to solve it.
This number is not uniform with every cryptocurrency. Litecoin, for example, has an average confirmation time of 2-3 minutes. Ethereum can process transactions as quickly as 17 seconds; this does not mean that these coins are better than Bitcoin but instead it is just a matter of software design.

About Ethereum

What is Ethereum anyway?

Let’s put it this way – Ethereum is exactly a platform like the Internet.
However, the Internet has one major weakness that Ethereum does not have.

What’s the problem?
The problem is this; everyone has a Facebook, binge watches YouTube, and checks Gmail almost daily. What happens if one of those website goes down because of a hack or a bug?
You cannot use it at all!

You cannot get on Facebook and connect with your friends, get back to those urgent e-mails, or watch your favourite videos until the website is fixed. When something goes wrong or shuts down, the whole thing shuts down – that is the underlying problem with centralised systems like the Internet.

Ethereum, Bitcoin, and cryptocurrencies that work based off the blockchain work like a network of computers. Instead of a single computer or network, the blockchain network is made up of computers from every single user of the blockchain.
If 10,000 people own Bitcoin, this means 10,000 users host the Bitcoin network – a stark contrast to the centralised standard of today’s websites and businesses.

Imagine Facebook running this way; when the main Facebook computer has a problem, many other computer on the networks are still working which means you can continue using Facebook.

The only way to shut down a blockchain network and cause a system failure is by literally shutting down every computer in the system. If there’s a million computers in a blockchain network, you have to take down 1 million computers to destroy it.
This system is reliable as a single point of failure is not going to disrupt the system. At the same time, since there are so many computers to take down, a hack or attack on the system is going to be very expensive on the attacker’s side.
You would probably be asking yourself, how can everyone’s computer run a website like Facebook or Google?

The answer to that is Ethereum is NOT a replacement to the current Internet infrastructure. Instead, it acts as a complement and arguably an upgrade to today’s Internet protocols.
Of course, there are some things that work better in a centralised system while others may be better off with a decentralised network.

Until Ethereum, the option to run a website in a decentralised way simply did not exist. With it, we now have smart contracts, the ability to track every single transaction in a network, and other improvements to outdated practices of the World Wide Web.

What’s the difference between Bitcoin and Ethereum then?

The easiest way to separate the two is by understanding the difference in their use cases.

Bitcoin is a form of digital money and it primarily acts as a store of value, like gold. Bitcoin has been around for nearly 10 years and is used to transfer money from one person to another like real money.
Again, it is only used as a store of value and as a way to perform transactions; Bitcoin is also critical to the public in understanding the concept of a decentralised digital currency like Ethereum and many more.

Ethereum is different in one core aspect.

Instead of only being a store of value, Ethereum can also transfer data the same way Bitcoin transfers money. This means the same blockchain technology used to verify, store, and confirm transactions can also be applied to the transmission of information.
Unlike Bitcoin, Ethereum is also programmable and able to be written in code which means anyone who is adept at programming can create their own blockchain applications like a decentralised housing market, a peer-to-peer cloud storage platform, or even a Bitcoin clone!

The potential for Ethereum’s future is limitless.

Many of today’s popular websites can be built on a decentralised system for greater efficiency; for instance, imagine an AirBnB-like marketplace that is built on a blockchain network that does not need a third (or multiple) parties to rent and book a house.
This opens up trustless communication where transactions, transfer of data, and significant decisions can be done without the need of a middleman or intermediary to work. This leads to lower costs and lower risks of scams in these kind of markets where trust is crucial.

Decentralisation is also important because it eliminates single points of failure in the case of an attack. This makes internal breakdowns and external attacks impractical as attackers would have to spend a lot of resources to take down multiple computers at once in the blockchain.

What are some uses cases of Ethereum?

The blockchain

With most websites, information is stored on a server. The server is, in a nutshell, just a computer with a database in it that has all of the site’s information from logins to transactions to user information.
If that database and its backups are damaged, the data is gone – forever.

With the blockchain, it is nearly impossible to take down as data is stored in every single computer on the network. Think of it as a database distributed among a large number of people’s computers instead of being stored in one big computer.
Since the blockchain is public, information stored in the database is accessible to the public and the data in the database cannot be removed, edited, or reversed due to the blockchain’s immutable properties.

Smart contracts

Another thing that makes Ethereum special instead of just using the blockchain as a digital ledger (like most cryptocurrencies) is the existence of smart contracts.
Smart contracts work exactly how they sound; it is a digital contract that automatically executes terms in it when certain conditions are met. This means you don’t need an intermediary or institution to enforce the terms of a contract.
Smart contracts are written in code which makes it very easy to modify and execute for basically any situation that needs a legally binding contract to function.

An example of a situation where smart contracts can be applied is for an employee’s pay. In the smart contract, you specify which employee will be paid at the end of the month as well as bonuses to be paid when out when certain KPIS are met.
At the end of the month, the employee’s salary will be automatically paid without the need of the HR department or manager to do it. The smart contract will execute its terms (that is written in code) by paying the employee’s salary and determining if the KPIs are met or not for the bonus.

It is called smart contracts because it is actually code that represents an agreement like a contract. Unlike traditional contracts, the terms in a smart contract are enforced and executed in a smart way.
Here’s another example of a smart contract in action.

Imagine sending money from one account to another but only when a certain set of conditions are met. For example, let’s assume that you want to buy a house in Canada.
Traditionally, there are multiple third parties such as agents and lawyers who are involved in the trade. Funds are also usually put in escrow which makes the purchase of a home even more expensive when these fees add up.

With smart contracts, a piece of code could, in practice, automatically transfer the ownership of a house to the buyer as well as releasing the funds to the seller after a deal is agreed upon.
All of this happens without the need of an agent or a lawyer to make sure everything is paid for, it is done by code and enforced automatically depending on the conditions that were set in the contract.