Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Blockchain-IV

Dr. Maumita Chakraborty


University of Engineering and Management Kolkata

Dr. Maumita Chakraborty, UEMK 1


Hyperledger Fabric

Dr. Maumita Chakraborty, UEMK 2


Consortium Blockchain
• Hybrid scheme where permissions to read the block can be public or
private depending on the needs of the organizations involved.
• Consensus mechanism is achieved and controlled by a pre-selected group
of nodes rather than a single node.
• Key Characteristics:
• High scalability: Limited nodes take part in the consensus process.
• High Security: Data access can be restricted, unlike public blockchain.
• More affordable/Low cost: Cheaper as the transaction process involves very less
nodes.
• Governance by selected nodes: Members must agree on changes to the blockchain
network.
• Focus on business side: Builds trust among the participants of business alliances.

Dr. Maumita Chakraborty, UEMK 3


Why we need Consortium Blockchain?
• Used by private enterprises or organizations with a specific purpose.
• Organizations prefer using a consortium blockchain, as they prefer to
control the overall blockchain, with focus on the following aspects:

• Who can use the system


• Who can write into the system
• Who can read from the system

Dr. Maumita Chakraborty, UEMK 4


Hyperledger Platform
• The Linux Foundation took up the challenge for an open-source enterprise-grade
distributed ledger technology and announced the Hyperledger Project in
December 2015.

• The approach was to ensure that the best practices of computer science related
to distributed computing are used in blockchain for enterprise solutions.

• Bitcoin, in 2009, had demonstrated that massive decentralized computing is


possible. However, bitcoin is an open blockchain and an unregulated
environment.

• It needs to be noted that Hyperledger has stated they will not be issuing its
cryptocurrency.
Dr. Maumita Chakraborty, UEMK 5
Mission of Hyperledger
• As per hyperledger.org, the mission of Hyperledger Project (HLP) is to:

• create an enterprise-grade, open-source distributed ledger framework and


codebase.
• create an open-source, technical community to benefit the ecosystem of
the HLP (Hyper Ledger Project) solution.
• promote the participation of leading members of the ecosystem, including
developers, service and solution providers and end-users.

Dr. Maumita Chakraborty, UEMK 6


Hyperledger Characteristics
• Enterprise-grade
• Open Source Code
• Distributed Ledger
• Open source technical community
• Promote the participation
• Open standards and protocols
• Configurable consensus
• Advanced encryption
• One size does not fit all

Dr. Maumita Chakraborty, UEMK 7


Hyperledger Greenhouse
• A place that brings together users, developers, and vendors from many different
sectors and market spaces.
• Hyperledger greenhouse structure can incubate new ideas, support each one
with essential resources, and distribute results widely.
• Can support many different varieties while consuming very few resources.
• Greenhouse also brings additional advantages:
• Help keeping up with developments
• Better productivity through specialization
• Collaboration to avoid duplicate efforts
• Better quality control of code
• Easier handling of intellectual property

Dr. Maumita Chakraborty, UEMK 8


Hyperledger Greenhouse properties
• Users, developers and vendors
• Different markets and sectors
• New ideas
• Easier handling of intellectual properties
• Better quality control of code
• Innovative approach
• Different varieties
• Optimized resources (productivity)
• Collaborative effort

Dr. Maumita Chakraborty, UEMK 9


Hyperledger Greenhouse Family

Dr. Maumita Chakraborty, UEMK 10


Hyperledger Fabric
• Most popular project with Hyperledger Greenhouse.
• Fabric is a Distributed Ledger Technology and smart contract engine.
• Status is active and first production-ready version was made available
in June 2017.
• Permissioned blockchain infrastructure and famous for its modular,
scalable, secure architecture.
• Delivers a uniquely flexible and extensible architecture.
• Known for its high degree of confidentiality, resiliency, flexibility and
scalability.

Dr. Maumita Chakraborty, UEMK 11


Hyperledger Fabric
• Nodes in hyperledger classified as 3 types of peers:
• Endorser
• Committer
• Ledger Peer

• Used to authenticate a node using a mechanism called Membership Service Provider.

