What is Blockchain and how does it work
Tags: blockchain, ethereum, nft, cryptocurrency
Published: 2022-04-03 14:06:15

---
title: What is Blockchain and how does it work
published: true
date: 2022-03-06 18:42:30 UTC
tags: #blockchain, #ethereum, #nft, #cryptocurrency
canonical_url: https://jamesmiller.blog/what-is-blockchain-and-how-does-it-work/
---

![Header Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppycsf587ycu4svr8ty8.jpg)

Blockchain is another buzzword that keeps coming up, some people say it is amazing and others think it is pretty unnecessary.

I think it has a very exciting role to play in the future of the internet, but as with all technologies it isn’t the answer to everything.

In this blog post, I hope to provide an oversimplified answer to a question I often get asked: ‘what is Blockchain?’ and how does it work?.

As a note:

- I’ll be using the Ethereum implementation of Blockchain as the basis for a lot of what I'll be referring to - but the core concepts of what I talk about will hold true for the technology as a whole.
- I’ll be oversimplifying these concepts, to hopefully give you a base understanding of the technology - that you can then choose to grow on and learn the underlying technical nuances - based on your interests.

### TL;DR

- A Blockchain is a database that is decentralised over a large peer-to-peer network of computers.
- The computers on the network run a consensus algorithm, which is the process that enables the blockchain to validate and store data.
- The Blockchain issues tokens (also known as crypto-currencies), that are used to reward & incentivise the owners of the computers.
- These crypto currencies can be exchanged for traditional currencies (e.g £/$).
- Users interact with Blockchain apps with a ‘Crypto Wallet’, that identifies them on the network and allows them to make transactions using the crypto currencies as payment.
- Transactions between users are co-ordinated through Smart Contracts, the ‘Back End’ code which is readable for anyone on the network to see and understand exactly how data and payments are managed.
- The usefulness of Blockchain is highly debated, a core argument for the technology, is that it can enforce organisations, companies and governments to act with integrity through financial incentive.
- Some benefits to the users who interact with the Blockchain is that the technology enables them to: 1. own their data, 2. make money and earn royalties from content they produce and 3. trust the data that is on web platforms understand the manner of how the application uses/manages that data

### Summarising Blockchain

‘Blockchain’ can be a pretty confusing concept to understand, so lets break it down bit-by-bit.

I’ve **emboldened** the key parts ;)

#### What actually is a Blockchain?

**A Blockchain is a decentralised database** that runs on peer-to-peer network of computers, which validate and store transactions between addresses in a ledger.

#### So its a database, what makes it special?

Traditional databases require a centralised authority to validate the data and manage permissions of who can write to/read from the database, examples of these centralised authorities are the big companies/brands we use every day.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596930994/x8lMnaDhI.png)

**Blockchain** does not require a centralised authority to validate data or manage permissions, this responsibility **is** distributed amongst **a network of computers that work together to achieve consensus**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596932367/FCJdHxiEo.png)

#### What is the value of consensus?

Historically, people have outsourced trust to institutions, organisations, companies and governments, that achieve consensus and make decisions on their behalf.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596933588/brv1l0ZCE.png)

The processes that enable these decisions often happen behind closed doors and results can often be controversial, examples of this are scandals related to banking/government/big tech companies.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596934871/8pP2M5epl.png)

Consensus is at the heart of the mechanics that enable **Blockchain** technologies, it presents an alternative that **enables people to interact directly with each other in a manner that they can trust**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596936480/R3ZGER8_2.png)

#### Can I trust it?

Transactions of data in the Blockchain are enabled by Smart Contracts, which are essentially custom developed backend software that is readable to anyone on the network.

