You are on page 1of 48

Course Title: Block Chain

Course code : EC 802C


Contact :3:0:0
Credits :3

Lecture 3
Module 1
Introduction
Dr. Soumik Podder
Assistant Professor
Electronics and Communication
Engineering
Guru Nanak Institute of
Email: Technology
soumik.podder@gnit.ac.in
Syllabus
Block in Block Chain
 A block in a blockchain network is like a link in a chain. In the field of
cryptocurrency, blocks are like records that store valid transactions like a
page of a record book and are hashed and encrypted into a hash tree or
Merkle tree. 

Blocks are like the building blocks of any blockchain and they are
distinguishable from one another as they have different characteristics.
When a block is completed,  it makes room for the following block in
the blockchain. A block is very secure and is impossible to hack
virtually.
 
Operation:

In any cryptocurrency, there are a huge number of transactions occurring


every day throughout the world. It is important for the users to keep track
of these transactions, and they can do it with the help of blocks. A block
contains the recent data and every time the block is completed, it
becomes a part of the past and makes room for a new block on the
blockchain. 
 
The completed block is a permanent record of prior transactions, and
new ones are recorded in the current one. As a result, the entire system
enters into a loop that permanently saves all data. 
 
Consensus
A consensus algorithm is a procedure through which all the peers
of the Blockchain network reach a common agreement about
the present state of the distributed ledger.

In this way, consensus algorithms achieve reliability in the


Blockchain network and establish trust between unknown peers
in a distributed computing environment.

Essentially, the consensus protocol makes sure that every new


block that is added to the Blockchain is the one and only version
of the truth that is agreed upon by all the nodes in the
Blockchain.
Courtesy: Natalia Chaudhry, M. Yousaf, Consensus Algorithms in Blockchain: Comparative Analysis, Challenges and
Opportunities, 12th International Conference on Open Source Systems and Technologies (ICOSST), DOI:
10.1109/ICOSST.2018.8632190
Various Consensus Algorithms
Proof of Work (PoW):

This consensus algorithm is used to select a miner for the next block
generation. Bitcoin uses this PoW consensus algorithm. The central idea
behind this algorithm is to solve a complex mathematical puzzle and
easily give out a solution. This mathematical puzzle requires a lot of
computational power and thus, the node who solves the puzzle as soon as
possible gets to mine the next block
Proof of Stake (PoS):

This is the most common alternative to PoW. Ethereum has shifted from PoW to
PoS consensus. In this type of consensus algorithm, instead of investing in
expensive hardware to solve a complex puzzle, validators invest in the coins of the
system by locking up some of their coins as stake. After that, all the validators will
start validating the blocks. Validators will validate blocks by placing a bet on it if
they discover a block which they think can be added to the chain. Based on the
actual blocks added in the Blockchain, all the validators get a reward proportionate
to their bets and their stake increase accordingly. At the end, a validator is chosen to
generate a new block based on their economic stake in the network. Thus, PoS
encourages validators through an incentive mechanism to reach to an agreement.
Proof of Burn (PoB):

With PoB, instead of investing into expensive hardware equipment,


validators ‘burn’ coins by sending them to an address from where they
are irretrievable. By committing the coins to an unreachable address,
validators earn a privilege to mine on the system based on a random
selection process. Thus, burning coins here means that validators have a
long-term commitment in exchange for their short-term loss. Depending
on how the PoB is implemented, miners may burn the native currency of
the Blockchain application or the currency of an alternative chain, such
as bitcoin. The more coins they burn, the better are their chances of being
selected to mine the next block.
Miners are randomly chosen according to the number of coins they sent
to burning

Burning more coins translates to more commitment, thus higher the


chances of being selected as a miner (just like spending more electricity
on proof of work increase the chances of mine a block)

Burned coins are lost forever, locked in a burn address

An unspendable address or burn address is a blockchain address with no


private keys, and consequently, the coins sent to this address are forever
lost. The coins don’t disappear from the blockchain; they are simply sent
to a black hole and can’t be used anymore.
Advantages
It doesn't need as much electricity as other implementations like proof of
stake

