Blockchain In a Nutshell

Blockchain might be the technology that redefines the way distributed databases work. News talking about it hit the headlines every day, and there are a lot of articles and videos explaining better or worse how it works. The reasons why I think this article may be interesting for you are the following:

  1. Most articles explain Blockchain only related to cryptocurrencies like Bitcoin without giving a clear idea of how it works (what is the consensus protocol, how are the blocks validated, how to get bitcoins, …). We’ll answer these questions here.
  2. Most articles don’t talk about the other types of blockchains that are currently populating the internet and coming up in many conversations between CEOs. These are the private/federated ones. Below you will find answers to what these are, and how they are different from public blockchain networks (like Bitcoin or Ethereum).

When was Blockchain Born?

Let’s start from the beginning. Since the Internet was created, there have been many attempts to create a secure online payment method. These gave birth to the idea of a virtual currency. The key for its success was offered to the world by S. Habber y W.S. Stornetta in 1991. This “key” is nothing less than the blockchain, a clever and quite simple idea that makes it possible for untrusted (and even anonymous!) people to agree on sharing and storing information (like monetary transactions).

The original purpose for blockchain technology was to provide a digital signature that allowed having an orderly register of digital documents. It was not until 2008 when someone under the pseudonymous “Sathosi Nakamoto” released the cryptocurrency called Bitcoin using this technology. Bitcoin is a network where anonymous people transact a virtual currency called bitcoin, which is minted out of thin air (we will get here). From 2008 to this date the cost of a Bitcoin raised from cents to more than $8000.


What is Blockchain?

Let’s define first what is the original blockchain’s architecture. Blockchains have since evolved into other structures which we will talk about later, identifying different types and their respective characteristics.

Blockchain is a distributed peer-to-peer database in which all the participants (called nodes) are at the same hierarchical level and because of the existence of a consensus protocol, don’t need to trust each other . Moreover, every participant has a copy of the whole ledger of the blockchain.

Distributed: Means that the information is not stored in a privileged central server but in all the individual servers or computers of each participant running a node. This fact, together with the use of hash functions that we will explain in a moment, makes this technology super secure.

Peer-to-peer: Means that the information is shared between the participants inpairs. Every participant running a node is connected to other nodes (let’s call them “node-friends”) and all the information about own or alien transactions is shared between them in pairs. Then, they replicate and iterate this action with their connections.

Consensus protocol: This concept is, from my perspective, the most revolutionary idea of this technology. We will go deeper in a moment, but let’s say for now that it is the method by which only correct blocks are added to the blockchain and, in case someone introduces a wrong one, it can be refused by the honest participants.

Ledger: Every participant has a copy of the updated transactions history. This makes it possible to check if a person attempting to perform a transaction has the money to do it, so the double spending problem is solved.

Anonymous: People access the system with a private key (a password) and a public key or wallet (the alphanumeric code that the other participants see). In this sense it is anonymous. However, as a node you are also offering your IP to your node-friends, so it is not completely impossible to be identified. There are some intrinsic and extrinsic ways to avoid it that we won’t mention here.


How does Blockchain Work and How is Everything Validated?

Step 1: When a node wants to perform a transaction (send money, deploy a smart contract, …) it sends this information to its node-friends. Each node checks some basic things first (for instance if the money has not been spent before).

Step 2: If everything is right, they save the information about the transaction in their POOL (a sort of personal register) and resend it to their friend-nodes. Every node has a different POOL because they hear about the transactions in a different order.

Step 3: In every round (in Bitcoin it is 10 minutes in average) a node is RANDOMLY chosen to propose a block with the transactions of its POOL. This is the key process called consensus protocol. Instead of being 100% random, different nodes have different chances of winning. Why and how will be explained in the next section.

Step 4: The new block is proposed and signed by a chosen person. Basically this means that he sends to its node-friends a new version of the blockchain with all the blocks of the previous one and one more filled with the transactions of his POOL. The node-friends receive and replicate it.

Step 5: The nodes update the blockchain if they consider this appended block as valid.


Hash Functions and Hash numbers

All the blocks are provided with an alphanumeric code/number called hash. To get a hash, you have to concatenate all the information of the block (the number, the transactions inside, the signature of the endorser, …) with another code called nonce. The hash is the result of applying a hash function (a function with specific mathematical properties, useful for the security of the chain) to this concatenation. Not any hash is valid, but it must begin with a determined number of zeros (depending on the blockchain). The strategy to find a valid hash is trying with different nonces until you find a valid hash. One of the properties of the hash functions is that there is no better strategy than trying random nonces.

Schema illustrating hash functions and hash numbers.

This method makes tampering almost impossible. Let’s see why. If you modify something in a block already validated (so with a valid hash), it is obvious that the hash will be no longer valid. The point is that, because you are taking the hash of the previous block as one of the pieces to get the hash of the current block, if you modify something in a block not only that block will become invalid so will the following blocks will too! If anyone wants to modify something in a block, they will have to re-mine that block and all of the following ones in EVERY copy of the blockchain maintained by each node.