• Critical use case for industry needs: information sharing on ledgers (some selected
information need to be shared with some nodes, all information may have to be shared
with other nodes). It is a persistent challenge faced by IT systems.

• Hyperledger solves this problem by using a channel.

• Fabric shared use cases in supply chain management, health care and financial services.
Dr. Maumita Chakraborty, UEMK 12
Membership Service Provider
• The membership service providers play the function of the middleman between organizations
that want to participate in a network and those that want to use their services.
• This service is used by Hyperledger to set up the rules of engagement and make sure that there is
an agreement between the two sides.
• Hyperledger has a shared ledger that is hosted by several MSPs within their network.
• Both the organizations that are joining the network and those companies who are already
members of it have access to the ledger, which helps keep track of all of the transactions that go
on in it.
• One of the biggest benefits of this system is not having to attribute any transactions to any one
business participating in it. The transactions become a part of all ledgers, which means that no
single company owns them.
• Hyperledger’s MSPs must adhere to standards that have been created by the Hyperledger
community. These standards set forth specific rules for transactions and interactions within the
ledger so that all participants know exactly what to expect from each other. This ensures that
transactions and interactions between businesses utilizing this technology will always run
smoothly.

Dr. Maumita Chakraborty, UEMK 13


Consensus in Hyperledger Fabric
• Process where the nodes in the network provide a guaranteed ordering of the transaction and
validating those blocks of transactions that need to be committed to the ledger.
• Consensus must ensure the following in the network:
• Confirms the correctness of all transactions in a proposed block, according to endorsement and consensus
policies.
• Agrees on order and correctness and hence on results of execution (implies agreement on global state).
• Interfaces and depends on smart-contract layer to verify correctness of an ordered set of transactions in a
block.
• Consensus must satisfy two properties to guarantee agreement among nodes:
• Safety: When the nodes receive an identical series of transactions, the same state changes will
occur on each node. The algorithm must behave identical to a single node system that executes
each transaction atomically one at a time.
• Liveness: Each non-faulty node will eventually receive every submitted transaction, assuming that
communication does not fail.

Dr. Maumita Chakraborty, UEMK 14


Consensus in Hyperledger Fabric
• The most commonly used consensus algorithms in Hyperledger Fabric are:

• Practical Byzantine Fault Tolerance (PBFT): PBFT is a consensus algorithm that provides fault
tolerance and reliability in a network. It is well-suited for networks with a limited number of
participants who are trusted and well-known.
• RAFT: RAFT is a consensus algorithm that is used to maintain a consistent state across
multiple nodes. It is well-suited for networks where the participants are unknown and
potentially untrusted.
• Solo: Solo is a consensus algorithm that is used for testing purposes in a single-node network.
It is not suitable for production use.

Dr. Maumita Chakraborty, UEMK 15


Hyperledger Fabric System

Dr. Maumita Chakraborty, UEMK 16


Hyperledger Grid
• Hyperledger Grid is a framework (a framework is a set of best practices to achieve
a task).

• Grid is focussed on only one segment: Supply chain Management.

• Being a framework, Hyperledger Grid does not contain rules; instead it is an


ecosystem detailing a blockchain for supply chain management.
• It includes data sets, frameworks that work together, letting application
developers choose the best-suited technology or methodology as per company's
requirement.
• Supply chain is one of the highly rated usecase for blockchain implementation.
• Hyperledger Fabric display real and practical ways for hyperledger
implementation in the supply chain area.
Dr. Maumita Chakraborty, UEMK 17
Hyperledger INDY
• Hyperledger Indy is an open-source, decentralized identity management platform for
individuals and organizations to have complete control over their digital identities.
• It provides a secure and scalable infrastructure to manage and store decentralized
identity information, enabling the creation of self-sovereign identities (SSI)* that can be
used across various applications and services.
• Indy uses blockchain technology and cryptographic algorithms to ensure the privacy and
security of identity information.
• The Hyperledger Indy blockchain is both public and permissioned.
• In Indy, users must have permission to write information to the blockchain, but not to
read information from it.
• It should be emphasized that despite the fact that Indy is a public blockchain, not all user
information is recorded there.
• Private information and private keys are not stored on the network.