No need for specialized hardware

Coin burning reduces supply thus increasing the price (in theory)

Motivates a long term commitment

Supposedly incentivizes a more decentralized consensus mechanism


Disadvantages
Not tested on large scale. Its scalability is not proven.

The process of burning coins is not always transparent


Proof of Capacity:

In the Proof of Capacity consensus, validators are supposed to invest


their hard drive space instead of investing in expensive hardware or
burning coins. The more hard drive space validators have, the better are
their chances of getting selected for mining the next block and earning
the block reward.
Proof of Elapsed Time:

PoET is one of the fairest consensus algorithms which chooses the next
block using fair means only. It is widely used in permissionned
Blockchain networks. In this algorithm, every validator on the network
gets a fair chance to create their own block. All the nodes do so by
waiting for random amount of time, adding a proof of their wait in the
block. The created blocks are broadcasted to the network for others
consideration. The winner is the validator which has least timer value in
the proof part. The block from the winning validator node gets appended
to the Blockchain. There are additional checks in the algorithm to stop
nodes from always winning the election, stop nodes from generating a
lowest timer value.
Distributed Consensus
A procedure to reach a common agreement in a distributed
or decentralized multi-agent platform. It is important for
the message passing system.

Features :    
It ensures reliability and fault tolerance in distributed
systems.
In the presence of faulty individuals, it is Ensure correct
operations.
Examples – 
Commit a transaction in a database, State machine replication, Clock
synchronization.
How to achieve distributed consensus :
There are some conditions that need to be followed in order to achieve
distributed consensus.
Termination –
Every non-faulty process must eventually decide.
Agreement –
The final decision of every non-faulty process must be identical.
Validity –
Every non-faulty process must begin and ends with the same value.
Integrity –
Every correct individual decides at most one value, and the decided value
must be proposed by some individual.
Application of Distributed Consensus :   
 
Leader election in a fault-tolerant environment for initiating
some global action without introducing a single point of failure.
Maintaining consistency in a distributed network. Suppose you
have different nodes monitoring the same environment. If one of
the nodes crashes, a consensus protocol ensures robustness
against such faults.
Problems in Distributed Consensus
Nodes might crash or might be malicious.

The network is highly imperfect: it's a peer-to-peer system and not all
pairs of nodes are connected to each other.

There could be faults in the network because of poor Internet


connectivity.

There will be a lot of latency in the system, because everything happens


over the Internet and there's no single data center. One particular
consequence of this high latency, is that there is no notion of global
time. This means that not all nodes can agree to a common ordering of
events, simply based on observing timestamps .
Types of Block
Genesis Block:
 
Genesis means ‘origin’ and rightfully named, genesis block is the first
block of a blockchain.

The first genesis block was mined by Satoshi Nakamoto in creating


bitcoin and released the idea in public in 2009. 
 
This fundamental block enables the newly formed block to be linked to a
previous state. The blockchain can ensure its immutability through this
connection. 
 
This enables the association of the block history with a unique hash
associated with those blocks. 
Valid blocks:
 
Valid blocks are all such blocks that have been mined and added to the
blockchain. To get a valid block, each mined block must get network
permission and report as a block that has solved the given cryptographic
puzzle. 
 
When the network reaches consensus, the block is added to the
blockchain and distributed to all nodes. As a result, every node in the
network has a new block and acts as a verification point for it. All the
operations and transactions that are happening in any cryptocurrency are
allowed by these blocks.
Orphan blocks:
 
Orphan blocks are also correctly named as these blocks are not
part of the blockchain network. These are generated by two
miners mixing blocks at almost the same time, but they can also
be caused by an attacker with enough computational power with
the intention of reversing any transaction. 
Private vs Public Block Chain
Public Block Chain

Public blockchains are open networks that allow anyone to participate in


the network i.e. public blockchain is permissionless.

In this type of blockchain anyone can join the network and read, write, or
participate within the blockchain.