This means that you could check for yourself what the actual logic is for the code that enables a transaction between you and another person (e.g on Ethereum you can read [smart contracts via Etherscan](https://etherscan.io/contractsVerified)).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596937796/M4kCJ6r0y.png)

In the world we currently live in, centralised authorities (e.g governments) can say one thing to you and do something else in practice behind the scenes.

In comparison, the network of computers that enable the blockchain, are incentivised by the rewards of the consensus algorithm, to correctly validate that these contracts are acted upon as they are programmed.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596939079/O3YSxg5D6.png)

With Blockchain, you can validate what processes a smart contract will do — by reading what is in the code that executes the transactions. You can trust that the consensus algorithm will enforce what is written.

#### Is it secure, how hackable is it?

To write data to the Blockchain, you need consensus from the computers on the network to validate that your transaction is valid.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596940335/e5nOaG3IZ.png)

The work that is put into achieving consensus between the nodes and writing the data is rewarded with tokens (e.g the transaction fees and new block creation reward).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596941654/Pt-mF8hLX.png)

This means that hacking one computer in the network to try and validate a fabricated/fraudulent transaction wouldn’t work, as this would not achieve consensus with the other computers in the network.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596943350/nXhfGAzSo.png)

This self regulation rewards nodes for correctly validating transactions and prevents invalid transactions being recorded.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596944652/7xgtaQh9U.png)

There are nuances to this process that these diagrams don’t fully explain, I think I’ll do another post detailing consensus algorithms in the future 😀.

**Once data is written to the Blockchain, it is immutable — which means it cannot be deleted.** This is because data is written into blocks, which go through a process of cryptographic hashing, that gets written into the data of the following block that gets hashed. This means that rewriting/deleting data, would essentially break the chain and the reason would be readily identified.

In comparison to a traditional database, a single computer can be hacked and data can be modified / deleted with relative ease.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596945989/iUcAkgR7F.png)

There are two instances where Blockchain could be compromised:

1. if a hacker can gain control of 51% of the computers on the network — then a hacker would essentially be able to bypass the need for consensus and rewrite data on the chain
2. if a smart contract has been written in a manner that exposes a users assets through a vulnerability, then a hacker could exploit this

#### What does the data look like?

A Blockchain stores data as a ledger of transactions between addresses, that are cryptographically stored as blocks.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596947231/nVYweiTrk.png)

A [block](https://etherscan.io/block/14243482) contains:

- The block’s number in the chain (e.g the first, second, or third block in the chain) and timestamp of when the block was created
- Information on the owner of the computer who complied with the consensus algorithm to create the block of data (the miner)
- Information on the reward to the miner for creating the block, the amount of data stored and the difficulty of the consensus algorithm
- Gas Used (the number of tokens paid by accounts who make transactions)
- Data related to the hash of the block (made up of the transactions data, nonce and hash of the previous block)
- Transactions (the list of transactions that are stored in the block)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596948459/kgOnaj9f9.png)

A [transaction](https://etherscan.io/tx/0xefe5a2058259fdb35364b57de82ba8b42f453500f0b2c2259b22045fc142f734) contains:

- A hash that is made up of the transaction data, the status of the transaction, the block it is contained within and the timestamp it was generated
- The value of the tokens that were exchanged between addresses and the fees that were paid in order to reward the miners
- Data that is being stored/sent
- The addresses of the tokens were sent to and from

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596949773/QHjojYS62.png)

An address can either be a [smart contract](https://etherscan.io/address/0x1612fc28ee0ab882ec99842cde0fc77ff0691e90) or a [crypto wallet](https://etherscan.io/address/0xea674fdde714fd979de3edf0f56aa9716b898ec8), either will have:

- Information of their balance of tokens/assets
- A list of transactions they’ve made, who the transactions were to/from, the value traded and the block it is stored in

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596951163/qnvXRYfVf.png)

A Token can be any of the following (there are also others but lets keep it simple):

