Blockchain in a nutshell

How does Blockchain work?

Erikson Murrugarra
WAES
9 min readAug 4, 2022

--

Blockchain is one of the most talked about technologies in recent years. Since cryptocurrencies gained popularity worldwide, the words “Blockchain” and “cryptocurrencies” have been used as if one. Still, Blockchain is much more than a technology for cryptocurrencies. In itself, it is a technology that has come to change and decentralize the way transactions are processed.

Imagine that we have to manage a database, which should not be centralized or controlled by a single owner. In this database, multiple participants can manage it simultaneously in a decentralized manner. Each participant has a copy of the database locally, which is updated periodically based on those carried out by the operations of other participants in the network.

The first thing that comes to mind is questions like:

  • How do we ensure that the data is stored in the correct order?
  • How do we manage the chaos and prevent any participant from acting maliciously and trying to modify the database records, thus altering the information and making it unusable?
  • How could we ensure that the participants always have the same information and avoid data duplication?

A distributed and decentralized storage system is a great challenge if we want to implement it with traditional technologies. That is why Blockchain came to the world.

What is Blockchain?

Blockchain is a technology based on a chain of decentralized and public operations blocks. This technology generates a shared database to which its participants have access, who can track each transaction they have made. It is like a large, unchangeable, shared ledger written by a large number of computers simultaneously.

Decentralized Blockchain nodes

Every time a network member performs a digital transaction, that transaction generates associated data that will be stored in one of the blocks. When that block is full of information, the block is coupled to the Blockchain and then transmitted to the other participants for the block validation process, known as mining.

The information stored on the network will depend on the purpose for which it was created. It can be a network that stores payment data (cryptographic currency or cryptocurrencies), medical information, logistics or food traceability data, and even electoral data count.

Blockchain vs. Centralized network

The difference between Blockchain and a centralized network (a traditional server that stores data) is that the blockchain network runs on multiple computers distributed worldwide and not on a single site. This makes the blockchain network present a series of advantages such as privacy, decentralization, or not depending on a centralized executor or security. However, it offers a series of challenges we will assess later in the section on advantages and disadvantages.

The programmable and open nature of this technology allows innovation in the financial sector and administrative processes to make them more efficient and transparent. In addition, the bureaucracy is reduced. Blockchain is the technology that developed Bitcoin, the virtual and intangible cryptocurrency supported by the protocol and the P2P network.

In short, with Blockchain, processes are streamlined and cheaper, transactions are more transparent, and intermediaries are eliminated.

Centralized vs. Decentralized networks

How does it work?

The Blockchain is a record of all transactions stored and shared publicly. The so-called miners are responsible for verifying these transactions. After that, they are included in the chain and distributed to the nodes that make up the network.

Let’s see what each of these elements consists of:

Blocks

A block is made up of a set of transactions. Each one is part of the blockchain. The Bit2me company, which specializes in Bitcoin and its technology, defines each of the elements that make up a block:

  • An alphanumeric code that links to the previous block.
  • The “package” of transactions that it includes (the number of which is determined by different factors).
  • Another alphanumeric code that will link to the next block.

What the next block in progress is trying to do is find out with calculations the alphanumeric code that allowed the previous block to link to this one. When a new block is added to the Blockchain, all members will receive a copy of the new block added.

Blockchain’s blocks composition as a Linked list

Miners

Miners are computers that are responsible for verifying all transactions. When someone completes a block or makes a transaction, they receive a reward in Bitcoins. There are nodes in the network competing for validating blocks, and there can only exist one winner in this process.

Nodes

A node is a computer that is connected to the Blockchain network. It is dedicated to storing and distributing an up-to-date copy of the Blockchain. Therefore, each newly confirmed block is added to the Blockchain and the copy that each node holds.

Blockchain Types

Blockchain technology has evolved by leaps and bounds over the last 10 years. The powerful capacity for innovation in data documentation and storage procedures has not gone unnoticed by governments and private companies. That is why they have also wanted to implement private blockchain networks (with restricted access).

We will review the different types of blockchains concerning where they run and who has access to them.

Public Blockchain

These are the best-known examples, such as Bitcoin and Ethereum. Being public means, they are accessible to any user in the world (they only need a computer and an internet connection). The counterpart of a public blockchain is its security management, since the greater the number of users, the higher the level of security we will need. This is where the consensus protocols and security measures we will see later come into play.

Private Blockchain

Private blockchains are characterized by the fact that, unlike public ones, access depends on a central unit (company, organization, or individual). The elements are the same as in a public blockchain. One of the best-known examples of private blockchains is the Hyperledger network.

