AI Probably
AI Probably's Blog

AI Probably's Blog

Blockchain Technology

Blockchain Technology

Master the basics of Blockchain Technology and understand how it is ruling the world!

AI Probably's photo
AI Probably
ยทFeb 21, 2022ยท

7 min read

Imagine ๐Ÿ’ญ that you are in your favorite fashion store ๐Ÿช , and you scan the QR code for the dress ๐Ÿ‘— you want to buy ๐Ÿ’ต . As soon as you scan the code, you can view all the details about where the fabric was cleaned, colored, woven, designed, etc. What if you could also track supply and distribution ๐Ÿšš to figure out how it was delivered, how long ๐Ÿ•‘๐Ÿ“… it took to get to the store, and so on? fashion store.png

Could there be a technology ๐Ÿ‘ฉโ€๐Ÿ’ป that can assist in recording data ๐Ÿงพ at each step and making that data clearly available to all? ๐ŸŒ

Welcome to the Blockchain universe! ๐Ÿ™Œ

Today, each transaction ๐Ÿ’ฒ performed is recorded in a book ๐Ÿ“•, ledger, spreadsheet, or database. However, this transaction is private and centralized. Blockchain offers a growing list of records ๐Ÿ“š at each step of the transaction linked ๐Ÿ”— among themselves as nodes and is decentralized and open to all ๐ŸŒ . Blockchain technology combines public transparency with privacy protection to create a single data platform.

Blockchain.png

๐Ÿšฉ Let us see the definition of Blockchain,

Blockchain is a distributed ๐ŸŒ, decentralized peer-to-peer ledger (record of transactions) that is duplicated across numerous nodes (computers) ๐Ÿ’ป in a network, allowing data about any event or transaction ๐Ÿ”ƒ to be recorded in real-time ๐Ÿ•‘๐Ÿ“… . It is a chain ๐Ÿ”—(nodes) made up of blocks ๐ŸŸฅ that are used to record digital assets ๐Ÿ”ข with the help of a secure algorithm ๐Ÿ‘ฉโ€๐Ÿ’ป. By design, blockchains are immutable and immune to the modification of data.

Blockchain (3).png

This network ๐ŸŒ of computers ๐Ÿ’ป manages the Blockchain without the use of a hierarchy ๐Ÿ”บ. Blockchain networks are commonly referred to as peer-to-peer networks because of their flat architecture.

These computers ๐Ÿ’ป check each transaction ๐Ÿ”ƒ individually before adding them to a 'block' ๐ŸŸฅ of data. These blocks are then uploaded to the Blockchain and downloaded to each machine ๐Ÿ’ป.

Dissecting the word BLOCKCHAIN

Block ๐ŸŸฅ

Like a page ๐Ÿ“„ in a record book ๐Ÿ“•, each block stores a number of transactions. Each block is connected to one before and after it.

Chain ๐Ÿ”—

Hashes โ€“ sequences of numbers ๐Ÿ”ข and characters โ€” are used to record these transactions. Each transaction's hash is created using the previous transactionโ€™s hash. This generates a chain effect ๐Ÿ”—, making it impossible to modify the order of hashes. As a result, once a transaction has been added, it cannot be changed.

What distinguishes a Blockchain ledger from a database? Isn't it the same thing when it comes to capturing, organizing, monitoring, and regulating data? ๐Ÿค” centralized vs decentralized.png

  • Hashes of the transactions ๐Ÿ”ƒ are transparent to all the nodes in the network ๐ŸŒ .
  • Blocks have specific storage ๐Ÿ’พ capacities and, when filled, are closed and linked ๐Ÿ”— to the previously filled block ๐ŸŸช.
  • A central authority, a firm, or a government organization ๐Ÿข owns databases. On the other hand, Blockchain is a peer-to-peer network, where one node may communicate with any other node ๐Ÿ–ฅ .

Terminologies used in Blockchain

๐Ÿšฉ Let us familiarize ourselves with important terms before digging deep into the Blockchain.

Ledger

Payments ๐Ÿ’ต, supply chain details, health records ๐Ÿงพ, real estate contracts ๐Ÿฌ, and other transactions are all recorded in a book(digitally) ๐Ÿ’ป.

SHA-256

SHA-256 is a cryptographic algorithm ๐Ÿ‘ฉโ€๐Ÿ’ป that accepts any input length and gives an output of 256-bit or 64-character hash. SHA-256 hashing algorithm assures that the original information cannot be deduced from the hash output, making it very safe ๐Ÿคฉ.

Hash

A hash is a shortened digital signature of the data. Hashes are sent over a public network ๐ŸŒ. Each block ๐ŸŸจ uses a hash function to refer to the previous block ๐Ÿ”—.

Mining

Mining โ› on the Blockchain is a means of verifying each transaction ๐Ÿ”ƒ stage. Blockchain miners ๐Ÿ‘ฉโ€๐Ÿญ are the individuals ๐Ÿ‘จโ€๐Ÿญ involved in this process. Before adding new a new block, all miners need to solve complex mathematical problems ๐Ÿ”ข to calculate hashes. The miner receives a reward ๐Ÿ’ฐ as a cryptocurrency(bitcoin) and the transactions are added to the Blockchain once the miner's solution has been confirmed โœ”.

