Wondering What a Blockchain is? Here’s a Simple Technical Introduction.

0xhank
10 min readNov 25, 2021

--

Prior to this summer, I wrote off cryptocurrency as imaginary money built on a speculative market bubble. After entering the community of blockchain developers I’ve discovered it’s actually a socio-political movement that seeks to improve the world. This introductory article will help you learn why blockchain exists and how it operates. After you’re finished, I hope you see its potential to redirect our society to a more stable and accessible world.

Figure 1

You don’t need any technical expertise to read this article; I’ll use as little technical jargon as possible, and when I do, I’ll clearly define it beforehand. Patience and curiosity are required — it’ll take more than this short article for you to understand a topic as complex as blockchain. Since finance is currently the central focus of the crypto world, I’ll use simple examples from banking to aid in understanding. There are many components to the blockchain paradigm, but for simplicity, I’ll place them under the umbrella of “blockchain.”

Why the blockchain was invented

The single greatest hurdle confronting the growth of blockchain technology is that not enough people understand its purpose. So before we dive into the technical underpinnings of the protocol, let us first answer the question: Why was the blockchain invented?

The blockchain was made to solve issues regarding centralization, the consolidation of power into one person or institution. In our financial example, the centralized power is your bank. Banks have made it secure to save money and quick and simple to transact money. They also offer useful services like mortgages, credit cards, and savings accounts.

However, a malevolent or poorly run bank can result in:

  • Dishonesty: It could lie to you about your account information
  • Censorship: It could reject your requested transaction for any reason
  • Single Point of Failure: It could fail, resulting in you losing all your money

While our banks may feel too well-run and secure to ever encounter these problems, there are recent examples of bank failures and predatory behaviors most notably during the 2008 financial crisis.

The first blockchain, Bitcoin, was created to address issues with modern banking without sacrificing its benefits. It does so using a decentralized protocol. Decentralization is the opposite of centralization — spreading power out and increasing equality in a network. In a decentralized system, anyone can create an account for free, nobody can block a transaction from occurring, and data cannot be lost. It’s extremely hard for a malicious person to subvert it. Therefore, decentralizing finance has increased individual autonomy, blocked censorship, and eliminated one single point of failure.

So what actually is blockchain?

A blockchain is a set of components that define a special network with the benefits of a centralized network and without its pitfalls. In financial terms, it’s a banking network without the need of a bank. These components are:

  1. A network of computers that are equal and are constantly talking to each other
  2. A single database that everyone individually keeps and maintains
  3. A protocol that ensures everyone’s database is identical
  4. Cryptographic (fancy math) tools that prevent fraud

Separately, components one, two, and four have existed for decades. It wasn’t until 2009 that they were united with part three, and the blockchain was born. Let’s walk through each of the four parts and see how they work together to improve upon centralized banking.

An Equal Network of Computers

In a traditional banking system, there is one centralized entity that is the middleman for everyone else: the bank. The network looks like a central node connecting all subservient nodes.

In the blockchain system, there is no central bank; everyone is equal. To communicate, someone talks to neighboring nodes, who in turn communicate with their neighbors until the message has spread through the system.

Figure 2

A Database of Which Everyone has a Copy

In the traditional banking model, the bank holds all information. When I want to know my bank account balance, I ask the bank and it tells me. When I ask to send ten dollars to my dad, the bank deducts that amount from my account and adds it to my dad’s account. The bank can choose at any moment to withhold information or decline a transaction as it sees fit. If it loses data about my account, it is gone forever, and my money vanishes.

By comparison, in the blockchain system everyone keeps the same database with the same history going all the way back to the first ever transaction. If I want to send money, I tell my neighbors, who update their databases with the new transaction before telling their neighbors, and so on. Nobody in the system can deny me from transacting if I have enough money. If I lose data about my account, the data will still exist on other nodes. This system allows for autonomy and prevents censorship.

The Problem of Transaction Chronology

The protocol described above has a problem: how can we ensure that everyone’s database has the same order of transactions?

Let’s say I send money in the US. My friend in China, on the opposite side of the network, sends a transaction at the same time. It takes some time, typically a few seconds, for the transaction to spread across the network. My nearest neighbor will hear of my activity before my Chinese friend’s. However, my Chinese friend’s neighbor will hear his before mine. This means these nodes have differently ordered databases. There needs to be a way to canonize the record so everyone’s history is identical.

The Solution: Let’s Play a Game!

One solution to the problem above is to choose one person who holds the ‘true’ ordering of transactions. Everyone else derives their databases on what they state as fact. However, this system would not be different from centralized banking. To make it decentralized, everyone needs to have the same chance of being the one to decide the order of transactions. Here’s how the system works:

Every ten minutes (or any arbitrary block of time), everyone in the network plays a game that has a random winner. The winner shows everyone they won the game and tells everyone their ordering of transactions that fall within that “block” of time. Everyone verifies that they won the game and adds it to the end of their databases, making it canonical. One person wins the game every ten minutes, which means exactly one block is created. The block contains all transactions within that time frame.

The winner receives money for her efforts, which encourages participation. As more winners add more blocks of transactions, the database becomes a chronological chain of blocks, also called a… blockchain! Believe it or not, the players of the game are called “miners,” and the game is the infamous mining process.

It is necessary for the game to be unexploitable. If someone could find out how to cheat, they could instantly win every round. In the case of most blockchains including Bitcoin and Ethereum, players use a special computer function called a “cryptographic hash function,” commonly called “SHA.” For a given input, SHA will output a seemingly random number. There’s no way to figure out the input based on the output number and an input will always yield the same output.

