An Introduction To Blockchain

Bitcoin has become a financial phenomenon of our times. Today, Bitcoin and cryptocurrencies are now valued at close to $2 trillion dollars. The technology that powers Bitcoin and these cryptocurrencies are called Blockchain. This article is a basic introduction to blockchain. If you are new to blockchain, this article is for you.

In this article, I will cover the following,

  1. What is blockchain
  2. How blockchain works
  3. What is the relationship between blockchain and Bitcoin
  4. Why blockchain is one of the fastest technologies
  5. Where can I learn Blockchain?

Blockchain is a distributed database that is secure and shared. Technically, a blockchain is software that runs on a network of computers that are connected to a peer-to-peer network. The network of computers can be desktops, laptops, servers, tablets, phones, and even devices like Raspberry Pie, depending on what devices are supported by a blockchain.

In simple terms, a blockchain is a chain of blocks. Each block in a blockchain contains some kind of transaction, a timestamp, a hash, and a hash of the previous block.

An Introduction to Blockchain

Blockchain is a database that is stored in form of blocks and each block is linked to the previous and next blocks that make it a chain of blocks. The data stored on a blockchain is immutable. That means, once data is stored in a blockchain database, you cannot delete it. The blocks on a blockchain are linked using a reference of the previous block in hash form.

Computer cryptographic algorithms are used to secure blockchains. Blockchain uses cryptographic hashing functions (or hashing or hash) to hash a complete block of a blockchain including the reference of the previous block. Hashing is a process that takes input data and regardless of the data size, it converts it into a fixed-length of bytes and returns as the output. This output is known as a hash or hash value. Here is an article to learn more about hash functions,

The blockchain database is not stored on a centralized server, but it is stored on a network of computers that are known as nodes and are connected on a peer-to-peer network. That means, there is no single authority that has control over the data. Each node on a blockchain network downloads the latest copy of the blockchain.

If you're still not sure what a blockchain is, read this detailed article,

Now that we have some understanding of blockchain, let us drill down more.

Blockchain is a software project called a node that runs on a computer.

A blockchain is a software that is a combination of software, a database, and algorithms. Everything combined is called a node. The software is often written in a popular programming language C++, C#, Java, Scala, Go, or JavaScript. The data can be stored in any kind of database or file. For example, Bitcoin Core is the Bitcoin node that is written in C++ programming language and uses LevelDB as its database to store blocks. LevelDB is an open-source database that stores data in key-value storage. Bitcoin uses the Proof of Work (PoW) consensus algorithm to rewards its miners.

Stratis Blockchain is written in C# and .Net Core. To learn more about a blockchain node is, check out this article,

Blockchain is secured using cryptography.

Blockchain uses computer cryptographic algorithms to secure data and users. Cryptography private and public keys are used to encrypt and decrypt user keys that are associated with transactions. A hash function or a hashing algorithm is used to create a hash of a block that is immutable, and the chain of blocks is linked with the previous hash.

These two functions of cryptography make blockchain immutable and secure.

An Introduction to Blockchain

To learn more about public and private keys and how to generate them using C#, check out How to generate private and public keys using C#.

Peer-to-peer Network

A Peer-to-peer (P2P) network allows two computers to communicate and send data back and forth directly without involving a server. Both computers open a port and implement a protocol of communication. A P2P network also provides reliability and availability. Each computer on a P2P network is called a node. A blockchain runs on multiple nodes and sometimes on hundreds and even thousands of nodes. Bitcoin Core blockchain is running on 80,000+ nodes that makes blockchain secure. All of these nodes can communicate with one another via the P2P network. One other advantage of a P2P network is, if one node is down in the network, it does not affect blockchain operations as long as more than 51% of nodes are up and running.

To learn more about peer-to-peer networking, read Building a Blockchain P2P Network using .NET Core.

Distributed Ledger

As we discussed earlier, a blockchain is a distributed database or ledger. A blockchain runs on a network of computers called nodes. Each node on the blockchain stores a copy of the entire blockchain database. When a new node joins, it must first download all transactions of the current blockchain before it can participate as a working node.

