paint-brush
Revisiting Blockchain Basics: Part 1—What is a Blockchain? by@ra1nbowf
261 reads

Revisiting Blockchain Basics: Part 1—What is a Blockchain?

by Ramazan ValievOctober 16th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Blockchain is an innovative technology that revolutionizes how data is stored and transactions are conducted. Unlike traditional centralized systems, blockchain is decentralized, meaning it's not controlled by a single entity, offering individuals more control over their funds and data. It's transparent and open, allowing global transactions, and its data is stored in blocks, linked together to create a secure chain. Blockchain's unique properties, such as data immutability and verifiability, make it a reliable and trustworthy system. In this article, you've been introduced to the core properties shared by all blockchains, paving the way for a deeper exploration of their applications and variations in the next installment.
featured image - Revisiting Blockchain Basics: Part 1—What is a Blockchain?
Ramazan Valiev HackerNoon profile picture

Blockchain is a very popular concept you can hear about from many different sources. It seems to be a completely new technology, but it can already be applied in many areas of life. Now we will learn what blockchain is and how it differs from traditional networks and databases.


Typically, individuals rely on traditional banks or payment systems for currency exchange. These are centralized systems where information is stored and processed on dedicated servers. However, the use of centralized networks, which are managed and maintained by a single entity, limits control over one's funds and data. These systems often require identity verification and do not offer transparent, publicly accessible transactions, making them incompatible with your style of exchange.


The blockchain network allows you to manage your funds all by yourself and make fast and cheap transfers from anywhere in the world where there is an Internet connection. Blockchain is decentralized since it is not under the control of a small group of people.


Also, unlike traditional centralized services and payment systems, the blockchain network has no restrictions on the user’s location, age, or nationality. The data is processed with the collaboration of thousands of computers worldwide.


Blockchain as a data structure

In a traditional database, information is stored in an independent order. It can be freely edited and deleted without damaging the integrity of other data. In the blockchain, the data is in blocks. The blocks are securely connected in a strict chain. The chain can be represented as a book, where new pages, in our case, blocks, are constantly added. All pages are numbered, bound together, and go in strict order, one after the other.


The data chain has two properties that ensure its reliability:

  1. It is impossible to take an already included block and rewrite it. Entries can only be made to a new block.
  2. Other community members check new entries. Therefore, scammers cannot write what they want into the book.


Next, let’s look at how these features are implemented inside the blockchain.


Blockchain Properties

Property #1. What is recorded in the blockchain cannot be overwritten

For the chain to be complete, each subsequent block must be connected to the previous one. This connection between blocks is similar to the connection between commits in GitHub. To understand this comparison, let’s look at how commits work.


When we commit, GitHub gathers data about all the file states in the repository. From this data, it calculates the unique identifier of the commit.

In this case, the commit ID is obtained not from the state of all files but from the changes that occurred from the previous commit.


Thus, the hash is obtained from the following data:


  1. links to the previous commit.

  2. a list of changes that have taken place



The identifier of the new commit is created from the data and the identifier of the previous commit


Thanks to this, the commits are tightly connected: the identifier of the new commit is obtained from the data containing the identifier of the previous one.


Identifiers make commits into a chain where each new commit is tightly connected to the previous one


This way, we can easily check the integrity of the data. To do this, you need to get a new identifier for the current commit and compare it with the original one. If the data has not changed, we will always get the same result.


Hash: a link to the block

The data in the blocks are linked by their hash identifier. A special data modification algorithm, the hashing function, is responsible for its creation.


Hashing is a function that converts a string of data of any length into a string of data of a certain length. That is, any input data is changed according to a certain algorithm. As a result, we get a unique fixed-length data string. For example, each commit has a different number of modified lines of code, but the hash length of each commit is the same.


No matter how long a string we hash, its hash will always be a fixed length



If we hash one string and get a hash, then change just any one character in the original string and hash it again, we will get a completely different hash. This is called the “avalanche effect” of the hash.


In this case, hashing the same string will always give the same result. For example, we applied a hash function to the string “example” and got a hash. If we apply the function to the string “eXample”, we will get a completely different hash, but of the same length.



Hashing even almost identical strings gives completely different results



There is no algorithm that can perform the reverse hashing operation. Therefore, the hashing function is a one-way function. But you can find the source data from the hash. To do this, hash all possible variants of the source data until the result is the right hash. However, doing this requires a huge amount of computing power and time and is considered unfeasible.

