Blockchain: The Ultimate Guide

Blockchain image

The blockchain is one of the most exciting technology ever. It provides protection and is a trustless system. Could a system like this change the internet? Yes, but first you have to know what the blockchain is and how it works in combination with cryptocurrencies.

The blockchain is a chain of blocks. A basic block contains the root hash, the hash of the previous block, the time when a block was mined, and his hash.

Wait a second? 

What is a hash, and why does a block have to be mined?

Don’t worry. I will answer all these questions in this post.

Basics

What is a hash?

A hash is a sequence of numbers and letters and the result of a cryptographic function. (Example: 27e7bb45e6e81fabc9d03da32134f18b0). It is a so-called one-way operation, which means if you calculate a hash from a plain text like ‘ABC,’ you would not be able to calculate it backward. You would have to guess what the right solution is.

Example: You calculate the hash with the hashing algorithm SHA-256 and take as input text’ password’ (By the way, it doesn’t matter which hashing algorithm is used). You would get a hash that could look like this: ab191kf2c8xya.

The length of a hash is based on the hashing algorithm. How much hashes per second a computer can calculate is called hash power or hash rate. This hash rate or hash power can vary if you use other hashing algorithms. 

What is a block?

A block from a blockchain holds data. It doesn’t matter if the data is transactions or other digital assets. In addition to that, a block contains the hash of the previous block to form a chain. That’s why it’s called a blockchain. Furthermore, a block stores his own block hash and the time when the block was mined. 

Okay, this gave you a quick overview of the blockchain, but which systems could use the blockchain? 

Cryptocurrencies primarily use the blockchain. Furthermore, the cryptocurrency space gave the blockchain technology it’s popularity. Let’s have a quick overview of the roles in the cryptocurrency economy.

User vs Miner vs Nodes

In the original concept, users, miners, and nodes were united.

Because of the complex requirements, a miner has to have nowadays, miners and nodes got separated. 

A full node is a system/computer that contains the whole blockchain. It is connected to other nodes and synchronizes the blockchain if needed. Some nodes don’t share the blockchain with others and only sync their blockchain. 

Miner mine for new blocks. So, they try to add a new block to the blockchain and earn a reward for it. This process takes a lot of computing power and consumes a lot of energy. In terms of crypto, computing power is called hash rate or hash power.

Why is it called hash rate or hash power?

Because miners always calculate a new hash and try to solve a complicated mathematical problem. If they are right, they find a new block and earn the rewards for finding a new block.

So, the crypto space tried to simplify things and called this process mining. 

There are also light wallets, which manage transactions but are connected to a node, which is a centralized server. 

If you download an app to your phone where you can interact with a cryptocurrency blockchain, it’s probably a light wallet. Phones usually can’t store the whole blockchain because they don’t have enough capacity. However, without the entire blockchain downloaded, nobody can receive or send funds.

So, to solve this, phones connect to a centralized server, which has the whole blockchain downloaded. However, if this server is on maintenance or not available, these phones would not be able to receive or send funds.

Trust is good, control is better

Nowadays, everybody wants to be as secure as possible. The blockchain itself is a trustless system and a safe system. The blockchain is a trustless system because many nodes and miners validate the accuracy of the blockchain in the network.

If you would try to manipulate the blockchain and publish a blockchain which contains invalid transactions, the entire network would dump your request of replacing their Blockchains with yours, because the majority says it’s manipulated and don’t trust you.

Blockchain transactions

In a blockchain system, transactions are also chained together. Usually, wallets only show that you received or send funds independently. In reality, every transaction is chained together. So, each transaction has an input and could have multiple outputs.

What do I mean by that?

For example, a person receives one Bitcoin. This transaction is an input. Later on, this person makes two transactions with each 0.2 BTC. These transactions are outputs. They depend on the input transaction and are chained together. 

Furthermore, every transaction has a transaction identifier (txid). 

Each output can only be spent once. Because of that, outputs can be categorized as either Unspent transaction outputs (UTXOs) or spent transaction outputs. 

If the value of a transaction’s output is higher than the input, the transaction would be invalid.

Genesis block

The genesis block is the first block from a blockchain. It is a special block because a genesis block doesn’t refer to a previous block. It is also marked as block 0 or block 1. 

Proof of Work

The Proof of Work protocol is a consensus algorithm. It is used by many cryptocurrencies, for example, Bitcoin, to generate new blocks. To add a block to the blockchain, miners have to solve a proof of work puzzle based on difficulty.

