DEV Community

Kɪʟʟᴜᴀ
Kɪʟʟᴜᴀ

Posted on

What is Blockchain?

Image description
Blockchain is incredibly popular nowadays. But What is Blockchain? How does it work? What problems they do solve and how can they be used?

Blockchain technology has taken the world by storm in recent years. At its core, a blockchain is a series of blocks that contain information, linked together like a chain. This concept was first described in 1991 by a group of researchers who were looking for a way to timestamp digital documents and prevent them from being altered or backdated. The idea was not widely adopted until it was later adapted by Satoshi Nakamoto to create the world's first digital cryptocurrency, Bitcoin.

A blockchain is a decentralized, distributed ledger that is open to anyone. One of the key features of this technology is that once data has been recorded on the blockchain, it is extremely difficult to change it. This makes it ideal for tracking transactions and ensuring their authenticity.

Blockchain technology has the potential to solve a wide range of problems. For example, it can be used to create secure, tamper-proof records of financial transactions, or to verify the authenticity of digital documents. It can also be used to create decentralized networks that are not controlled by any single entity, which has the potential to disrupt traditional business models and create new opportunities.

The potential uses for blockchain technology are vast and varied. As more and more people and businesses begin to explore the possibilities of this exciting new technology, we are likely to see a wide range of innovative applications and solutions that will change the way we live and work.

So, how does that works? Well, let’s take a closer look at a block-

Image description

Blockchain technology is a powerful tool that has the potential to revolutionize the way we handle data. Each block on a blockchain contains a unique set of information, as well as the hash of the block and the hash of the previous block in the chain. This creates a secure and tamper-proof record of information that cannot be altered once it has been added to the blockchain.

The data that is stored inside a block depends on the type of blockchain. For example, the Bitcoin blockchain stores information about transactions, including the sender, receiver, and the amount of coins involved. Other blockchains may store different types of information, such as contracts, digital identities, or even environmental data.

The hash of a block is like a digital fingerprint. It is a unique identifier that allows us to verify the contents of a block and ensure that it has not been altered. If even the slightest change is made to the information inside a block, the hash will be different, which makes it easy to detect tampering.

The third element inside each block is the hash of the previous block. This creates a chain of blocks that are linked together, with each block dependent on the previous one. This makes it nearly impossible to alter any information on the blockchain, as doing so would require changing the hashes of every block in the chain.

The combination of data, hashes and the linking of previous blocks makes blockchain technology a secure and reliable way to store and manage data. As the world continues to embrace this technology, we can expect to see more and more innovative uses for it in a wide range of industries.

Let’s take an example,

Image description

here we have a chain of 3 blocks. As you can see, each block has a hash and the hash of the previous block. So, block number 3 points to block number 2 and block number 2 points to block number 1. Now the first block is a bit special, it cannot point to previous blacks because it is the first one. We called this the genesis block. Now, let's say you tamper with the second block. This causes the hash of the block as well. In turn that will make blocks and all the following blocks invalid because they no longer store a valid hash of the previous block So, changing a single block will make all following blocks invalid. But using hashes is not enough to prevent tampering.

Computers these days are very fast and can calculate hundreds of thousands of hashes per second. You could effectively tamper with a block and recalculate all the hashes of other blocks to make your blockchain valid again. So, to mitigate this, blockchain has something called proof-of-work. It's a mechanism that slows down the creation of new blocks. In the Bitcoin case, it takes about 10 minutes to calculate the required proof-of-work and add a new block to the chain. This mechanism makes it very hard to tamper with the blocks because if you tamper with one block you'll need to recalculate the proof-of-work for all the following blocks as well. So, the security of a blockchain comes from its creative use of hashing and the proof-of-work mechanism.

But there is one more way that blockchains secure themself and that's by being distributed. Instead of using a central entity to manage the chain, blockchain uses a peer-to-peer network and anyone is allowed to join. When someone joins this network he gets the full copy of the blockchain. The node can use this to verify that everything is still in order.

Now let's see what happens when someone creates a new block. That new block is sent to everyone on the network. Each node then verifies the block to make sure that it hasn't been tampered with. If everything checks out, each node adds these blocks that are valid and which aren't. Blocks that are tampered with will be rejected by other nodes in the network. So, to successfully tamper with a blockchain you'll need to temper all the blocks on the chain, redo the proof-of-work for each block and take control of more than 50% of the peer-to-peer network. Only then does your tampered block become accepted by everyone else. This is almost impossible to do!

Blockchain is also constantly evolving. One of the more fascinating development is the creation of smart contracts. These contracts are simple programs that are stored on the blockchain and can be used to automatically exchange coins based on certain conditions The creation of blockchain technology peaked a lot of people's interest. Soon, others will realize the technology Can be used for various purposes.

Connect with me on LinkedIn;
Subscribe my Substack Newsletter;
Follow me on Twitter; Medium; Hashnode;
Find me on Facebook; Instagram;

Top comments (0)