UNTI – 4 Prepared By MAV
UNIT – 4 HYPERLEDGER
Hyperledger Fabric: Introduction - Fabric v/s Ethereum – Hyperledger Iroha -
Features of Iroha. Hyperledger Sawtooth: Components of sawtooth - Proof of Elapsed
time.
1. Hyperledger Fabric
Hyperledger is a collection of open-source projects created to support the
development of blockchain-based distributed ledgers.
It aims to create the needed frameworks, standards, tools and libraries to build
blockchains and related applications. Hyperledger acts as a hub for different
distributed ledger frameworks and libraries.
With this, a business could use one of Hyperledger's frameworks, for example, to
improve the efficiency, performance and transactions in their business processes.
Hyperledger works by providing the needed infrastructure and standards for
developing blockchain systems and applications.
Developers use Hyperledger Greenhouse to develop business blockchain projects.
Network participants are all known to each other and can participate in consensus-
making processes.
Hyperledger-based technology works using these layers:
✓ A consensus layer, which makes an agreement on order and confirms if the
transactions in a block are correct.
✓ A smart contract layer, which processes and authorizes transaction requests
✓ A communication layer, which manages peer-to-peer (P2P) message
transport.
Dept., of CA 1 A.V.C.C.E
UNTI – 4 Prepared By MAV
✓ An API, which allows other applications to communicate with the blockchain.
✓ Identity management services, which validates the identities of users and
systems.
Hyperledger Fabric is an open-source platform used to build block chain based
products , software and applications. For building distributed ledger solutions, with a
modular architecture that delivers high degrees of confidentiality, flexibility,
resiliency, and scalability.
Hyperledger Fabric was made in cooperation with IBM and Digital Asset. It provides a
modular architecture that defines roles between nodes, execution of smart contracts
and configurable consensus services.
Features of Fabric include the use of smart contracts, as well as pluggable Hyperledger
Fabric consensus protocols. Fabric also supports different programming languages
through the installation of modules. Hyperledger Fabric is used with integration
projects that need a distributed ledger.
This enables solutions developed with fabric to be adapted for any industry. This is
a private and confidential blockchain framework managed by the Linux Foundation.
Hyperledger Fabric is designed for use in enterprise-level applications, and it is
characterized by its modular architecture, permissioned network, and smart contract
functionality, known as “chaincode”.
• The platform provides a high degree of security, privacy, and scalability, and it
supports the development of custom blockchain solutions for various use cases
across industries such as finance, supply chain, and healthcare.
• Hyperledger Fabric operates as a network of nodes, where each node performs
a specific function, such as validating transactions, maintaining the ledger, and
executing chaincode.
Dept., of CA 2 A.V.C.C.E
UNTI – 4 Prepared By MAV
• Transactions are validated and ordered by a consensus mechanism, which
ensures the integrity and consistency of the ledger.
How does Hyperledger Fabric Work?
Components:
• Hyperledger fabric is an enterprise-level permission blockchain network.
It is made up of various unique organizations or members that interact
with each other to serve a specific purpose. For example, these
organizations can be a bank, financial institution, or a supply chain network.
Each organization is identified and they have a fabric certificate authority. These
organizations are called members.
• Each member of the fabric can set up one or more authorized peers to participate
in the network using the fabric certificate authority. All of these peers must be
authorized properly.
• There is a client-side application connected to the network written with the
software development kit (SDK) of any particular programming language .
Workflow:
For each and every transaction in the fabric, the following steps are followed-
1. Creation of the proposal: Imagine a deal between a smartphone manufacturer
company and a smartphone dealership. The transaction begins when a member
organization proposes or invokes a transaction request with the help of the client
application or portal. Then the client application sends the proposal to peers in
each organization for endorsement.
2. Endorsement of the transaction: After the proposal reaches the endorser
peers the peer checks the fabric certificate authority of the requesting member
and other details that are needed to authenticate the transaction. Then it
executes the chain code and returns a response. This response indicates the
approval or rejection of the following transaction. The response is carried out
to the client.
Dept., of CA 3 A.V.C.C.E
UNTI – 4 Prepared By MAV
3. Submission to ordering service: After receiving the endorsement output, the
approved transactions are sent to the ordering service by the client-side
application. The peer responsible for the ordering service includes the
transaction into a specific block and sends it to the peer nodes of different
members of the network.
4. Updating the ledger: After receiving this block the peer nodes of such
organizations update their local ledger with this block. Hence the new
transactions are now committed.
Hyperledger Fabric Consensus Algorithm
Hyperledger Fabric uses a consensus algorithm to achieve agreement among the
participants in a network on the contents of the shared ledger. The consensus
algorithm in Hyperledger Fabric is pluggable, which means that it can be replaced
with a different algorithm as needed.
The most commonly used consensus algorithms in Hyperledger Fabric are:
Dept., of CA 4 A.V.C.C.E
UNTI – 4 Prepared By MAV
• 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.
Benefits Of Hyperledger Fabric
1. Open Source: Hyperledger fabric is an open-source blockchain framework
hosted by the Linux foundation. It has an active community of developers The code
is designed to be publicly accessible. Anyone in the community can see, modify,
and distribute the code as they see fit. People across the world can come and help
to develop the source code.
2. Private and Confidential: In a public blockchain network each and every node
in the network is receiving a copy of the whole ledger. Thus keeping privacy
becomes a much bigger concern as everything is open to everyone. In addition to
this one, the identities of all the participating members are not known and
authenticated. Anyone can participate as it is a public blockchain. But in the case of
Hyperledger fabric, the identities of all participating members are authenticated.
And the ledger is only exposed to the authenticated members. This benefit is the
most useful in industry-level cases, like banking, insurance, etc where customer
data should be kept private.
3. Access Control: In the Hyperledger fabric, there is a virtual blockchain network
on top of the physical blockchain network. It has its own access rules. It employs
its own mechanism for transaction ordering and provides an additional layer of
access control. It is especially useful when members want to limit the exposure of
data and make it private. Such that it can be viewed by the related parties only. As
an example when two competitors are on the same network. The fabric also offers
Dept., of CA 5 A.V.C.C.E
UNTI – 4 Prepared By MAV
private data collection and accessibility, where one competitor can control the
access to its own data such that the data do not get exposed to the other
competitor.
4. Chaincode Functionality: It includes a container technology to host smart
contracts called chain code that defines the business rules of the system. And it’s
designed to support various pluggable components and to accommodate the
complexity that exists across the entire economy. This is useful for some of the
specific types of transactions like asset ownership change.
5. Performance: As the Hyperledger fabric is a private blockchain network, There
is no need to validate the transactions on this network so the transaction speed is
faster, resulting in a better performance.
Limitation of Hyperledger Fabric
Hyperledger Fabric is a robust and flexible platform for developing blockchain
applications, but like any technology, it has certain limitations:
1. Scalability: Hyperledger Fabric is designed for permissioned networks, where
the participants are known and trusted, which can limit its scalability for large-
scale public networks.
2. Performance: The performance of Hyperledger Fabric can be impacted by
factors such as network size, network configuration, and the complexity of
chaincode, which can limit its ability to handle high volumes of transactions.
3. Complexity: Setting up and configuring a Hyperledger Fabric network can be
complex, requiring a deep understanding of the technology and its components.
4. Compatibility: Hyperledger Fabric is designed to be used with specific
programming languages, such as Go and JavaScript, which can limit its
compatibility with other technologies and programming languages.
5. Cost: Running a Hyperledger Fabric network requires infrastructure and
resources, which can add costs to the deployment and operation of blockchain
applications.
Dept., of CA 6 A.V.C.C.E
UNTI – 4 Prepared By MAV
6. Interoperability: Hyperledger Fabric is designed to be used within a single
network, and its interoperability with other blockchain platforms is limited.
2. Hyperledger vs Ethereum
Hyperledger and Ethereum are each the most popular platform and blockchain
network respectively. Both are open source. Besides solving numerous industry-
level problems they have also been helpful to create a large number of blockchain
applications.
As blockchain technology grows and a lot of developers are coming in this question
comes very often, ‘Which blockchain network to use? and When to use blockchain
technology?’ to answer this question it is very important to understand the
differences between these two technologies.
Differences Between Ethereum And Hyperledger
1. Purpose:
• Ethereum is the platform for creating B2C businesses and decentralized
applications. It is created for the purpose of running smart contracts on the
Ethereum Virtual Machine(EVM) and creating decentralized apps for mass
consumption with the help of this.
• Hyperledger is designed to create B2B businesses and cross-industry
applications. It helps businesses or industries to collaborate with the developers,
who are working with Distributed Ledger Technology(DLT). Customized
blockchain apps with limited access can be created with this.
2. Confidentiality:
• Ethereum is a public network. All the transactions are entirely transparent and
anyone with access to the internet can view these transactions.
Dept., of CA 7 A.V.C.C.E
UNTI – 4 Prepared By MAV
• Hyperledger is limited access or allowed blockchain network. This is highly
secure and confidential. The organizations or individuals having the Certificate
of Authorization can only view all the transactions on the network.
3. Governance:
• The Ethereum network is governed by the Ethereum developers only. Vitalik
Buterin is the main developer and founder of Ethereum. This is mostly an
example of in-house development rather than collaboration.
• Hyperledger fabric is governed by the Linux Foundation. IBM is also one of the
major contributors to this framework. It is a product of the massive collaboration
of these two companies which turned out to be a huge success.
4. Participation:
• Ethereum is a permission-free and public network. Anyone with access to the
internet can download the software and start mining Ethereum.
• Hyperledger maintains strict control over the participation in this network. Only
authorized members and peers selected by authorized members can use the
Hyperledger platform and its tools. This hides valuable and confidential
information from external parties and prevents them to manipulate it.
5. Smart Contracts:
• Ethereum came up with smart contracts first. A Smart Contract is a computer
program or a condition written in code that gets automatically triggered when
certain conditions are met. It controls the transfer of digital assets between the
parties under the contract. It is immutable, once the condition is created it cannot
be changed by any third party.
Dept., of CA 8 A.V.C.C.E
UNTI – 4 Prepared By MAV
• Like the smart contracts, Hyperledger fabric also allows the member
organizations to run some code on peers that create the transactions on a specific
condition. These are known as chaincode.
6. Programming Language:
• For writing smart contracts, Ethereum uses solidity and for developing the
application some high-level languages like JavaScript, Python, Golang can be
used.
• In Hyperledger Go is widely used to write the chaincode along with that some
extent of Java and JavaScript are also used.
7. Proof-Of-Stake (POS) or Consensus Mechanism:
• Previously Ethereum was using Proof-of-Work(POW) based consensus
mechanism. Currently, Ethereum is using Proof-of-Stake(POS) based consensus
protocol. The consensus mechanism allows the participant nodes of the
decentralized network to come to a consensus or agree on things like account
balances and the order of transactions which prevents the users from making
fake transactions and double-spending their coins.
• As Hyperledger is a private and permissioned network, it does not need any POW
or consensus mechanism to validate a transaction. If two participating parties
agree on a specific transaction then no third party can view or intervene in the
specific transaction. This helps to improve the scalability and transaction rates
as well as the performance of the entire network.
8. Speed of Transactions:
• As Ethereum is a public domain it has a POW mechanism, which reduces the
transaction speed of Ethereum. That is something close to 20 transactions per
second.
• For being a permissioned blockchain network, Hyperledger fabric does not need
such a heavy POW mechanism like Ethereum. That increases the transaction
speed. That is around 2000 transactions per second. Which is far larger than
Ethereum.
Dept., of CA 9 A.V.C.C.E
UNTI – 4 Prepared By MAV
9. Cryptocurrency:
• Ethereum has its own native cryptocurrency called ETHEREUM(ETH). Any
participating node can mine ETH by paying gas.
• Hyperledger does not have its native cryptocurrency and it does not involve in
mining.
Feature Ethereum Hyperledger
Confidentiality Public blockchain Private blockchain
Client-side B2C Enterprise-level B2B
Purpose applications applications
Governance Ethereum Developers Linux Foundation
Organizations having Certificate
Anyone
Participation of Authorization
Programming
Solidity Golang, JavaScript, or Java
Language
Consensus POW- Proof of Work Pluggable consensus
Mechanism Mechanism mechanism
Speed of Less More
Cryptocurrency Ether or Ethereum None
Dept., of CA 10 A.V.C.C.E
UNTI – 4 Prepared By MAV
When to use what?
The used cases of Ethereum and Hyperledger are mentioned below:
Ethereum:
• Public or B2C applications: When the developer or developing organizations
intend to create decentralized applications for customer use, they can use
Ethereum smart contracts. With Ethereum, anyone can join the network and
create a node. Every such node possesses a copy of the entire blockchain.
• Community-led open-source applications: These applications do not need
any confidentiality, and are developed and hosted by blockchain developer
communities around the world. They can be developed using Ethereum.
Hyperledger:
• Private or B2B Applications: Businesses don’t want to keep their confidential
data on a public blockchain like Ethereum. As a permission blockchain network,
Hyperledger can solve this problem. It offers the facility to create a blockchain
application maintaining the privacy of the information of the organization.
• Create customized blockchain algorithms: When an organization or a
business wants to define its own and unique blockchain algorithms Hyperledger
can be very useful. In Hyperledger projects, the whole underlying infrastructure
of the blockchain can be modified. This flexibility stands out to be a great tool
while making customized blockchain applications for business purposes.
3. Hyperledger Iroha
✓ Hyperledger Iroha is a type of blockchain technology designed to make it easy
for businesses and developers to create and manage their blockchains.
✓ It offers a simple and efficient way to handle transactions and store data
securely.
Dept., of CA 11 A.V.C.C.E
UNTI – 4 Prepared By MAV
✓ Hyperledger Iroha is known for its straightforward design, making it suitable
for various applications like managing assets, tracking transactions, and
ensuring data integrity.
What is Hyperledger Iroha?
▪ Hyperledger Iroha is a business blockchain framework that is designed for
infrastructure projects that need DLT.
▪ For example, the platform can help enterprises as well as government
institutions with identity management, including creating national IDs and
helping the financial services industry with bank-to-bank transfers.
✓ It is part of the Hyperledger project, which aims to advance cross-industry
blockchain technologies.
✓ It seeks to develop DLT (Distributed Ledger Technology) that enables
enterprises to execute reliable, industry-specific applications, platforms, and
hardware systems to support their business transactions.
✓ It uses a unique consensus mechanism called Sumeragi, which ensures
secure and reliable transaction processing.
✓ Hyperledger Iroha can integrate with Linux, macOS, and windows platform.
✓ It can integrate with other Hyperledger projects and various systems
through APIs and SDKs.
✓ Support for writing applications on different platforms (e.g., mobile and
mainframe) using programming languages like Java, JS, Python, and iOS
Components of Iroha
✓ Iroha core
✓ Iroha Native iOS Library
✓ Iroha JavaScript Library
✓ Iroha Native Android Library
Dept., of CA 12 A.V.C.C.E
UNTI – 4 Prepared By MAV
Application of Hyperledger Iroha
Certifications: Iroha allows building certifying identities, which enables granting as
well as verification of various certificates issued to individuals by educational and
healthcare institutes.
Digital Avatars
Iroha can also be used to create digital avatars of real-world assets that can be
transacted with zero or low transaction fees.
Know Your Customer (KYC)
Hyperledger Iroha can also be used in the identity management process needed for
Know Your Customer (KYC) requirements. KYC is a standard requirement in the
financial services industry that establishes guidelines for banks and investment firms
to know their client.
Smart Contracts
Iroha offers smart contracts, which are self-executing contracts that contain terms of
an agreement between two parties that is written in code. If one party satisfies their
end of the agreement through the blockchain network, the smart contract
automatically executes the other end of the agreement.
4. Features of Hyperledger Iroha
Here are the key features of Hyperledger Iroha:
1. Simple Design: Designed with simplicity in mind, making it easier for
developers to implement and manage.
2. Consensus Algorithm: A Byzantine Fault Tolerant consensus mechanism that
ensures secure and efficient block validation.
Dept., of CA 13 A.V.C.C.E
UNTI – 4 Prepared By MAV
3. Modular Architecture: It includes core modules for handling transactions,
managing assets, and implementing permissions.
4. Smart Contracts: Hyperledger Iroha supports basic smart contracts with a
focus on simplicity and usability.
5. Access Control: It provides fine-grained access control through predefined
roles and permissions.
6. Interoperability: It offers APIs and SDKs for easy integration with other
blockchain systems and applications.
7. Scalability: Hyperledger Iroha is designed to handle a large number of
transactions efficiently.
8. Security: It uses advanced ensure to ensure data integrity and security.
5. Hyperledger Sawtooth
✓ Hyperledger Sawtooth is an open-source blockchain framework designed to make
building and deploying distributed ledger applications easier. It offers a modular
architecture that separates the core functions of a blockchain from the business
logic, making it flexible and adaptable to various use cases.
✓ Sawtooth supports custom transaction processing, allowing developers to define
how transactions are validated and processed. It also includes innovative
consensus algorithms like Proof of Elapsed Time (PoET), which enhance
scalability and security.
What is Hyperledger Sawtooth?
Hyperledger Sawtooth is an open-source enterprise blockchain-as-a-service
platform that can run customized smart contracts without knowing the core
system’s underlying design.
1. It is part of the Hyperledger project, a collaborative effort to advance cross-
industry blockchain technologies.
2. Sawtooth provides a modular and flexible framework allowing organizations to
build and manage blockchain solutions tailored to their needs.
Dept., of CA 14 A.V.C.C.E
UNTI – 4 Prepared By MAV
Features of the Hyperledger Sawtooth
1. Separation of Concerns: Separates the core blockchain functionality from the
application logic, allowing for customization and extension.
2. Flexibility: Modular design enables the integration of various components and
transaction processors tailored to specific needs.
3. Transaction Processors: Developers can create custom transaction
processors to define how transactions are validated and applied.
4. Proof of Elapsed Time (PoET): A consensus algorithm that uses a lottery-
based approach to select block leaders, designed to be energy-efficient and
scalable.
5. Global State: Maintains a consistent global state of the blockchain, ensuring
that all transactions update the state in a synchronized manner.
6. Efficient State Updates: The state changes are efficiently managed and
validated to maintain consistency and integrity.
7. High Throughput: Designed to handle high volumes of transactions and
support large-scale deployments.
Components of Hyperledger Sawtooth
Here is an overview of the key components of Hyperledger Sawtooth:
1. Transaction Processor: It handles the business logic of transactions by
validating and applying them to the blockchain state. Developers can
implement custom transaction processors to define how transactions are
processed based on specific application needs. It includes built-in transaction
families and allows the creation of new ones.
2. Consensus Engine: The state engine manages the agreement on the order and
validity of transactions across the network. Sawtooth’s default consensus
algorithm, uses a lottery-based approach to select block leaders in an energy-
efficient manner. It supports various consensus algorithms, including PBFT and
Raft, providing flexibility in how consensus is achieved.
Dept., of CA 15 A.V.C.C.E
UNTI – 4 Prepared By MAV
3. Blockchain: The core ledger where all transactions are recorded in a secure
and immutable manner. Blocks contain a list of transactions and other
metadata, such as a previous block hash, to maintain the chain’s integrity. The
state represents the current state of the blockchain, including data and changes
made by transactions.
4. Validator: The validator is a node that participates in the network, validates
transactions, and proposes new blocks. It ensures that transactions are
correctly processed and that blocks meet the consensus criteria. The
responsibility of the validator includes maintaining the blockchain ledger,
handling transaction requests, and enforcing consensus rules.
5. Rest API: The consensus provides a set of HTTP endpoints for interacting with
the Sawtooth network. It allows developers to submit transactions, query the
blockchain state, and interact with the blockchain network programmatically.
6. Client SDKs: Software development kits provided for various programming
languages to interact with the Sawtooth network. It includes SDKs for
languages such as Python, JavaScript, and Java, facilitating application
development and integration with Sawtooth.
7. Transaction Family: Transaction family defines the rules and logic for
processing specific types of transactions. It includes transaction processors and
state handlers tailored to the needs of the application. Developers can create
custom transaction families to handle application-specific logic.
8. State Database: State database stores the current state of the blockchain,
reflecting the result of all processed transactions. Typically uses a database
system such as Apache Cassandra or RocksDB to manage and query state data
efficiently.
9. Sawtooth Runtime: It manages the execution of transactions and maintains
the global state. It includes the transaction processor and state database,
coordinating the execution and storage of transactions.
Dept., of CA 16 A.V.C.C.E
UNTI – 4 Prepared By MAV
10. Configuration System: The configuration system manages network
configurations and settings, including consensus parameters and network
topology. It allows dynamic updates to network configurations without
requiring a complete system restart.
Hyperledger Sawtooth Consensus Algorithms
✓ PoET (Proof of Elapsed Time): This is the default consensus algorithm in
Sawtooth. It uses trusted execution environments (TEEs) to ensure that
consensus is reached fairly and efficiently. Nodes (validators) are selected to
propose the next block based on a randomized waiting time.
✓ Each node waits for a random period before proposing a block. The node with
the shortest waiting time proposes the new block. Other nodes then validate
the block and its transactions.
----------------------------------------------------------------------------------------------------
Dept., of CA 17 A.V.C.C.E