A public blockchain is decentralized and does not have a single entity


which controls the network.

Data on a public blockchain are secure as it is not possible to modify or


alter data once they have been validated on the blockchain. 
Private Blockchain

A private blockchain is managed by a network administrator and


participants need consent to join the network i.e., a private blockchain is
a permissioned blockchain.

There are one or more entities which control the network and this leads
to reliance on third-parties to transact.

In this type of blockchain only entity participating in the transaction have


knowledge about the transaction performed whereas others will not able
to access it i.e. transactions are private.
Cryptocurrency
Cryptocurrency is the technology that acts as the medium for
conducting financial transactions.
Cryptocurrency provides that safe and secure platform for
transactions with the help of cryptography technology.

Cryptocurrency is a kind of digital currency that is virtual and


doesn’t have a physical form.

It works on decentralized control which doesn’t have any central


banking systems. This makes it easier for cryptocurrencies to
work with distributed ledgers.
Bitcoin vs Crystocurrency
Difference between Bitcoin and Ethereum
Permissioned Block Chain
Permissioned blockchains are blockchain networks that require access to
be part of.

In these blockchain types, a control layer runs on top of the blockchain


that governs the actions performed by the allowed participants.

As you can see, permissioned blockchains work entirely different than


that of private and public blockchains.

They are crafted to take advantage of blockchains without sacrificing the


authority aspect of a centralized system.

A permissioned system is also known to have a restriction on the


consensus participants, making permissioned networks highly configured
and controlled by the owners.
Benefits of Permissioned Blockchains
Efficient performance: When we compared permissioned blockchains
to permissionless blockchains, they offer better performance. The core
reason behind this is the limited number of nodes on the platform. This
removes the unnecessary computations required to reach consensus on
the network, improving the overall performance. On top of that,
permissioned networks have their own pre-determined nodes for
validating a transaction.

Decentralized storage: Permissioned networks also make proper use of


blockchain, including utilizing its decentralized nature for data storage.
Proper governance structure: Permissioned networks do come with an
appropriate structure of governance. This means that they are organized.
Administrators also require less time to update the rules over the network, which is
considerably faster when compared to public blockchains. The public blockchain
network suffers from the consensus problem as not all nodes work together to get
the new update implemented. These nodes might place their self-interest above the
needs of the blockchain, which, in return, means slower updates to the whole
network. In comparison, permissioned blockchain doesn’t have the problem, as the
nodes work together to move the updates faster.

Cost-Effective: There is no doubt that permissioned blockchains are more cost-


effective when compared with the permissionless blockchains.
Drawbacks of Permissioned blockchains
Compromised security – A public or private blockchain has better
security as the nodes participate in a consensus method properly. But, in
the case of permissioned blockchains, this might not hold true. The
security of a permissioned network is as good as the member’s integrity.
This means that a small section of a permissioned system can work
together to modify the data stored within the network. In this way, the
integrity of the network can be compromised. To resolve it, the system
should have proper permissions set so those bad actors cannot merge
together to cause the desired effect.
Control, Censorship, and Regulation – In an ideal world, these
permissioned blockchains should work as that of a public
blockchain, but with regulations. However, the regulations bring
censorship to the network, where the authority can restrict a
transaction or control it from happening. These are a threat to any
business or organization that is using the permissioned network.
This approach also stops the permissioned network from making
the most out of the whole blockchain ecosystem.
Differences between Permissioned and Permissionless Model
Three Permissioned Block Chain
Hyperledger Fabric: Hyperledger Fabric Framework is one of the
popular Hyperledger projects that is maintained by Linux foundations.
The modular architecture enables anyone to develop solutions or
applications to plugin and play with different services. It uses smart
contracts known as “chaincode” containing the system’s logic.

Quorum: Quorum blockchain is an enterprise-focused Ethereum


blockchain that is aimed at the financial industry. It is created by JP
Morgan.

Corda: Corda lets businesses build interoperable blockchain networks. It


is open-source in nature and provides excellent value to businesses.

You might also like