The difficulty adjusts to limit the rate when a block can be mined. In Bitcoin’s case, a block is mined on average every 10 minutes.

The Proof of Work protocol is used to prove that a miner has done work to mine a new block.

Forks

Commonly, miners produce a block with the same block height a nearly the same time. This process creates a fork in the blockchain because there are suddenly two different blocks with the same block height. When miners produce at the same time blocks for the blockchain, each node chooses which block to accept. Usually, nodes take the block they first see.

Assuming one miner mines another block and adds it to a forked blockchain. This process makes this blockchain stronger because it contains more valid blocks. Nodes usually follow the longest chain because there is more work but into the chain and destroy the shorter forks.

Blocks that are correct but not added current/longest blockchain are called orphans or orphan blocks. True orphan blocks are valid blocks from a blockchain without a known parent block. 

Hard fork

A hard fork requires a new version of the protocol. For example, Bitcoin Cash is a hard fork from Bitcoin. Both chains are valid. Furthermore, both coins have their miners and are independent.

However, Bitcoin itself could do a hard fork. For example, some new features could require a hard fork. It is a change that occurs with a protocol update, and previously valid blocks are made invalid or invalid blocks are made accurate. If a hard fork occurs, all nodes have to update to the newest software/protocol version.

Soft fork

A soft fork is a software update where previously valid blocks are made invalid. However, old nodes will recognize new blocks as accurate, so the update is backward-compatible. This kind of fork requires only a majority of miners to update to the more original version, whereby the hard fork, all nodes have to upgrade to the latest version.

Attacking the blockchain

There is only one major issue of mining: a 51% attack. A 51% attack could occur when one big miner owns 51% of the hash rate from the network.

Let’s simulate this attack. Here is an image to help you to understand it a little bit better:

51 percent attack

You would need more than 51% of the hash power the whole network has. In Bitcoin’s case, you would need more than 45.000.000 THs (1THs = Tera hash), which is equal to 2.300.000.000 USD (Calculations were made on the 14.09.2019 and based on Bitmain’s Antimer S17).

It’s expensive to perform a 51% attack on the Bitcoin network, but there are a lot of altcoins (alternative coins, basically copies from Bitcoin with their features) out there that don’t have this much hash power. A 51% attack on small networks would be possible and much cheaper.

Why form the Blockchain nodes a distributed network?

You can read more about the types of networks here: All network types, but here is a short explanation of what a distributed network is. In a distributed network, everybody can have a copy of the blockchain. Everybody can confirm and manage transactions within the network and see who transferred coins to somebody else. That’s the reason why the blockchain is also called a public ledger.

Advanced techniques/ Use cases

Let’s take this a little bit further. If we think about the blockchain, we always think of Bitcoin, Altcoins, or digital money, but the Blockchain concept itself is not bound to funds or transactions. You can literally store everything on the blockchain you want to. You can store digital assets on it like domains. Namecoin, for example, manages all .bit domains, and you can register your domain if you want to. It stores all domains on its blockchain.

Furthermore, you could save ownership of properties on the blockchain or ownership of your car on it. There are just endless ways you could use the blockchain and benefit from it, but we have to find out where we want the blockchain to be used and where it is useful and doesn’t hinder us.

Identification

An excellent use case for the blockchain could be identifying yourself on the internet. For example, plenty of companies implemented the button “Login with …” nowadays to log in with Facebook, Google, Instagram, Twitter, etc. This solved the big problem that you don’t need a new account every time you use a new service or website.

In the future, there could be a button “Login with Bitcoin,” where you would be able to login with your Bitcoin identity. This would be not only more secure than the concept we have today, but in addition to that also anonymous.

Dapps (Decentralized apps)

We could also benefit from Dapps, which could be websites or software on the top of the blockchain. No centralized owner could limit your account by locking it or censor specific content on it because nobody owns the blockchain.

In addition to that, this app wouldn’t be able to get destroyed or manipulated. Apps like this would be Cryptokitties, which is a market place where you can buy, sell, or breed virtual cats. It currently runs on the Ethereum blockchain.

Voting

The democratic concept of voting could be implemented in the blockchain. Furthermore, this would be anonymous, and building statistics of the last votings would be much more comfortable. In addition to that, this system would be trustworthy, and you could be 100% sure that the results are correct and right.

The managing of a concept like this would be a lot easier than it is nowadays too.

Smart contracts

A smart contract is just a program code, which is executed on a specific event. For instance, if you sell your ownership of your house to another person, a smart contract then could be performed on the blockchain and automatically transfer the ownership to another person.