When a blockchain network is private (not public access), but its access and control are in the hands of a group of companies/individuals, it is known as a Blockchain consortium.

In the following image, we see the different types of Blockchain we have discussed in a Venn diagram, where we see how they are categorized according to the level of privacy.

Types of Blockchains

Consensus protocols and nodes in Blockchain

One of the biggest challenges of these distributed networks is that they are widely susceptible to hacks and attempts to sabotage the Blockchains to introduce false transaction data (imagine being able to enter a bank’s central server and modify the balance of the different customer accounts). There are multiple security measures to avoid all these problems, and among them, we find consensus protocols.

A consensus protocol is a mechanism regulating how the nodes approve the blocks simultaneously so that they can become part of the blockchain. The main consensus protocols are Proof of Work (PoW) and Proof of Stake (PoS). The Proof of History consensus (PoH) protocol executed by the Solana blockchain has recently entered the market.

Proof of Work (PoW)

This is the oldest consensus protocol implemented on Bitcoin’s Blockchain. In this protocol, all the network nodes are equal and have to compete with the rest to receive the reward for validating the block.

To be the winning node, it has to solve a mathematical test of variable complexity (the more nodes want to validate, the more difficult it will be). Therefore, the one with a greater computing capacity will have a greater probability of being the winning node.

The disadvantages of this consensus protocol are energy consumption (since there is direct competition between the various validators, all of them try to have the maximum number of “computers” to be able to process transactions) and vulnerability (if a validator gets hold of 51% of the computing power of a network will have control of it as it will be able to validate even blocks with false or malicious information).

Proof of Stake or Proof of Stake (PoS)

Because of the inconveniences that the workforce protocol or PoW presents, a proof of participation or Proof of Stake protocol was designed. In this protocol, for a specific block to be validated, the validator must have part of the native cryptocurrencies or tokens of the network it is trying to validate.

The algorithm will then randomly choose the validator that will add the following block among all those who have purchased funds and deposited them in the node it is running. We could say that it works like a raffle: the more entries you have bought, the more likely you can win validation and be the winning node. It is important to mention if the validator acts maliciously can lose all the tokens staked.

This protocol’s advantages are that it is much faster, consumes less energy, and does not require such a substantial investment in mining hardware as the PoW or Proof of Work protocol.

PoW vs. PoS Consensus Protocols

Blockchain advantages

Reduce fraud in operations

All participants have transparent access to transactions, and a consensus is needed to modify them, significantly increasing information security.

Confidence in business

Until now, this wasn’t easy to achieve online. Also, a public trading Blockchain protects the security of transactions as everyone has access to a single, shared source of trust.

Ease of economic transactions

One of the facilities that Blockchain provides is carrying out a financial transaction anywhere in the world in five to ten minutes. With the introduction of new layers in the blockchain, operations are getting even faster.

Blockchain disadvantages

Blocks are very inefficient. Depending on the blockchain, mining is very competitive, and there is only one winner every ten minutes, so other miners’ work is wasted. As miners are constantly trying to increase their computing power to have a better chance of finding a valid block hash, the resources used by the Bitcoin network have increased significantly in recent years. Currently, the network consumes more energy than many countries like Denmark, Ireland, and Nigeria.

With the introduction of new consensus protocols such as Proof of Stake, it is expected to reduce these disadvantages. Given the popularity of cryptocurrencies and the community’s concern to make these more environmentally friendly, more than 90% of projects blockchain used by mining (Proof of Work) have decided to migrate to more friendly consensus mechanisms.

Final thoughts

Blockchain is an excellent opportunity for all types of companies and economic sectors.

Markets and Markets projected that Blockchain would have increased from a $4.9 billion market size to $67.4 billion by 2026. That is an increase of 1300% in just four years. So, we are facing a massive market.

We are facing technology with all the components to bring significant advances towards a more open, transparent, accessible, and global information processing model of which we can all be a part.

Now that you know the “how” and you can check the “why” here (link to your other post), I hope that you’re not wondering “How does blockchain work?” or “Why should I learn blockchain” anymore, but “How will I change the world with Blockchain?”.

Do you think you have what it takes to be one of us?

At WAES, we are always looking for the best developers and data engineers to help Dutch companies succeed. If you are interested in becoming a part of our team and moving to The Netherlands, look at our open positions here.

WAES publication

Our content creators constantly create new articles about software development, lifestyle, and WAES. So make sure to follow us on Medium to learn more.

Also, make sure to follow us on our social media:
LinkedInInstagramTwitterYouTube

--

--

Erikson Murrugarra
WAES

DDD Software Architect | Blockchain | Web3 | AI | Master in IT | Book Author | Mentoring