'

Beginner’s Guide to Blockchain

Blockchain is a hot topic in the tech world these days. You may have heard it used in the context of bitcoin or cryptocurrency since it is a key technology that allows cryptocurrency transactions to take place.
Share on linkedin
Share on twitter
Share on facebook

Blockchain is a hot topic in the tech world these days. You may have heard it used in the context of bitcoin or cryptocurrency since it is a key technology that allows cryptocurrency transactions to take place. Blockchain is known for being secure and ‘unhackable,’ which is why it is useful in the world of fintech (financial technology). 

But what is blockchain? And what makes it so secure? Read on to gain a better understanding of this awesome technology!

 

Blockchain Over Time

 

What is Blockchain?

Blockchains are a highly secure type of data storage built from code. More specifically they are distributed, digital ledgers.

Most people are familiar with non-digital ledgers. These are books kept by accountants, bankers, or store clerks that are used to record transactions. They can record the names of the parties involved, the value of the transaction, the date on which the transaction was made, and any other pertinent information. Today, most people probably use digital ledgers, like Excel spreadsheets, rather than physical books. 

The shortcoming of these traditional ledgers (even digital ones in Excel) is that they can be changed. Someone might spill soda on a store clerk’s ledger book. An accountant could delete rows from an Excel spreadsheet if they wanted to remove evidence of a transaction. Someone else could even hack into the accountant’s computer and alter the Excel spreadsheet themselves!

Blockchain ledgers can not be changed in this way because of their distributed nature. Imagine if a digital ledger like an Excel spreadsheet was copied a thousand times and sent to a thousand different computers to be stored. If a nefarious hacker was able to alter one copy of the ledger, 999 other copies could be compared to show that an unauthorized change had been made and the change could be spotted relatively easily, as in the example below.

 

That’s the fundamental explanation! To review, blockchains are:

  • A type of ledger (used to record transactions)
  • Digital
  • Built from code
  • Distributed
  • Secure

Now that we’ve covered the basics, let’s dive into a more technical explanation. Blockchains are not literally a thousand copies of an Excel spreadsheet. That would be messy and difficult to keep track of. Really, a blockchain is a chain of blocks distributed over many nodes. 

That sentence might have sounded like complete gibberish. To help make sense of it all, let’s clarify what these components are and how they form a blockchain.

 

Components of a Blockchain

As you might have guessed, a blockchain consists of a chain of blocks! Each block is a file – often of the format .DAT – that contains information about a certain number of transactions in the ledger. A single block in a blockchain is like a single page in a transaction ledger. Transactions are recorded in the current block until the file reaches a predetermined size, then a new block is created and chained to the previous one. The first block in a blockchain is created by the blockchain’s founder and is called a “Genesis Block.” As more and more transactions occur, the blockchain grows. The number of blocks in the blockchain is known as the “block height” – a blockchain made of 212 blocks has a block height of 212.

In addition to all of the transaction data, every block also has a header section that contains metadata – data about itself. The header includes a timestamp for when the block was created, the block’s hash, and the hash of the previous block. A hash is a unique identification code for that block – often a string of numbers and letters like “p241aKIhei78dsadDIIoxxb…”

Though a hash may look random it is anything but! Each block’s unique hash is calculated by a complex algorithm that uses the block’s transaction data as inputs. This algorithm is different for every blockchain, but the same for every block within a blockchain. As an example, the Bitcoin blockchain uses an algorithm called SHA-256. All of the hashes for Bitcoin’s blocks are calculated using SHA-256.

The blocks are chained together because each block contains the previous block’s hash. This establishes an order to the chain and also helps to prevent and detect tampering. 

Next up, we’ll dive deeper into how blockchains are able to be so secure. But first, let’s review the blockchain components that we’ve just discussed. They are:

  • Blocks – Contain transaction data and metadata
  • Header – The part of the block that contains metadata
  • Hash – Part of the metadata contained in a block’s header
  • Timestamp – Another part of the metadata found in the header
  • Algorithm – Used to calculate the unique hash of each block in the blockchain
  • Genesis block – The first block in a blockchain

How are Blockchains So Secure?

Blockchains are made secure by their distributed nature, the chaining of ‘blocks’ together, and through cryptography. 