- A fungible token such as [ERC-20](https://etherscan.io/token/0x1e4ede388cbc9f4b5c79681b7f94d36a11abebc9?a=0xb7ff7692eef2dde2156117bd128b66e15e35a797) which is used for trading (contains a price, total supply and number of holders)
- A non-fungible token such as [ERC-721](https://etherscan.io/nft/0xb4d06d46a8285f4ec79fd294f78a881799d8ced9/7601) is used to declare a unique asset with value (contains an owner, address, creator, content url, id and list of transactions).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1646596952536/1Srf8waxm.png)

#### What are crypto currencies and NFTs?

The concept of value in a Blockchain network is described in assets known as tokens, two you should understand are ERC-20 and ERC-721

**ERC-20 tokens are also known as**  **fungible tokens are often referred to as crypto currencies** and can be traded at crypto exchanges for fiat currencies (such as $/£/$), the value of these crypto currencies vary based on supply and demand.

The consensus algorithm of a Blockchain network enables the owners of the computers of the network to be rewarded with fungible tokens (this is what is often referred to as ‘mining’).

**ERC-721 are also tokens known as** **non-fungible tokens (NFTs)**, **that**  **are unique and are used as ways to declare the creator and owner of an asset**.

There are also other types of tokens to learn about, but this is a good place to start 🙂

#### How do I practically interact with a Blockchain?

**To interact with the blockchain you need to create a crypto wallet, purchase tokens via a crypto exchange and find an address to send tokens to.**

_Coinbase and Ethereum Logos_

One way of doing this could be to use [coinbase](https://www.coinbase.com/), to create a crypto wallet and purchase tokens from a Blockchain (e.g [Ethereum](https://ethereum.org/en/)) — then all you need to do is find a friend’s wallet address to send crypto to.

If you wanted to purchase an NFT, then you could visit [opensea](https://opensea.io/explore-collections) and use your tokens to purchase an NFT.

#### Seems like a lot of effort, is this actually useful?

🙂

There is never a golden bullet for all problems, Blockchain is a useful technology for a specific problem.

Even though blockchain is a database, the arguement isn’t “ **Blockchain vs traditional databases”, it is**  **decentralised consensus vs centralised decision making**.

The problem (places where Blockchain can help):

- We live in a world which is dominated by centralisation (banks/governments/corporations/companies/institutions), we are so reliant on them and it can be really difficult to influence what they do and actually hold them accountable for their actions.
- Consensus is achieved behind closed doors, how do you trust it is fair?
- What is said (or written) and what is actually done in the real world is not always the same, who holds this to account and do we trust this authority to do it?
- You don’t own your data or content, it could be used in ways that you cannot track and monetised without your knowledge/consent.
- It is difficult to hold organisations/individuals to account for actions that have been taken, how can you track what has been done/who owns what?
- Processes that connect these organisations/individuals together are often filled with time wasting bureaucracy and difficulty in sharing/communicating information.

The solution (ways Blockchain can help):

- Decentralise and automate parts of organisations in an appropriate manner so that they are trackable on blockchain.
- Implement a consensus algorithm that can be trusted amongst the users of a network to incentivise correct validation.
- Create Smart Contracts that reward value to individuals/organisations who practically deliver on expectations.
- Empower people to own/share/monetise their data and content, on terms they are happy with via NTFs.
- See specific transactions of data/assets/value that organisations have made and have faith this is valid.
- Incentivise speedy co-operation between organisations with smart contracts that share context relevant information and financially rewarding fast action.

### Conclusion

This might seem pretty full on and deep stuff, but this is the core argument for what Blockchain can do.

There really is a lot more to cover when it comes to this topic, I hope this post gave you enough of an understanding of the core details — so you have a base to grow on.

It really isn’t the solution to everything, personally I see Blockchain as a big shift in thinking, which is really hard to imagine how a world that embraces it fully — would look like.

I think this technology will likely grow in momentum over the years — proving value in more and more areas until it becomes less of a buzz word and more of an understood and useful tool.

… or maybe I’m wrong and this a fad that will die out in a couple of years — lets see!! xDD