Changing anything in a block will not only make that block invalid, but all the following ones too.

Consensus Protocol

The consensus protocol is the method by which a node is selected to propose a new block. The idea is for the trusted nodes to have more chances to win the toss. Let’s explain the two most commonly used:

Proof-of-Work (PoW): This is the most used protocol. It is the protocol used by Bitcon and Ethereum. Here, every time a node proposes a block it is released without a hash. It begins a competition between all the nodes to find this hash (actually not all of them try to do it, and those who do try are called miners), because the one who finds it is the winner of the raffle and has the right to propose the new block. The miners have to use a lot of computational (and expensive) power to find the hash, and the one who does is rewarded, only if the block you propose after that is accepted by the community (the reward is 12.5 Bitcoins at present in the Bitcoin network and is halved every 4 years).

Why does it act on behalf of the blockchain? Because if you happened to propose a wrong block, your time, energy and money would be wasted, the block would be refused and you woudn’t be rewarded anything. There’s no reason for people trying to propose malicious blocks with wrong transactions.

Because of the high reward, a lot of people all over the world (now they are actually organized in clusters) are competing to mine (validate) blocks.. The difficulty of mining is tuned in order to have in average one block mined after X time (in Bitcoin 10 minutes). So, the more people competing, the more difficult to mine and the more secure the hashes and the blockchain will be.

Proof-of-Stake (PoS): With the PoS the lottery tickets are given away to all the nodes, but the more money you have the more tickets you get.


Types of Blockchain

So far we have understood how the public cryptocurrencies work and why are they so interesting. Now it’s time to review some of the different types of blockchain and their variations.

Some of the current types of blockchains.

The schema above depicts a brief description of the features and examples of the four types of blockchains.

Public blockchains: Anyone can download the application, join and run its own node (this means being a participant with the same rights as everyone else). They are open and entirely transparent. All the transactions are generally deployed within the same network. The most known examples are Bitcoin and Ethereum. Like them, all the public blockchains are generally crypto-based (at present there are more than 700 cryptocurrencies!).

Private blockchains: If you want to have a blockchain for business purposes, this is your category. There are many options of open source code for developers (Hyperledger, Corda, EFW, Multichain, the private framework of Ethereum, ..) that you can download and run in your computer. Nowadays they are being updated almost daily and bugs are frequent. Does it mean you should stay away from them? Not at all! That means you still have an opportunity to do something new and exiting before someone else. These blockchains are thought about from a different perspective. Basically, here the nodes are managed by some organizations that in principle trust each other. They are all at the same level and none of them can do anything (because of blockchain’s architecture) without been registered in everyone’s ledger. The users access through a web interface (connected for instance through an API to the node-servers) and they have restricted permissions. Therefore, they are generally neither transparent nor open.

Federated blockchains: The difference between private and federated is the number of organizations controlling the network. Private stands for one and federated stands for more than one.

Blockchain as a Service (BaaS): You might be used to concepts like Software as a Service, defined by Wikipedia as “software licensing and delivery model in which software is licensed on a subscription basis and is centrally hosted”. BaaS is similar but with blockchain. Some of the foremost companies like IBM, Microsoft and Amazon are offering blockchain services in the cloud. In general they offer hosting your network and nodes in their clouds instead of in a private server or cloud, but they don’t code for you. This is supposed to include more security, assistance and sometimes a friendlier environment.


The Reality about Private/Federated Networks

To wrap up this long article, let’s go through some insights about the business of blockchain.

The open source options for coding your own blockchain we have just mentioned are still in an early stage. Despite the fact that there is a community of developers around the world very excitedly working on it, my opinion (as a member of this world) is that not many reliable options have been released yet.

It is important to have into account that many (perhaps most) of the projects trying to implement blockchain nowadays are not using this technology in new ways. They don’t use it to enhance transparency and they don’t provide open access either. If the nodes hold by the organizations decide to highly restrict the access permissions to the regular users, it won’t be different from a traditional database.

From my perspective there are two beneficial approaches concerning the advantages of these two networks for businesses.

For organizations working together, blockchain can be useful as a distributed database for sharing information in a trusted way under the supervision and validation of all the (or many) participants. The more transparent and open they want the network, the more useful blockchain is.

The second approach is related to digitization. Blockchain needs and helps with digital signatures and digital registers of properties. There are groups of organizations working on it already, like the Spanish Red Lyra.


Thank you for your time! I will be more than pleased to discuss anything with you in the comments or via e-mail: marcosallendel@hotmail.com.

And, if you want to know more about blockchain, you can read a paper we have written at the IDB.

Thanks to Vanessa Colina

Marcos Allende Lopez

Written by

Physicist working as a Researcher and Consultant on new technologies. Trying to make them more accessible and understandable.