Unit-1
Unit-1
Unit-1
What is Blockchain?
A blockchain is a constantly growing ledger which keeps a permanent record of all the
transactions that have taken place in a secure, chronological, and immutable way.
A blockchain is a chain of blocks which contain information. Each block records all of the recent
transactions, and once completed goes into the blockchain as a permanent database. Each time a
block gets completed, a new block is generated.
Note: A blockchain can be used for the secure transfer of money, property, contracts, etc.
without requiring a third-party intermediary like bank or government. Blockchain is a software
protocol, but it could not be run without the Internet (like SMTP used in email).
Who uses the blockchain?
Blockchain technology can be integrated into multiple areas. The primary use of blockchains is
as a distributed ledger for cryptocurrencies. It shows great promise across a wide range of
business applications like Banking, Finance, Government, Healthcare, Insurance, Media and
Entertainment, Retail, etc.
Need of Blockchain
o Time reduction: In the financial industry, blockchain can allow the quicker settlement of
trades. It does not take a lengthy process for verification, settlement, and clearance. It is
because of a single version of agreed-upon data available between all stakeholders.
o Unchangeable transactions: Blockchain register transactions in a chronological order
which certifies the unalterability of all operations, means when a new block is added to
the chain of ledgers, it cannot be removed or modified.
o Reliability: Blockchain certifies and verifies the identities of each interested parties. This
removes double records, reducing rates and accelerates transactions.
o Security: Blockchain uses very advanced cryptography to make sure that the information
is locked inside the blockchain. It uses Distributed Ledger Technology where each party
holds a copy of the original chain, so the system remains operative, even the large
number of other nodes fall.
o Collaboration: It allows each party to transact directly with each other without requiring
a third-party intermediary.
o Decentralized: It is decentralized because there is no central authority supervising
anything. There are standards rules on how every node exchanges the blockchain
information. This method ensures that all transactions are validated, and all valid
transactions are added one by one.
Why Blockchain?
o
o Note: The data is recorded in chronological order. Also, once the data is recorded, it
cannot be changed.
Here's a list of key benefits you can expect to achieve when adopting Blockchain technology into
your business:
It is an immutable public digital ledger, which means when a transaction is recorded, it cannot
be modified
Several industries like Unilever, Walmart, Visa, etc. use blockchain technology and have gained
benefits in transparency, security, and traceability. Considering the benefits blockchain offers, it
will revolutionize and redefine many sectors.
Here are the top 5 prominent industries that will be disrupted by blockchain technology in the
near future:
1. Banking
2. Cyber Security
4. Healthcare
5. Government
1. Banking
Before Blockchain
Banking has transfer fees, which can be both expensive and time-consuming for people. Also,
sending money overseas becomes even more difficult due to the exchange rate and other hidden
costs.
After Blockchain
Blockchain eliminates the need for a middleman. Blockchain is disrupting the banking system by
providing a peer-to-peer payment system with the highest security and low fees.
Blockchain technology provides instant and borderless payments across the globe
Cryptocurrencies (like Ethereum, bitcoin) remove the requirement for a third party to perform
transactions
Blockchain records all the transactions in a public ledger which is globally accessible by
bitcoin users
With this application, cryptocurrency users can save, send and receive their digital money on
their electronic devices
2. Cyber Security
Before Blockchain
Earlier, cyberattacks were a significant threat to the public. Several organizations were
developing an effective solution to secure the data against unauthorized access and tampering.
After Blockchain
Blockchain quickly identifies malicious attack due to the peer-to-peer connections where data
cannot be tampered with
Every single piece of data stored on the blockchain network is verified and encrypted using
a cryptographic algorithm
By eliminating the centralized system, blockchain provides a transparent and secure way of
recording transactions (without disclosing your private information to anyone)
For example, a software security company called Guardtime offers blockchain-based products
and services.
Rather than following the centralized system, the company utilizes blockchain technology and
distributes data to its nodes.
Before Blockchain
Due to the lack of transparency, supply chain management often had its challenges like service
redundancy, lack of coordination between various departments, and lack of reliability.
After Blockchain
Tracking of a product can be done with blockchain technology, by facilitating traceability across
the entire Supply chain.
Blockchain gives the facility to verify and audit transactions by multiple supply chain partners
involved in the supply chain management system.
With blockchain, anyone can verify the authenticity or status of a product being delivered
Here, blockchain supply chain management provides a step-by-step verification process to track
tuna fish. The process results in preventing illegal fishing.
4. Healthcare
Before Blockchain
In the healthcare system, patients can connect to other hospitals and collect their medical data
immediately. Apart from the delay, there are high data corruption chances since the information
is stored in a physical memory system.
After Blockchain
Here, each block is linked to another block and distributed across the computer node. This
becomes difficult for a hacker to corrupt the data
For example, United Healthcare is an American healthcare company that has enhanced its
privacy, security, and medical records' interoperability using Blockchain.
5. Government
Before Blockchain
Rigged votes is an illegal activity that occurs during most traditional voting systems. Also,
citizens who want to vote to wait a little longer in a queue and cast their votes to a local
authority, which is a very time-consuming process.
After Blockchain
Voters are allowed to vote without the need of disclosing their identity in public
The votes are counted with high accuracy by the officials knowing that each ID can be
attributed to just one vote
As soon the vote is added to the public ledger, the information can never be erased
Its scope includes a wide range of applications in various industries, including finance,
healthcare, supply chain management, and more.
The importance of block chain lies in its ability to provide security, transparency, and
efficiency in digital transactions, while eliminating the need for intermediaries. It can
improve trust, reduce costs, and streamline processes, leading to increased productivity
and better outcomes for businesses and individuals alike. Additionally, block chain
technology has the potential to enable new business models and disrupt traditional
industries.
Types of Blockchain
There are 4 types of blockchain:
Public Blockchain.
Private Blockchain.
Hybrid Blockchain.
Consortium Blockchain.
Types of Blockchain
1. Public Blockchain
These blockchains are completely open to following the idea of decentralization. They don’t
have any restrictions, anyone having a computer and internet can participate in the network.
As the name is public this blockchain is open to the public, which means it is not owned
by anyone.
Anyone having internet and a computer with good hardware can participate in this public
blockchain.
All the computer in the network hold the copy of other nodes or block present in the
network
In this public blockchain, we can also perform verification of transactions or records
Advantages:
1. Trustable: There are algorithms to detect no fraud. Participants need not worry about the
other nodes in the network
2. Secure: This blockchain is large in size as it is open to the public. In a large size, there is
greater distribution of records
3. Anonymous Nature: It is a secure platform to make your transaction properly at the same
time, you are not required to reveal your name and identity in order to participate.
4. Decentralized: There is no single platform that maintains the network, instead every user
has a copy of the ledger.
Disadvantages:
Processing: The rate of the transaction process is very slow, due to its large size.
Verification of each node is a very time-consuming process.
Energy Consumption: Proof of work is high energy-consuming. It requires good
computer hardware to participate in the network
Acceptance: No central authority is there so governments are facing the issue to
implement the technology faster.
Use Cases: Public Blockchain is secured with proof of work or proof of stake they can be
used to displace traditional financial systems. The more advanced side of this blockchain
is the smart contract that enabled this blockchain to support decentralization. Examples of
public blockchain are Bitcoin, Ethereum.
2. Private Blockchain
These blockchains are not as decentralized as the public blockchain only selected nodes can
participate in the process, making it more secure than the others.
These are not as open as a public blockchain.
They are open to some authorized users only.
These blockchains are operated in a closed network.
In this few people are allowed to participate in a network within a company/organization.
Advantages:
Speed: The rate of the transaction is high, due to its small size. Verification of each node is
less time-consuming.
Scalability: We can modify the scalability. The size of the network can be decided manually.
Privacy: It has increased the level of privacy for confidentiality reasons as the businesses
required.
Balanced: It is more balanced as only some user has the access to the transaction which
improves the performance of the network.
Disadvantages:
Security- The number of nodes in this type is limited so chances of manipulation are there.
These blockchains are more vulnerable.
Centralized- Trust building is one of the main disadvantages due to its central nature.
Organizations can use this for malpractices.
Count- Since there are few nodes if nodes go offline the entire system of blockchain can be
endangered.
Use Cases: With proper security and maintenance, this blockchain is a great asset to secure
information without exposing it to the public eye. Therefore companies use them for internal
auditing, voting, and asset management. An example of private blockchains is Hyperledger,
Corda.
3. Hybrid Blockchain
It is the mixed content of the private and public blockchain, where some part is controlled by
some organization and other makes are made visible as a public blockchain.
It is a combination of both public and private blockchain.
Permission-based and permissionless systems are used.
User access information via smart contracts
Even a primary entity owns a hybrid blockchain it cannot alter the transaction
Advantages:
Ecosystem: Most advantageous thing about this blockchain is its hybrid nature. It cannot be
hacked as 51% of users don’t have access to the network
Cost: Transactions are cheap as only a few nodes verify the transaction. All the nodes don’t
carry the verification hence less computational cost.
Architecture: It is highly customizable and still maintains integrity, security, and
transparency.
Operations: It can choose the participants in the blockchain and decide which transaction
can be made public.
Disadvantages:
Efficiency: Not everyone is in the position to implement a hybrid Blockchain. The
organization also faces some difficulty in terms of efficiency in maintenance.
Transparency: There is a possibility that someone can hide information from the user. If
someone wants to get access through a hybrid blockchain it depends on the organization
whether they will give or not.
Ecosystem: Due to its closed ecosystem this blockchain lacks the incentives for network
participation.
Use Case: It provides a greater solution to the health care industry, government, real estate, and
financial companies. It provides a remedy where data is to be accessed publicly but needs to be
shielded privately. Examples of Hybrid Blockchain are Ripple network and XRP token.
4. Consortium Blockchain
It is a creative approach that solves the needs of the organization. This blockchain validates the
transaction and also initiates or receives transactions.
Also known as Federated Blockchain.
This is an innovative method to solve the organization’s needs.
Some part is public and some part is private.
In this type, more than one organization manages the blockchain.
Advantages:
Speed: A limited number of users make verification fast. The high speed makes this more
usable for organizations.
Authority: Multiple organizations can take part and make it decentralized at every level.
Decentralized authority, makes it more secure.
Privacy: The information of the checked blocks is unknown to the public view. but any
member belonging to the blockchain can access it.
Flexible: There is much divergence in the flexibility of the blockchain. Since it is not a very
large decision can be taken faster.
Disadvantages:
Approval: All the members approve the protocol making it less flexible. Since one or more
organizations are involved there can be differences in the vision of interest.
Transparency: It can be hacked if the organization becomes corrupt. Organizations may
hide information from the users.
Vulnerability: If few nodes are getting compromised there is a greater chance of
vulnerability in this blockchain
Use Cases: It has high potential in businesses, banks, and other payment processors. Food
tracking of the organizations frequently collaborates with their sectors making it a federated
solution ideal for their use. Examples of consortium Blockchain are Tendermint and Multichain.
There are many blockchain platforms, each with its own unique features and use cases.
Some of the most well-known blockchain platforms include Bitcoin, Ethereum, Ripple,
Litecoin, and Stellar. Other notable blockchain platforms include EOS, Cardano, Tron,
and Binance Smart Chain.
Each of these platforms has its own unique consensus mechanisms, programming
languages, and smart contract capabilities, making them suited for different types of
decentralized applications and use cases.
What are Miners?
Miners are an essential part of the blockchain network. They are responsible for verifying
transactions and adding them to the blockchain. Miners use powerful computers to solve
complex mathematical problems that allow them to validate transactions.
In order to add a transaction to the blockchain, a miner must first verify that the
transaction is valid. This involves checking that the sender has enough funds to complete
the transaction and that the transaction has not already been recorded on the blockchain.
Miners play a crucial role in the blockchain ecosystem. Without miners, the blockchain would
not be able to function. Here are some of the reasons why miners are so important:
Security
One of the key benefits of blockchain technology is its security. The blockchain is designed to be
tamper-proof, meaning that once a transaction is recorded on the blockchain, it cannot be altered
or deleted.
Miners help to maintain the security of the blockchain by verifying transactions and adding them
to the ledger. This ensures that the ledger remains accurate and up-to-date, and that fraudulent
transactions are not recorded.
Decentralization
Another important aspect of the blockchain is its decentralized nature. Unlike traditional
centralized systems, where a single entity controls the data, the blockchain is maintained by a
network of nodes that work together to ensure the integrity of the ledger.
Miners play a key role in maintaining the decentralization of the blockchain. Because mining is
open to anyone with the right equipment, it ensures that no single entity has control over the
network.
Incentivization
Finally, miners are incentivized to maintain the security and decentralization of the blockchain
through a reward system. When a miner successfully adds a block to the blockchain, they are
rewarded with a certain amount of cryptocurrency.
This reward system encourages miners to continue to validate transactions and add them to the
blockchain. It also ensures that the blockchain remains secure and decentralized, as miners have
a financial incentive to act in the best interests of the network.
What is a nonce?
The word nonce is short for 'number used only once.' It may sound like a simple concept, but
its use cases range from small transactions to space stations. In finance and cryptography, a
nonce refers to a randomly generated number, and it is used to verify transactions or perform
security checks.
For example, the captchas we often find on websites are nonces (albeit with letters included)
as they are used just once. In a much simpler case, even the OTPs sent to verify transactions
are nonces that have the singular use of verifying something for a limited period of time.
The process of competing against each other is called mining. As soon as miners
successfully created a valid block, he gets rewarded. The most famous application of
Proof of Work(PoW) is Bitcoin.
Producing proof of work can be a random process with low probability. In this, a lot
of trial and error is required before a valid proof of work is generated. The main
working principle of proof of work is a mathematical puzzle which can easily prove the
solution. Proof of work can be implemented in a blockchain by the Hashcash proof of
work system.
In the below image, you can see that this block is composed of a block number, data
field, cryptographic hash associated with it and a nonce. The nonce is responsible for
making the block valid.
In the puzzle game, bitcoin software creates a challenge, and there is a game begins. This game
involves all miners competing against each other to solve the challenges, and this challenge will
take approximately 10 minutes to be completed. Every single miner starts trying to find the
solution to that one Nonce that will satisfy the hash for the block. At some specific point, one of
those miners in the global community with higher speed and great hardware specs will solve the
cryptography challenge and be the winner of the game. Now, the rest of the community will start
verifying that block which is mined by the winner. If the nonce is correct, it will end up with the
new block that will be added to the blockchain. The concept of generating a block provides a
clear explanation of proof of work(PoW).
Blockchain technology is mostly about the transactions that we make digitally for ourselves.
Eventually, these transactions make their way to the various blocks that become part of the
Blockchain later on. So, it is important to understand the transaction life cycle in Blockchain
technology.
This lifecycle follows the journey of a single transaction as it makes its way through each stage
in the process of joining the blockchain. Transaction in simple words is the process of sending
money by the sender and the receiver receiving it. The Blockchain transaction is also quite
similar, but it is made digitally.
Let us understand the various stages in a blockchain transaction life cycle with the help of an
example.
Sourav and Suraj are two Bitcoin users. Sourav wants to send 1 bitcoin to Suraj.
1. First, Sourav gets Suraj’s wallet address (a wallet in the blockchain is a digital
wallet that allows users to manage their transactions). Using this information, he
creates a new transaction for 1 bitcoins from his wallet and includes a transaction
fee of 0.003 bitcoin.
2. Next, he verifies the information and sends the transaction. Each transaction that is
initiated is signed by a digital signature of the sender that is basically the private
key of the sender. This is done in order to make the transaction more secure and to
prevent any fraud.
3. Sourav’s wallet then starts the transaction signing algorithm which signs his
transaction using his private key.
4. The transaction is now broadcasted to the memory pool within the network.
5. This transaction is eventually accepted by the miners. These miners, group this
transaction into a block, find the Proof of Work, and assign this block a hash
value to be mapped into the blockchain.
6. This block is now placed on the Blockchain.
7. As this block gains confirmation, it is accepted as a valid transaction in the network.
8. Once this transaction is accepted, Suraj finally gets his bitcoin.
The below diagram is a pictorial representation of the various stages in a transaction life cycle
as discussed above.
Creation Of Block
To create a new block, miners must go through a process to solve a math problem. When finding
a valid solution for the network, a new block can be taken for granted that will be added to the
blockchain by consensus. And for which, the miner who found the solution, will receive a reward
for the new block. This reward is known as the block reward.
A new Bitcoin block is generated approximately every 10 minutes. So every time one is
found, it means the start of mining for another. Since these are mathematically related or chained
together. But let's see in more detail how this process is performed:
In the formation of this new block, a header must be included that contains the hash from the
previous block, the merkle root and data for mining competition. I mean, the timestamp, the
objective of the algorithm of PoW for that block (the bits), the software version and the nuncio.
The solution miners must find is known as hash. This function is very difficult to find, but once
found, it is easy to verify by others. nodes.. So that they can verify that the output hash comply
with the established system conditions.
To find a valid output hash, the miners perform the mathematical calculations repetitively over
and over again using a nuncio. Which is a random number that they use and constantly change
until they find an output signature or hash that is valid based on the condition. There is no way to
predict which nonce will solve the problem, so they must use as many as necessary. And we are
talking about billions of values! Incredible, right?
In the case of the Bitcoin network, the system determines that the output hash must contain a
certain number of zeros at the beginning of the hash.
At this time, as long as the 21 million bitcoins have not been issued, the miner receives the
reward established for mining, putting new bitcoins into circulation. This is registered on its own
node, the other nodes on the network will do so in the next step.
In addition, regardless of whether all the bitcoins have been issued or not, the miner also receives
all the mining commissions that users have put in the transactions that make up this block.
Here also the proof of work is confirmed, that is, the computational power spent to find the
solution, and it is noted that the miner who discovered the block can effectively make use of the
recently received bitcoins.
This is why we know this technology as a chain of blocks or blockchain. Then, by the time the
miner gets a valid hash, another number of new blocks may have been mined. So the output hash
of your mined block will not match the output hash of the last added block in the chain. It will be
rejected.
In addition, it is very likely that all or most of the transactions included in that block have
already been added to others. Even if you succeed in mining the block most of your included
transactions will not be able to be validated or confirmed.
Characteristics of the mined blocks
The blocks mined in the Bitcoin system must meet certain characteristics and conditions to be
considered valid. Let's see what they are:
Mined block header hash must be less than target. If it is greater, it will not be
considered as valid.
Block size must be within acceptable limits. In Bitcoin, a block must have a maximum
size of 2 MB.
La timestamp of the block should be less than two hours in the future.
The first transaction added to the block will be the coinbase transaction. That will give
the mining node the reward of the network. And there will only be one coinbase
transaction per block.
All transactions added to the block are valid.
The header of each block will contain the hash of the previous block and the block
height thereof.
All of these features are checked to confirm a block. And each mining node independently
validates new blocks following exactly the same rules. So, makes sure that no mining node
can cheat. What provides robustness and security to the network. Once the block is validated,
the other nodes in the network will add it to their copy of the blockchain. And when this
happens, it cannot be modified or changed.
Now you know the creation process that each and every bitcoin in circulation has followed.
Each and every one of the bitcoins that exist have been issued following this process, to be later
used or sold by the miner to other people, until it reaches your hands.