Blockchain Technology
Master the basics of Blockchain Technology and understand how it is ruling the world!
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?
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.
๐ฉ 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.
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? ๐ค
- 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 ๐คฉ :
- Cryptographic Algorithms ๐ฉโ๐ป
- A distributed ledger peer-to-peer network ๐
- 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.
๐ฉ Now, let's take an example. Here we have a chain๐ of 3 blocks ๐จ .
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 ๐ฉ .
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 ๐ฏ:
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)