Node

Any computer ๐Ÿ’ป that is part of a peer-to-peer network and maintains a copy of the Blockchain is referred to as a node in a blockchain.

Merkle Tree

Merkle tree, also known as "hash binary tree," is a data structure that is used for storing transactions ๐Ÿ”ƒ on a blockchain efficiently.

Decentralization

Decentralization in the Blockchain is the transfer of control of any activity to a distributed network ๐ŸŒ, unlike a centralized organization that has full control over your activities.

Benefits of Decentralization ๐Ÿคฉ :

  • In the form of a distributed ledger, each network member owns a copy of the same data ๐Ÿ“•.

  • Companies ๐Ÿข frequently share information with their partners ๐Ÿค. Each time data is modified, the possibility of data loss or inaccurate data entering the workstream increases ๐Ÿคฏ. Thanks to decentralized data storage ๐Ÿค— , every entity has access to a real-time ๐Ÿ•‘๐Ÿ“… , shared view of data.

  • Decentralization can help mitigate sources of vulnerability in systems where there might be an excess of dependence on explicit workers ๐Ÿ‘จโ€๐Ÿญ.

  • Decentralization may also aid in resource distribution optimization, ensuring that promised services are delivered with improved performance ๐Ÿ’ฏ and consistency โœ” .

How does a Blockchain work ๐Ÿค”

The purpose of Blockchain is to make digital information ๐Ÿ’พ accessible by allowing it to be recorded and shared but not altered.

Blockchain technology is a combination of three cutting-edge technologies ๐Ÿคฉ :

  1. Cryptographic Algorithms ๐Ÿ‘ฉโ€๐Ÿ’ป
  2. A distributed ledger peer-to-peer network ๐ŸŒ
  3. A mechanism for keeping network transactions and records on a computer ๐Ÿ’ป

Each block contains some data, the hash of the block, and the hash of the previous block.

  • DATA: It depends on the type of blockchain, for instance, a bitcoin.
  • HASH: You can compare a hash to a fingerprint. It identifies a block ๐ŸŸฅ and is always unique. Once a block is created, its hash is calculated ๐Ÿ”ข. Changing something inside the block will cause the hash to change.
  • HASH OF PREVIOUS BLOCK: This hash is used while calculating the hash of the current block which effectively creates a chain ๐Ÿ”— of blocks. Block).png

๐Ÿšฉ Now, let's take an example. Here we have a chain๐Ÿ”— of 3 blocks ๐ŸŸจ .

blockchain.png

Let's assume you've tampered โŒ with the second block ๐ŸŸง, which will change the hash of the block. As a result, block three and all subsequent blocks will be invalid โŒ since they will no longer retain a valid hash of the previous block. As a result, altering a single block invalidates all subsequent blocks ๐Ÿ˜ฎ .

To make your Blockchain legitimate โœ” again, you will have to recalculate ๐Ÿ”ข all the hashes of other blocks. These days, computers are extremely fast โšก, capable of calculating hundreds of thousands of hashes per second ๐Ÿ•‘ . This indicates that hashes alone are insufficient to prevent tampering ๐Ÿ˜ .

To counteract this, Blockchains employ a mechanism โš™ known as Proof-Of-Work. It's a method that increases the duration ๐Ÿ•‘ of rebuilding blocks. This approach makes tampering with the blocks extremely difficult ๐Ÿคฏ because if you tamper with one block, you'll have to recalculate the Proof-Of-Work for all subsequent blocks. As a result, a Blockchain's security is derived from its innovative hashing and the proof-of-work process ๐Ÿ’ฏ .

Since Blockchain is a peer-to-peer network ๐ŸŒ, when someone joins this network, they get the full copy of the Blockchain.

๐Ÿšฉ Now let's see what happens when someone creates a new block ๐ŸŸฉ .

proof of work (7).png

Everyone on the network receives ๐ŸŒ the new block ๐ŸŸฉ . Each node then verifies โœ” the block to ensure that it hasn't been tampered โŒ, and uploads the block to each node ๐Ÿ–ฅ. All the nodes in this network create consensus ๐Ÿค. They agree about which blocks are valid and which aren't.

Blocks that have been tampered with will be rejected โŒ by the network's other nodes. To effectively tamper with a Blockchain, you'll need to tamper with all of the chain's blocks, redo each block's proof-of-work, and gain control of more than half of the peer-to-peer network. Then and only then will your modified block be acknowledged by the rest of the world. This is nearly difficult to accomplish! ๐Ÿ˜Ž

HEREโ€™S A SUMMARY OF HOW BLOCKCHAIN WORKS ๐Ÿ’ฏ:

blockchain working.gif

Conclusion โœจ

Blockchain is a very advanced technology ๐Ÿ’ฏ that provides efficient verification โœ”, regulation, transparency, and traceability of data ๐Ÿ“„ . This technology can also be easily integrated with Big Data ๐Ÿ“š . Blockchain solutions can also help cut costs ๐Ÿ’ต and eventually make many services more competitive.

Author of the blog:

Mohammad Amaan (Campus Chapter Guru - AI Probably)

ย 
Share this