Blockchain - The Basics

Blockchain - The Basics

There are many blockchain experts in the industry and I do not claim to be one. However, I had been studying the technology for a while now for a few of my projects, so I thought it'd be a good idea to offer my perspective on the topic to anyone thinking of adopting or just exploring the technology.

Whether you’re a tech guy, a product owner, a CEO, or an entrepreneur, if you wish to seek a theoretical understanding of blockchain, this article will shed some light and even help you decide if this is something worth pursuing from a technical standpoint.

Let's start by distinguishing between 'Bitcoin' and 'blockchain', with the latter being the focus of this article. Simply put, Bitcoin or other cryptocurrency is an application that uses blockchain as a database.

What is a blockchain?

Yes, a blockchain is a database. Those who are tech-savvy may be familiar with its variations in the market. For instance, SQL databases are highly structured and carefully designed to store relational and transactional data, whereas NoSQL (Not Only SQL) databases are less structured, and are designed to solve some relatively new problems such as storing large amounts of information on speed and volume of data being produced by smart devices every second.

Like the examples above, blockchain is just another type of database and is one of the latest additions to the family. It is designed to solve a specific problem which we’ll examine later. For now, all you need to know is that a blockchain is just a database like any other which you can install and use on your computer.

Examples of Database - SQL, NoSQL, In-memory, Key-value

Why does blockchain exist and what problem is it trying to solve?

Blockchain was mainly invented to solve one problem, and that is 'trust'. Trust in this context does not refer to the typical trustworthy relationship you have with your friends or colleagues, but rather the mechanism to establish trust between two strangers on the internet. In other words, “how might we safely carry out and verify a transaction of any kind between two individuals across the globe?” Note how this revolves around two parties without relying on a trusted third-party to carry out the transaction.

Let’s say John wants to hire Sam to carry out a freelance design work. Once the deal is done and Sam has delivered her work, John would then 'instruct' his bank to transfer the agreed sum of money to Sam, and the transaction is completed. Easy right?

Except, notice how the bank is acting as a middleman between John and Sam. Both participants in this case are trusting the bank to deliver the money safely and legitimately, in exchange for a relatively small fee, for sure.

This was how the concept of blockchain started, that is with the question of “how can we do this without the middleman?” It was set to eliminate the involvement of a third-party that is authorised to regulate certain activities but has the slightest chance of being biased or influenced. Other limitations include human errors, and the inability to carry out one's duty due to natural disaster or public holiday.

So there we have it. Blockchain was introduced for the purpose of establishing trust on the internet where fraud can easily occur especially when dealing with strangers. It’s worth mentioning that by removing the middleman you eliminate the need to pay for its service fee. You would also see an entirely new set of economic opportunities and drawbacks or threats that emerge as a result.

How does blockchain work?

Now, let’s get to the juicy bits.

A blockchain is a database, which means you have the ability to store data, extract them when needed, manipulate, aggregate, and even delete them if you want to. All of these attributes apply to all kinds of databases, with the exception of blockchain's 'immutability'.

Immutability is an engineering term. The opposite of immutability is mutability - both of which refer to data types. In other words, there are mutable and immutable data when it comes to computers, and both have their own set of pros and cons.

Imagine a text box on a screen where users can input their name. Such information is known as mutable data given how users can modify it to their liking. Immutable data, on the other hand, cannot be changed or modified. An example of such data is your email address. Once you’ve registered your email address you can no longer modify it. You can create a new email address for sure, but you can’t modify an existing one. In short, mutable data have the ability to mutate or change while immutable data cannot be changed once they have been set.

Immutability of blockchain

Blockchain is immutable. Everything you store on a blockchain is immutable and cannot be changed. This is the part that makes blockchains safe and trustworthy. It’s to take comfort in knowing that if I were to store some data there, no one including the system is able to modify it.

Wait, isn’t that ridiculous? What if you want to change the data? What if you stored your name as 'John' and now you want to change it to 'John Doe' instead? Well... you can, but it’s a little tricky and not as straightforward as MySQL, for instance.

In a typical RDBMS (Relational Database Management System) such as MySQL, the process of updating data is straightforward. A simple UPDATE SQL statement would do the job, however this would result in loss of data. In this case, MYSQL would have no ability to trace the previous version of the data prior to the update - it now knows the data as ‘John Doe’ but the previous record of ‘John’ is now lost.

Blockchains on the other hand are designed to act like a financial ledger, similar to that used in the banking industry. Updating data in the context of blockchain involves adding a new entry to the bottom of the ledger while keeping the previous record intact i.e. a blockchain would be able to tell you that on 1st October John had added his name as 'John’, and later changed his name on 21st October to 'John Doe'.

The concept of storing data in the form of a ledger may sound counterproductive to engineers coming from the RDBMS universe, as a blockchain would end up having multiple records of every change you make. As you might expect, the database can grow exponentially in size, and this is an aspect that must be addressed before deciding to use a blockchain. 

You can expect your data to grow exponentially in size over time.

To sum up this section, the concept of immutability creates room for what is known as a ‘ledger’, a mechanism used heavily in the banking industry to record customer account balance, for example. A newly created account starts at $0, customers can then make an endless number of deposits and withdrawals that get recorded. If you wish you know your current account balance, you can easily calculate all past transactions to determine your current balance.

Wait, aren't blockchains decentralised?

Blockchains are indeed decentralised, but not in the way that some (mis)understands it - where different pieces of information are distributed across different computers, servers or nodes. In fact, it’s quite the opposite. A ledger is replicated multiple times across all nodes in the system so that all nodes have the exact copy of the ledger at any point in time (speaking of data growing exponentially).