Once the entire blockchain is synced, the nodes talk to each other on a P2P network via distributed computing. Since the database is stored on a distributed network and stores transactions, it is also called a distributed ledger.

Consensus Mechanism

Consensus mechanism or algorithm plays an important part in a blockchain. The algorithm is used to validate and approve new transactions. For example, if person A transfers some Bitcoins to Person BI before this transaction can be approved and Bitcoin can be transferred from Person A to Person B, the transaction must be validated and approved by the nodes. In the case of Bitcoin, it uses the Proof of Work (PoW) consensus algorithm to validate a transaction.

Some of the popular blockchain consensus algorithms are Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof of Stake (DPoS), Proof of Authority (PoA), Proof of Elapsed Time (PoET), Practical Byzantine Fault Tolerance (PBFT), Simplified Byzantine Fault Tolerance (SBFT), Delegated Byzantine Fault Tolerance (DBFT), Proof of Importance (PoI), Proof of Capacity (PoC), Proof of Burn (PoB), and Proof of Weight (PoWeight).

The purpose of each of these consensus algorithms is different and different blockchains may use different algorithms. A blockchain may also use more than one algorithm for a different purposes. For example, Stratis Blockchain uses Proof of Stake (PoS) and Proof of Authority (PoA) algorithms.

Industries using blockchain

We just saw what blockchain has to offer but not every project needs a blockchain. Blockchain has its own use cases and pros and cons. Some people think of blockchain to secure a database but that is not a good use case of a blockchain. So, how do we know if your project may use a blockchain?

Blockchain technology is growing and increasing its footprint in various industries including the following:

  1. Cryptocurrency
  2. Healthcare
  3. Supply chain
  4. Banking and financial
  5. Automotive
  6. Government
  7. Insurance
  8. Media and entertainment
  9. Retail and consumer goods
  10. Travel and transportation
  11. Manufacturing

Public blockchain versus private blockchain

Public blockchains are the most common blockchains. A public blockchain does not have any restrictions on who can use them. Anyone can download them and start running nodes on their machines and start validating blocks. A public blockchain often has a reward associated with validators. Some common examples of public blockchains are Bitcoin, Ethereum, and Stratis. A public blockchain is also known as a permissionless blockchain. A public blockchain is run by the public and data can be stored on any machine run by any individual or organization anywhere in the world. For example, Bitcoin has tens of thousands of nodes running all over the world.

A private blockchain on the other hand is a blockchain that allows selected validators to run and validate blocks. Private blockchains are good for private businesses and companies who do not want to have their data stored on public computers.

A permissioned blockchain is a blockchain that is public but the validators must be approved by an authority before they can start running validator nodes. A majority of cryptocurrency-based blockchains are either permissionless or permissioned.

What is the future of Blockchain

Blockchain use cases and applications are just starting and each year, we are seeing more and more use cases developed using blockchain. More and more industries are adopting blockchain each year. Some of the use cases of blockchain that have exploded in the year 2021 include Cryptocurrencies, Smart Contracts, NFTs, DeFi, ICOs/STOs.

Blockchain growth is yet to come and there are going to be more applications in coming times. Check out this article to learn more,

There are plenty of jobs in the Blockchain industry. Here is an article on blockchain jobs,

How to get started with Blockchain

If you are a software developer and want to learn blockchain, there are plenty of tutorials and learning materials available. As a software product, not all blockchains serves the same purpose. You will also have to know a programming language that is supported by a blockchain. Here is the good news. Most of the blockchains are public and open source. That means you can download the blockchain projects, learn from them, and even get involved in some of them.

One of the simplest and most popular use cases of blockchain is smart contracts. Ethereum blockchain is the most popular blockchain to writing and storing smart contracts. However, Ethereum uses its own programming language, Solidity. Check out Top 5 Blockchain Programming Languages.

For C# and .NET developers, Stratis is a blockchain that is written in native .NET and smart contracts are written in C#. Here is a good tutorial to start learning blockchain and write your first, Hello World smart contract application using C# and .NET.

Summary

This article is a basic introduction to blockchain and explains various concepts of blockchain. Here we learned what blockchain is and how it works and what we can do with blockchain. We also learned how to get started with blockchain.