Dr. Maumita Chakraborty, UEMK 18


Hyperledger Sawtooth
• Sawtooth is a distributed ledger technology and powered with a smart contract engine. The sawtooth
project started with a contribution via Intel.

• Sawtooth offers a robust runtime environment, even allowing change of consensus approach in run
time.
• Sawtooth, being a permissioned layer, brings restrictions via Access Control Lists, and nodes are put
into these restrictions:

• Who can connect to the network?


• Who can send consensus messages?
• Who can submit transactions to the network?

• Sawtooth is the only project within Hyperledger Project, that uses Ethereum.
• Smart contracts are written via Solidity, as it is written in Ethereum. Even the smart contracts can be
deployed on the fly to the sawtooth network.

Dr. Maumita Chakraborty, UEMK 19


Hyperledger Tools
• Hyperledger framework has a set of collaboration tools for building blockchain
business networks.

Dr. Maumita Chakraborty, UEMK 20


Composer
• Composer offers business-centric abstractions as well as sample apps, which are used to
test or replicate business problems.

• Composer is handy when you have to build an application as part of Proof-of-Concepts


(PoC), and you have a concise timeline.

• Composer operates as a rapid prototyping tool for user-facing solutions.

• Hyperledger fabric is the underlying mechanism to operate a blockchain for the


composer. Composer allows for creation/modification of the following:
• Assets
• Participants
• Transactions

Dr. Maumita Chakraborty, UEMK 21


Explorer
• Hyperledger Explorer is an open-source tool developed by the Linux Foundation and hosted by
the Hyperledger project.
• It provides a web-based interface for viewing, querying, and analyzing data from a blockchain
network powered by Hyperledger Fabric.
• The tool offers a number of features for tracking and analyzing the operation of the blockchain
network, including the ability to view transaction history, smart contract information, network
node information, and user data.
• These nodes include the following:
• Blocks
• Transactions
• Network information (name, status, list of nodes)
• Chain codes*.

Dr. Maumita Chakraborty, UEMK 22


Hyperledger Fabric
• Hyperledger Fabric is the most popular of the Hyperledger project.

• All blockchains strive to solve the problem of trust and time, and
blockchain hyperledger fabric is no different.

• Hyperledger fabric is amongst the best solutions where the organization


can choose the trust mechanism it needs to use.

• The issue of trust has a profound impact on Supply Chain Management,


which is the most talked and piloted use-case of blockchain.

Dr. Maumita Chakraborty, UEMK 23


CAP in Hyperledger Fabric
• A permissioned distributed ledger technology.
• Achieves CAP using the following techniques:
• Consistency: Ordering done by a peer and version control using MVCC
(Multiversion Concurrency Control)
• Availability: All peers within the blockchain have a copy of the ledger
• Partition tolerance: Allows functioning of the block, even if a few nodes go
down.
• For enterprise solutions, having consistent data among its various
nodes is a real issue.

Dr. Maumita Chakraborty, UEMK 24


Hyperledger Fabric Approach

• Peers validate transactions submitted by the end-user.


• Validated transaction is submitted to the orderer.
• Orderer would further validate the order, especially to avoid double-spending.
• Orderer orders transactions for a block and approves the block creation.
• Peers on the block are notified via gossip* protocol.
• All peers validate the order and make a new block in the chain.
• Peer validation ensures that service order transactions into blocks are consistent with all nodes in
the blockchain – an ordered block transmitted by the orderer via broadcast to peers.
• Peers validate the order with their copy of the existing ledger and make changes to the ledger.
• If transactions fail the validation, they are marked as invalid in the ledger (retained in the ledger,
but not dropped).
Dr. Maumita Chakraborty, UEMK 25
Multiversion Concurrency Control (MVCC)
• Concurrency control mechanism used by DBMS.
• Traditional DBMS handles concurrency problems by applying lock.
• Locks solve the problem only in centralized servers, applying lock in a
distributed system may not be feasible.
• From blockchain perspective, concurrency control aims to control two
common problems of distributed computing – double spending and
key clashing/collision.
• Double spending: problem where participants bring transactions to use or
modify the same asset (spending the money or resource multiple times)
• Key collision: when two resources try to change key/value simultaneously.
More frequent in distributed computing environment.