It is generally assumed that the hash is unique for almost every data set. In reality, several different datasets can have the same hash. But this is unlikely due to the huge number of hash options.


If we change one block in the blockchain, we will immediately change all the blocks that follow the changed one. That is, we will get a new chain, which will be discarded by community members.



The blockchain is inextricably linked by hashing



This mechanism allows you to quickly and unambiguously verify the integrity and reliability of any link in the chain or even the entire chain. To do this, calculate the hashes of all blocks in the plot and compare the results with the hashes in the corresponding blocks.


A chain of blocks that are strictly interconnected. Each block stores a certain number of records and the result of hashing the entire previous block. Each record that updates data in the blockchain is called a transaction.


If you replace at least one symbol in a block, the hash of this block and all subsequent blocks will change. This guarantees the integrity of the chain.


Here’s an example. Let’s take a few blocks already included in the chain and try to add a transaction to the block that was previously not in it. Since the block body has changed, therefore its hash has also changed. As a result, all hashes of subsequent blocks will change.



Changing all hashes with an extra transaction



Thanks to hashing, each transaction and each block are closely related to each other. If you try to change any data, all the hashes of subsequent blocks will completely change.


The blockchain is decentralized, and you must provide your new changeable block to all community members. Each member will independently check your block and might disagree with the changes you have included. But we’ll talk about how it works further.


Property #2. It is impossible to record false data

False data cannot be written to the blockchain because new blocks and data are checked for authenticity.


Let’s analyze how it works.


Each participant has a copy of the chain and tools for verifying the validity, such as asymmetric cryptography and proof of work. Later we will look at what it is and how it works. When one of the participants wants to add a new block, the other participants check that the data of this block does not contradict the data from their copy and that all transfers from addresses were initialized by their owners. They make sure that the data in this new block is not falsified and can be added to the blockchain. At the same time, participants do not trust one data source separately. For a block to get into the blockchain, its authenticity must be confirmed by most participants. It is important to remember that only those blocks verified for authenticity and approved by most network participants get into the blockchain.


Native currency and community members

Like any database or information system, blockchain must ensure viability and security. Someone has to keep the entire history of transfers, check transactions, and add new blocks.

You need a computer or server with special software to perform these tasks. It exchanges information with many of the same devices and forms a network.


For example, a computer can become a network node that communicates with all other devices on the network. It can synchronize with the entire network and store the full history of the blockchain, starting from the first block.


Such a computer is called a full node. Full — because it stores the entire history of transactions and blocks. There are different nodes with different functions. For example, storing the entire blockchain, adding new blocks, and verifying transactions. But to use the blockchain, installing a node at home is not necessary. For this purpose, a user node that performs minimal load is suitable. It is enough to work with personal transactions and addresses. It is called the light client and is usually presented as a wallet of digital assets.


It is not entirely clear what the motivation of users is to install special software and spend resources and time to run a node. Besides enthusiasm… You can only have a light client, which does not require anything.


But if you are an enthusiast, then…


The blockchain has a mechanism for encouraging community members who ensure the operability and security of the blockchain network.


For the blockchain to be decentralized, anyone has the opportunity to install a node and become a participant in the life of the network. To implement this, the source code contains a special mechanism for rewarding those who support the efficiency and security of the blockchain.


Blockchains and their general characteristics

There are a lot of blockchain networks. Among the most popular are Bitcoin, Ethereum, Binance Smart Chain, Solana, Cosmos, Polkadot, and Avalanche. They all differ in many ways but also have some common properties.


First, let’s look at what all blockchains have in common:


  • Irreversible transactions — if you have made a transfer or other action in the blockchain, it is impossible to simply cancel it.
  • Transparency — users can view any block or transaction initialized in the public blockchain.
  • Decentralization — blockchain is a structure in which changes occur only with the consent of the majority of community members. No one can make decisions about anything alone.
  • Open access — there are no conditions to become a community member or developer. Anyone can access the technology.
  • Distribution — each participant has a copy of the blockchain. They can exchange new data with other users, and only after verification by the majority will they be valid.
  • Verifiability — any data stored in the blockchain can be verified for authenticity. That is, you can easily find out if something has been changed.


These are the main blockchain properties, but not the only ones. There are many use cases for blockchain technology, and it is essential to look at the differences between networks in detail.



In the next article, I will go into more detail about the differences between the different blockchains