We initially defined a blockchain as a distributed ledger. What we mean but that is – instead of storing the record of all transactions in a single centralized location like a server or computer, copies of the blockchain are distributed amongst all of the blockchain’s participants. Each location that stores a copy of the blockchain is called a node.

Using Bitcoin as an example, any user that wants to mine Bitcoins must download the full Bitcoin blockchain to their computer. As of 2022, the blockchain was about 400 GB. Their computer then becomes a new node. Nodes connect to one another using the internet and so, are able to sync as new blocks are added. Furthermore, the nodes can constantly validate each other’s versions of the blockchain. That is, all copies are compared to all other copies to make sure nothing has been changed.

If a hacker were to gain access to one node and tamper with the blockchain, it would immediately become evident that one copy of the blockchain does not match with the others. In this way, threats can be quickly identified and isolated. 

The distribution of blockchains also protects them from technical failures. There is no “mainframe” or “motherboard” that could break and cause the downfall of the blockchain. The worst that could happen is that individual nodes fail. As long as there are enough nodes to validate each other and back up data, the risk of data loss is low.

Blockchain Validation

Another key factor in blockchains’ security is their chained nature. In our discussion of a blockchain’s components above, we mentioned that every block has a unique hash, or identifier. This hash is produced by an algorithm that uses the transaction data housed in the block as inputs. Each block’s hash is permanent, they are never changed. However, if any piece of the data housed in a block were tampered with, the block’s hash would change. 

Let’s explore a simplified example. 

  • Say a block contains the data A=2, B=6, and C=8. 
  • A super simple ‘algorithm’ to calculate a hash could be A+B+C. 
  • Applying the ‘algorithm’ we get 2+6+8=16.
  • The block’s hash is 16!

 

Now, suppose someone were to hack the block and change C from 8 to 800. 

  • The ‘algorithm’ now calculates 2+6+800=808.
  • The block’s hash is 808!

 

So, how do we know whether a block’s hash is correct? Luckily, blocks are all chained to each other by storing the previous block’s hash! Using the example above, the next block in the chain would contain the information that the hash should be 16. If the hash is changed to 808, an error would immediately be flagged. 

In reality, the algorithms used to calculate hashes are much more complicated than A+B+C. If any of the data contained in the block is changed even slightly, the algorithm would calculate the ‘wrong’ hash and signal an irregularity or breach.

How does blockchain work?

Another security defense used by blockchains is cryptography. You may be wondering, how is a data store that is distributed to thousands of users considered secure? 

Here’s how it works – the data stored in a blockchain is not stored as plain text or any other format understandable by humans. If a user were to open up a random block file from a blockchain, it would most likely look like long strings of numbers and letters. In fact, there is information contained in these strings but it has been encrypted so that it can be stored, but not understood. This process is called encryption.

To recap, blockchain is a favored form of data storage for financial transactions because it is designed to be highly secure and to make any tampering immediately evident. The three main elements that make blockchain secure are:

  • Distributed storage
  • Chaining of consecutive blocks
  • Encryption

Popular Blockchains and Their Languages

Until this point, we’ve only briefly alluded to the use of coding in blockchain, but the truth is, code is what all blockchains are built from. There isn’t one single coding language that can be used to build a blockchain but some may be more suitable to the technology. To illustrate this, here are a few popular blockchains along with the coding language that they are built with.

BlockchainLanguage Used
BitcoinC++
EthereumGo, Python, Java, Solidity
MoneroC++
LitecoinC++
Hyperledger FabricJava, Python

Applications of Blockchain

Blockchains are most often designed to store data about transactions. Their highly secure nature makes them excellent for use in the financial sector where data breaches are particularly worrisome and hacks could be ruinous for businesses and consumers. However, blockchains can be designed in an assortment of ways to meet specific business needs. A few common applications of blockchain in today’s fintech industry are:

  • Cryptocurrency
  • Smart Contracts
  • Secure Voting
  • Money Transfer
  • Commodity Tracking
  • Medical Data
  • Real Estate
  • Capital Markets

The list above is not exhaustive and the ways that blockchain is being applied to solve modern problems and improve systems across sectors are rapidly expanding! Now that you understand what blockchain is, you can keep an eye out for new developments in the technology and come up with your own new ways to use it. In the meantime, you can learn more about fintech and related topics on our 2022 Guide to Fintech Bootcamps.

Glossary of blockchain terms

Related Articles