In the game known as “Nakamoto Consensus,” a player inputs a value into SHA. If SHA’s output is less than some predetermined number, called “difficulty,” that player wins the game! If not, they can try another input. It’s easy for other players to verify that a player found a solution, as they can just run SHA on the input and see if it’s small enough to win.

If someone finds a solution faster than the allotted ‘block time’ (for Bitcoin around ten minutes), the network automatically makes the game more difficult by making the target number, or difficulty, smaller. It can do the opposite if the game takes too long to be won. This ensures each block takes roughly the same time to be “mined.”

In this game, the only way to increase your chances of winning is to try more inputs than anyone else. This makes it a “Proof of Work” protocol because you must do a ton of computations to have a chance to win. It’s impossible to make money exploiting the game unless you have a lot of expensive computational power. The current reward for winning is 6.25 BTC (~$300,000 as of 2021), so miners use an extreme amount of power to run SHA as many times as possible and increase their chances. To combat the environmental impact of this power use, Ethereum will soon change its game rules to “Proof of Stake,” which I won’t describe here. As computational power will no longer affect winning chances, the amount of energy used by miners will drop by more than 99.9%.

Figure 3

If two people win the game at the same time, typically the network will collectively choose one block to canonize based on which block spreads across the network faster. The other gets discarded and its transactions return to the pool of transactions still to be mined. Different protocols have specific ways of handling this conflict.

Preventing Fraud with Cryptography

So far, we have learned about a network that allows people to perform transactions without needing to go through a central bank. We’ve seen how it can maintain a unified database, called a blockchain, on individual nodes. Lastly, we’ve seen a protocol to add new sets of transactions, called blocks, to the blockchain. We still need to understand how such a system handles identity and prevents fraud.

To handle fraud, the blockchain uses “cryptography,” built with complex math. With cryptography, someone can send a secret message to you without anyone else being able to read it along the way. You can also sign messages with a cryptographic “digital signature” to verify you sent a transaction.

This section will be technical but is critical for a complete understanding of the blockchain protocol.

The Cryptographic Protocol: Key Creation

Each account in blockchain uses two components to protect identity:

1. A top-secret private key

2. A public key that anyone else can see

To create an account, you generate a private key. Each key is a large number, or, technically speaking, a string of 256 bits (where each digit is either a 0 or 1). There are private key generators online, or you could just write your own. Regardless, nobody else must know it or they can steal your identity.

From the private key, the blockchain uses SHA to automatically create a public key. It’s impossible to derive the private key from just a public key and the private key always generates the same public key. Once the public key is created, everyone can see it.

Writing Secret Messages with Keys

Let’s say you want to write a secret message to me. On the blockchain, if you just send it as plain text, everyone could read it as it spreads throughout the network, like a postcard in the mail. This is where cryptography comes in.

You can use my public key, which is accessible to anyone, to encrypt your secret message. This takes the message and jumbles it into an unreadable mess using a cryptographic function. The only way to decipher the message is to use my secret key. Since I’m the only one with access to it, nobody along the message’s journey can find out what’s written.

Figure 4

Using Digital Signatures to Prove Identity

We can also use public and private keys to prove that someone wrote a message. When I send a message, I sign it with a “digital signature.” This is an encoded combination of my private key and the message itself.

Figure 5

To prove I sent the “signed” message, you use my public key. If you decrypt my digital signature using my public key,, it will exactly match the original message. Anyone else’s public key would result in a jumbled mess.

This technique is crucial to preventing fraud. It allows everyone to easily verify the sender of a transaction. There is no way for someone to deceive the group into believing they are someone else without having access to their private key. But if they have access to the private key, they can fraudulently read and send secret messages. Therefore it is essential to protect your private key.

Ethereum and the Future of Blockchain

The blockchain protocol was designed in 2009 by a mysterious entity called Satoshi Nakamoto. It was used to create Bitcoin, the “Central Bank of the Internet,” and has gone unchanged since it was started. It allows for a decentralized banking system that is fraud-proof, impossible to censor, and is difficult to take down.

Ethereum, currently the second most popular cryptocurrency, was designed in 2015 by Vitalik Buterin. It adds to Nakamoto’s protocol to make what I’ll call the “Central Computer of the Internet.” While the Bitcoin blockchain can only store transaction information, Ethereum has the additional capacity to store computer programs called “smart contracts.”

Anyone can write code (typically in languages Solidity or Vyper) and send it to the Ethereum blockchain, just like transaction information. After that, anyone can call functions to access the program. Smart contracts can do anything a normal computer program can, like setting and retrieving information and storing money. Currently the most popular are decentralized finance (DeFi) smart contracts that perform banking functions like lending, borrowing, insurance, and interest

Probably the most well-known Ethereum smart contract is the NFT, or non-fungible token. NFTs are records that track ownership of unique items like digital art, real-world objects, and even NBA plays. All ownership is stored in the smart contract and since the entire blockchain is publicly available, anyone can see any NFT.

I believe that the future of blockchain technology lies in Ethereum due to its smart contract capability. The technology is still in its infancy because of the lack of public understanding, high fees, and concerns about scalability and environmental impact. However, as the community strengthens, awareness increases, and problems are ironed out, Ethereum, Bitcoin, and other blockchain-based technologies will guide us towards a more decentralized world.

Figure Sources:

  1. https://www.indonesiatatler.com/society/kenneth-tali-shares-the-5-basic-principles-of-blockchain-technology
  2. steemkr.com
  3. https://etherplan.com/2020/03/21/why-proof-of-work-based-nakamoto-consensus-is-secure-and-complete/10509/
  4. https://www.twilio.com/blog/what-is-public-key-cryptography
  5. https://en.wikipedia.org/wiki/Digital_Signature

--

--