In addition to that, if you rent a house, a smart contract could be executed every month, which automatically performs a transaction to the landlord.

DAO – Decentralized autonomous organization

A DAO is an organization that doesn’t require a centralized authority. An excellent example of a DAO is Dash. With Masternodes that costs 1000 Dash coins, you could participate in this DAO and vote for ideas or proposals within the network.

Furthermore, Dash has its own DAO Budget, where every Masternode member could propose a plan and get sponsored by the network. The other Masternodes then vote if you get the budget or not.

Blockchain stocks

The blockchain technology is not only used in the cryptocurrency space. The blockchain could be used in a wide range of sectors, from identifying people, voting, fraud prevention to data integration. 

List for blockchain stocks: barchart.com.

Is a blockchain system suitable for every network/system?

No, a blockchain system is not suitable for every system.

Let’s take for example a simple blog.

Now, let’s compare the blockchain system with a blog system. First, one piece of content (article, blog, …) would be stored in one block. However, this system has significant disadvantages.

First, data in a blog is immutable and permanent. In other words, if a user publishes a new piece of content, he would not be able to edit it afterward. This is obviously a huge disadvantage because the user would not be able to correct spelling mistakes or replace old content.

Compared to a traditional database system, updating content is no problem. It’s a basic functionality of every database system.

In addition to that, a user would also not be able to remove a piece of content after publishing.

I should mention that there is a way to reset the blocks (remove content from the blockchain). The method is called a rollback. However, by performing this action, all the following blocks would be removed/destroyed too.

Let me explain this with an example. Let’s say you want to remove block 5 from a blockchain and the blockchain is 10 blocks long. Not only block 5 would be removed. Block 6,7 up to 10 would also be removed because they are connected with each other.

I hope it is clear now that a blockchain system is not suitable for a content platform like a blog or social media platform.

However, there are use cases (mentioned above) where the blockchain is extremely useful and could improve our daily life.

Has the blockchain a limit?

No, theoretically, blockchains could grow unlimited. However, not everybody would be able to store the blockchain. Every computer has a resource limit. If that limit is reached, it could be upgraded, or it would not be able to participate in the crypto network.

However, developers are always developing new techniques and methods to cut the blockchain size or at least improve the performance.

For instance, if transactions are handled off-chain, meaning they are not put on the blockchain. The Bitcoin network, for example, has a technology called Lightning network.

The Lightning Network gives a user the opportunity to open channels on the Lightning network to transfer money (nearly) instant, with low fees off-chain.

This gives not only the user a better user experience, but it also unburdens the network.

Blockchain hype

The blockchain is an overhyped technology. Companies think it’s the next big thing to make big money and they promote the blockchain technology like it could solve every problem.

However, I hope it is clear, that the blockchain concept has huge advantages for a customer, but is not suitable for every system.

Building hype around technology and releasing products or services could increase sales rates. In my opinion, that’s the main point why companies hype the blockchain. Either they want to produce a product or service based on the blockchain or they don’t know how the technology works.

The history of the blockchain

The blockchain concept is new. However, it has an interesting history.

2008:

  • Satoshi Nakamoto published the whitepaper for Bitcoin.

2009:

  • Bitcoin got released

2010

  • First purchase with Bitcoins: Laszlo Hanycez buys two pizzas with 10.000 BTC’s.

2011

  • 1$ = 1 Bitcoin

2012

  • Bitcoin Magazine launched by Vitalik Buterin
  • The blockchain technology gets mentioned in popular television shows like The Good Wife

2013

  • The market cap of Bitcoin surpasses 1 billion
  • The price of Bitcoin reached 100$ for the first time

2014:

  • Vitalik Buterin crowdfunded his own project (Ethereum) via an ICO and got 18 million dollar worth in BTC

2015:

  • More than 100.000 merchants accept Bitcoin payments now

2016:

  • IBM announces a cloud-based business solution for the blockchain
  • Japan recognizes the legitimacy of cryptocurrencies and the blockchain concept

2017:

  • The price of Bitcoin was 1.000$ for the first time
  • The crypto market cap surpassed 150 billion
  • Dubai announced its government will be blockchain-powered

2018:

  • Facebook wanted to create its own cryptocurrency, Libra
  • IBM develops a blockchain-based banking platform

Maximilian Groß

I'm a software engineer. I'm the owner of FireStake.com and know the crypto space since 2016. Furthermore, I share everything I learn about crypto on this blog.

Recent Posts