Decentralisation of Blockchain

Thus, the main concept of decentralisation lies in the fact that it is a ‘redundancy’ mechanism, not so much a 'distribution' mechanism as it is popularly known for. However, in doing so, we achieve both outcomes and you’ll see why shortly.

When it is said that blockchains are decentralised, the statement refers to the operational / governance aspect of it, not the chain itself. A decentralised database means that not a single party has absolute control over the database, unlike other databases such as RDBMS or NoSQL.

The way a traditional database like MySQL works is by having a single server (hardware or software) running, while all client applications are connected to it directly to create, read, update and delete data. This server is typically owned by a single organisation or individual which gives them absolute control over the data that resides within it. Sure, you may export multiple copies of the database as backups in case of disasters but you can never have more than a single instance of it alive and running.

Having more than a single instance of any RDBMS alive and running would mean having two separate databases containing separate data that are irreconcilable. Updates to a record on server A will remain in server A, while server B is completely unaware of such updates. This is a characteristic of RDBMS, designed to be centralised and to be the single authoritative source of information.

Now consider the fundamental design aspects of a blockchain, which is immutability. Considering how blockchains never update or delete existing data but instead continues to add more records or changes to the ledger, this means synchronising two or more replicas of the ledger is a breeze, unlike an RDBMS where one needs to first identify which record is the latest before replicating it. In a blockchain, you can be sure that all previous records are the latest, so go ahead and make as many copies of the data as you wish from any node.

We can now slowly see why blockchain is also referred to as a distribution mechanism.

Unlike an RDBMS, you can run multiple instances of the blockchain database on different servers. You may even have them physically located at two separate locations, and the internal engine would know how to synchronise itself with other copies of it on the network, thus eliminating the need for different organisations or parties to request information from one another. This cements the mutual trust in each other’s information. Each organisation can have their own node of the blockchain running and they can query the database at any point time with the assurance that the information it contains is the single version of truth that is impossible to tamper with.

Some use cases of blockchain

As you would know by now, a blockchain is bound to turn into a behemoth and that is not good news for maintenance and other aspects of operation. So why use blockchain in the first place? Knowing it is just a type of database, let’s explore some use cases where blockchains become indispensable and superior to other types of databases. As a rule of thumb, where there is a need to establish trust, blockchain can be an answer.

Blockchain as an alternative banking solution

Bitcoin was one of the very first applications that utilise blockchain technology. It was created as a proof of concept to demonstrate the possibilities of an alternative to traditional banking, where an automated system replaces human governance over how money is stored and moved from one account to another. However, it became viral too quickly, so much so that it has now become a challenge to stop it.

It’s important to note that Bitcoin is not a replacement to the current banking solutions we have, but rather an effort to address specific gaps that can be otherwise challenging for large banks. For instance, banks are closed during public holidays and no transactions can occur due to staff unavailability at the bank branches. In this scenario, blockchain can stand in as a reliable technology to address this aspect safely.

It’s also worth mentioning that banks come in different sizes and have different capacities in their ability to serve their customers’ financial needs. This puts a limit to the number and type of customers a bank can serve. Customers who are unable to fulfill the requirements set by the bank fall in the cracks of the underserved or unbanked segment. If operating cost is a showstopper for banks to serve these segments, using technologies like blockchain can reduce overhead cost and allow banks to re-visit the idea of building financial products targeting these smaller segments of customers.

Most of our discussion so far revolves around financial services and that was exactly how blockchain gained entry into the main market. Since then, we have discovered other use cases where blockchain technology can truly be useful.

Establishing a universal digital identity

One important use case is establishing digital identity, which is currently a hot topic as many companies are racing towards attaining true digital innovation given that ID systems have been around for the longest time but rarely get updated. Especially in this digital age, fraud is commonplace. We see ourselves needing to produce proof of our identities more and more frequently. No one is a stranger when it comes to presenting their plastic ID cards every time they visit a public service office. We also understand the implications of losing our ID cards as well as identity theft.

Now imagine having your proof of identity stored on a blockchain, knowing it is immutable (cannot be tampered with) and decentralised (every public office can have a node). There are many benefits that come with digitising such systems using blockchain, and skipping the hassle of getting a replacement ID is just the tip of the iceberg.

Producing proof of authencity

Proof of authenticity is another use case of interest that is recently booming. In the online art community, Non-Fungible Tokens or NFTs is a creative term that implies immutable data or data that cannot be changed. Like in the real world, art collectors, brokers and sellers are required to produce the certificate of authenticity of a piece of art before it can be bought or sold. NFT is simply the digital version of such certificate.

In the production line such as that of Apple Mac Machines, soon every single device ever made in the future would likely be recorded via its serial number on a blockchain, thus proving its authencity and eliminating ownership disputes.

Where are we in the development of blockchain?

As a final note, it's important to realise that blockchain as a technology is still currently in the developmental stage. What this means is that future versions of blockchain may not behave in the way we now know. The fact that blockchains can grow exponentially in size over time concerns the minds that created them and those who wish to make use of the technology. Thus, the community is continuously and rapidly trying to iterate new versions with new design approaches that can accomodate this concern.

With that said, there are already some stable iterations / versions of blockchain technology that are currently used in real-world applications, such as Ethereum. You too, have the ability to utilise stable blockchains like Ethereum to build your application around it. Being in the development stage does not necessarily limit one's abilty to utilise the technology. However, it's likely that in a few years, the technology may become outdated and you would be required to continuously enhance your project code base. This is a concept that is no longer alien to engineers who know very well that work never really gets done but rather we are merely satisfied with the current state of implementation.

Was this page helpful?

Most Viewed Articles