Dr. Maumita Chakraborty, UEMK 26


Multiversion Concurrency Control (MVCC)
• Hyperledger fabric uses versioning for keys stored in the ledger to avoid double-
spending.
• Between ordering and writing to the ledger, key-value pair must not be changed.
• During validation, data for key/value and version of key is checked before writing to the
ledger.
• If transaction does not pass validation, that record is invalidated in ledger, though not
dropped from ledger.
• Hyperledger fabric uses couch DB at all nodes, with MVCC enabled in its environment
ensures that DB is run at full speed, even at high load.
• Documents (transactions) in couch DB are versioned.
• In hyperledger, there is no delete or update.
• If a user wants to change a value in a document, DB will create an entirely new version of
that document.
• There will be two copies of the same document with different versions.
Dr. Maumita Chakraborty, UEMK 27
Components of Hyperledger Fabric

Dr. Maumita Chakraborty, UEMK 28


Components of Hyperledger Fabric
• Being a distributed blockchain, fabric needs to maintain ledger.
• Fabric uses couch DB for retaining values as key/value pairs.
• A smart contract allows creation of assets and allows transfer of assets
based on rules.
• Peers are computing resources where ledgers are maintained. 3 types:
• Endorsers
• Orderers
• Ledgers
• All peers keep ledgers; some peers would keep endorse and orders apart
from being a ledger.

Dr. Maumita Chakraborty, UEMK 29


Roles within Hyperledger fabric
• Hyperledger fabric has two roles:
• Clients: Submit transaction to blockchain network.
• Peers: Are of two types:
• Endorser: Run smart contract against the transaction and send the result
to orderer.
• Orderer (Committer): Run the consensus and verify if the transaction is
valid or not. Adds transaction to a block in a sequential manner.

Dr. Maumita Chakraborty, UEMK 30


Transaction in Hyperledger Fabric
• Transactions are executed as follows:
• Transaction request submitted to blockchain by a client
• Endorsers and peers validate the request
• Endorsers submit validation result to orderer peer
• Orderer runs the consensus mechanism on the results from validators
• Orderer decides transaction as valid or invalid
• Orderer adds transaction to block
• Orderer submits a block to peers via a gossip protocol
• Peers add the block to the chain
• When private network grows, more than one orderer is needed to publish
next block for blockchain.
• Uses pBFT to collate the transaction result and to arrive at a decision
whether the transaction is approved or not.

Dr. Maumita Chakraborty, UEMK 31


Transaction in Hyperledger Fabric
• There are 3 phases:
• Endorsement phase: Endorsement
is driven by policy (m out of n
signatures) upon which participants
endorse a transaction.
• Ordering phase: Ordering phase will
get the endorsed transaction and
agrees to the order to be
committed to the ledger.
• Validation phase: Validation takes a
block of ordered transactions and
validates the correctness of the
result.

• Ordering phase is the most


considerable time- and resource-
consuming activity within Fabric.

Dr. Maumita Chakraborty, UEMK 32


Channels in Hyperledger Fabric
• Most powerful tool provided by Hyperledger Fabric.
• No other blockchain have this.
• Similar to a subnet within a network. (only a few allowed
computers are allowed to send and receive data)
• Mechanism for conducting private and confidential
transmission of data.
• Members, shared ledger and the orderer nodes, define a
channel.
• Every transaction on the network is executed on a channel.
• To execute on the channel, each member needs to be
authenticated and authorized. Authorization is done based
on the access policy list.
• One peer can be part of one or more channels.
• This ensures that for each channel, there is a ledger, and
data between ledger is never exchanged.
• This allows creation of business network, where private and
confidential data is shared among companies to conduct a
transaction on the same network.
Dr. Maumita Chakraborty, UEMK 33
Thank You

Dr. Maumita Chakraborty, UEMK 34

You might also like