Hyperledger

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

Hyperledger

Hyperledger is an open-source project under the Linux Foundation where people


can come and work on the platform to develop blockchain-related use cases.
According to Brian Behlendorf, executive director of Hyperledger
“Hyperledger is an open source community of communities to benefit an
ecosystem of hyperledger based solution providers and users focused on
blockchain related use-cases that will work on variety of industrial sectors”.

Introduction To Hyperledger

Hyperledger provides the platform to create personalized blockchain services


according to the need of business work. Unlike other platforms for developing
blockchain-based software, Hyperledger has the advantage of creating a secured
and personalized blockchain network.
● It was created to support the development of blockchain-based
distributed ledgers.
● It includes a variety of enterprise-ready permissioned blockchain
platforms.
● It is a global collaboration for developing high-performance and
reliable blockchain and distributed ledger-based technology frameworks.

Example:
Consider a situation when person X wants to buy medicine from person Y, who
was a doctor living in another country.
● As medicine requirement is one person’s private needs, they need to
maintain the data confidentially.
● But Dr. Y is selling medicine in the network to so many people, in the
case of the public blockchain, every transaction will get updated in the network to
all the peers.
● That’s where hyperledger finds its significance. In the hyperledger, the
parties are directly connected and the concerned people’s ledger will be updated.
● Hence providing privacy and confidentiality.
Why Do We Need Hyperledger?

Below are some of the reasons stating the need for a hyperledger project:
● To enhance the efficiency, performance, and transactions of various
business processes.
● It provides the necessary.
● It gets rid of the complex nature of contractual agreements, as the legal
issues are taken care of. infrastructure and standards for developing various
blockchain-based systems and applications for industrial us
● Hyperledger offers the physical separation of sensitive data.
● It decreases the need for verification and enhances trust, thus
optimizing network performance and scalability.

Hyperledger Technology Layers

Hyperledger uses the following key business components:


1. Consensus layer: It takes care of creating an agreement on the order
and confirming the correctness of the set of transactions that constitute a block.
2. Smart layer: This layer is responsible for processing transaction
requests and authorizing valid transactions.
3. Communication layer: It takes care of peer-to-peer message transport.
4. Identity management services: these are important for establishing
trust on the blockchain.
5. API: It enables external applications and clients to interface with the
blockchain.

How Does Hyperledger Work?

Hyperledger works in a way that a requirement for the contract can be initiated
through an application.
● The membership service involved in the network validates the
contract.
● The concerned two-peer has to produce a result and then sent it to the
consensus cloud.
● The generated result from both the peer has to be the same in order to
validate the contract.
● Once it is validated, then the transaction will happen between the
affiliated peers and their ledger will be updated.
● When a business requires confidentiality and a private network for its
transaction to happen without doing that in a single network, a hyperledger paves
the way.
This can be summarized as the peers who are directly affiliated with the deal are
connected and only their ledgers will get updated about the deal. The third parties
who help to carry out the transaction will only get to know the exact and required
amount of information with the help of regulations levied on the network.
Let’s understand the concept with the help of an example.
● Suppose Alice decides to send the product to Bob on a hyperledger-
based network.
● She looks at her app to locate the address of Bob on the network.
● The app in return queries the membership service and validates Bob’s
membership.
● The hyper ledger will connect both parties directly for the transaction
affiliated with the deal.
● Both parties will generate the result, which has to be the same for them
to get validated.
● The result will be sent to the consensus cloud to be ordered and
verified.
● Once the result is validated, Bob receives the product and the
transaction is committed to the ledger.[
Roles of Peers

In the hyperledger network, the peers are separated into three distinct roles at
two-run times. This distinct feature in this network makes notable changes as it
allows a high degree of personalization. The 3 peer roles are:
1. Committer: Appends validated transactions to their specific ledger.
They only add the transaction to the specific ledger once the transaction is
returned by the consenter.
2. Endorser: Endorser nodes are responsible for simulating transactions
specific to their network and preventing unreliable and non-deterministic
transactions. All endorsers act as committers on the other hand committer may or
may not be endorsers depending on network restrictions.
3. Consenter: Their role is to validate the transaction by verifying the
result produced by the affiliated peers who want to proceed with a transaction.
Their role is very specific and runs on separate run times, unlike committers and
endorsers who run on the same run time. Their role is to decide which ledger the
transaction be committed to.
Hyperledger Advantages

● Flexibility: Hyperledger provides a high degree of flexibility and


modularity, allowing developers to customize and configure the platform to meet
their specific needs.
● Security: Hyperledger has a strong focus on security, with features
such as access control, identity management, and encryption. This makes it well-
suited for enterprise applications that require a high level of security.
● Scalability: Hyperledger is designed to handle large-scale enterprise
applications, with the ability to support thousands of transactions per second.
● Privacy: Hyperledger allows for the creation of private, permissioned
blockchain networks, which means that only authorized participants have access
to the data on the network.
● Interoperability: Hyperledger provides a common platform for building
blockchain applications, which makes it easier to integrate with other systems and
applications.

Hyperledger Disadvantages

● Complexity: Hyperledger can be complex to set up and maintain,


particularly for organizations that are new to blockchain technology. This can
require significant technical expertise and resources.
● Limited decentralization: Hyperledger is a permissioned blockchain
platform, which means that only authorized parties can participate in the network.
While this can provide increased security and privacy, it also means that the
network is less decentralized than public blockchain platforms.
● Limited community: While Hyperledger has a growing community of
developers and contributors, it is still smaller than some other blockchain
platforms. This could make it more difficult to find support and resources.
● Limited smart contract functionality: Hyperledger offers limited smart
contract functionality compared to some other blockchain platforms. While this
may be sufficient
● for some use cases, it could be a disadvantage for organizations that
require more advanced smart contract capabilities.

Hyperledger Architecture
\1. Consensus Layer:
● Creates an agreement on the ordering and confirms the accuracy of the
transaction database that comprises a block.
● The communication layer is used by the consensus layer to
communicate with the client and other network peers.
● Confirms that all transactions in a proposed block are correct according
to approval and consensus policies.
● Interfaces with the smart-contract layer and relies on it to validate the
accuracy of an ordered transaction database in a block.
● They’re also widely utilized to synchronize data across a decentralized
network and assure transaction consistency and transparency.
2. Smart Contract Layer:
● The smart contract layer verifies each transaction by guaranteeing that
it \\adheres to the transaction’s policy and contract and invalid transactions are
denied and may be removed from consideration for inclusion in a block.
● Smart contracts are classified into two types:
● installed smart contracts- Before the network is launched, installed
smart contracts implement business logic on the validators.z
● On-chain smart contracts– On-chain smart contracts implement
business rules in the form of a transaction that is committed to the blockchain and
then invoked by subsequent transactions. The code that describes the business
logic forms part of the ledger with on-chain smart contracts.
● Responsible for executing transaction requests and determining
transaction validity through the use of business logic.
● In Hyperledger Fabric, a smart contract is a program known as
chaincode. Chaincode can be developed in Go, JavaScript (node. js), and, in the
future, additional programming languages such as Java that define a predefined
interface. Chaincode is run in a secure Docker container that is separate from the
endorsing peer process.

3. Communication Layer:
● Communication Layer is in charge of peer-to-peer message transfer
between nodes in a shared ledger instance.
● The communication layer is used by the consensus layer to
communicate with the client and other network peers.
● The algorithm must function exactly like a single node system,
executing each transaction atomically one at a time.
● If communication does not fail, then each non-faulty node will finally
get every submitted transaction.
● TLS is used for secure communication among nodes in the Fabric. TLS
communication can employ both one-way (server only) and 2 different (server
and client) authentication.

4. Data Store Abstraction:


● Allows other modules to use alternative data stores.
● the actual private data is kept in a private database on authorized
organizations’ peer nodes and accessed via chaincode on these authorized peers;
and a hash of the secret data, which has been endorsed, sorted, and recorded to
the ledgers of every peer on the channel.
As state databases, the Hyperledger fabric supports LevelDB and
s the default state database integrated into the peer activity and stores chaincode data as
key-value pairs.
● CouchDB is an optional external state database that adds query
capability when your chaincode data is modeled as JSON, allowing for rich
queries of the JSON content.
● When a deploy transaction succeeds, the chaincode is installed “on”
the blockchain.

5. Crypto Abstraction:
● Allows for the substitution of alternative crypto techniques or modules
without disrupting other modules.
● Because Fabtoken, a new functionality in Hyperledger Fabric version
2.0 (alpha), allows you to generate native cryptocurrencies or coins.
● Besu Hyperledger is a public Ethereum codebase that is open source
and may run on individual permissionless platforms or the Ethereum public
network. The Ethereum Virtual Machines (EVM), consensus mechanisms, user-
facing APIs, and monitoring are all included.
● CPU and GPU mining is supported by Hyperledger Besu and can be
enabled using command-line arguments. Ethminer with both the stratum+tcp and
getwork schemes was utilized for GPU mining support testing.
● It does not support cryptocurrencies such as bitcoin, but it functions by
providing the infrastructure and standards required for the development of various
blockchain-based applications and systems for industrial usage.

6. Identity Service:
● Allows for the formation of a trusted root during the configuration of a
blockchain instance, the enrolment and registration of identities or systems
entities during network operation, and the administration of changes such as
drops, additions, and revocations. It also offers authentication and permission.
● The smart contract layer employs the identity services layer to
authenticate and approve the entity requesting to execute the smart contract while
processing the transaction.
● Hyperledger Fabric provides a personal identity service that handles
user IDs and authenticates all network participants to enable permissioned
networks. Access control lists can be utilized to add layers of permission by
authorizing certain network actions.
● Certification Authorities are in charge of managing certificates (or
CA). Fabric CA is Hyperledger’s Certification Authority

7. Policy Service:
● Policy Services is in charge of policy management for the system’s
numerous policies, including the endorsement policy, consensus policy, and
group management policy. It communicates with and is dependent on another
module to enforce the different policies.
● Fabric policies reflect the process through which members agree to
approve or reject changes to the network, a route, or a smart contract. Policies are
agreed upon by channel members when the channel is first set up, but they can
also be changed as the channel evolves.
● Policies are one of the features that distinguish Hyperledger Fabric
from other blockchains such as Ethereum or Bitcoin. Transactions in those
systems can be generated and confirmed by any node in the network.

8. API: (Application Programming Interface)It enables clients and applications


to interface with blockchains. there are three types of API used in hyperledger
they are:
● Admin API: This class establishes a management link to a
Hyperledger Composer runtime. The link can then be used to Install
BusinessNetworkDefinitions and deactivate Business network definitions Refresh
BusinessNetworkDefinitions and Ping the runtime to confirm it is up and running
and properly configured In the connection profile storage, save a connection
profile document.
● Common API: The Common API comprises the APIs that are used to
access information about the Business Network to which you are connected as
well as to establish new assets, participants, transactions, and events. It also offers
APIs for obtaining information about these resources.
● Runtime API: All transaction functions have access to the Runtime
API. It provides API access to build and issue queries, emit events, retrieve all
forms of registries, get the current participant, and get the serializer to produce
resources from JavaScript objects. – execute HTTP REST calls.

9. Interoperation:
● Allows separate blockchain instances to communicate with one
another.
● Interoperability, supported by comprehensive data and transaction
standards, is required to capitalize on this powerful technology. The food
industry, for example, has made tremendous progress in leveraging data standards
to promote food safety and product visibility use cases.
● Interoperability and integration are currently top-of-mind challenges in
the blockchain sector.

Overview of Hyperledger projects

Below are some of the hyperledger projects:


1. Hyperledger Burrow
● Similar to the Ethereum Virtual Machine, Hyperledger Burrow offers a
flexible blockchain client with a permissioned blockchain-based interpreter.
Monax initially contributed and Intel co-sponsored.
● Burrow’s declared goal is to support the operation of permissioned
networks that are ‘open to the public.’ With Burrow’s permissions approach,
there are numerous shades of grey in terms of network involvement.

2. Hyperledger Iroha
● Hyperledger Iroha is focusing on mobile application development and
Sumeragi, a revolutionary chain-based Byzantine Fault Tolerant consensus
mechanism. Soramitsu, Hitachi, NTT Data, and Colu are working on this project.
● Hyperledger Iroha is a corporate blockchain platform built for
distributed ledger infrastructure initiatives. The Iroha platform can be used to
create an identity management system, such as national ID cards.

3. Hyperledger Indy
● Hyperledger Indy is a distributed ledger designed specifically for
decentralized identification. Evernym contributed the indy code base that he
created to the Sovrin foundation.
● It offers tools, frameworks, and reusable components for developing
and deploying autonomous digital identities based on blockchains or other
distributed ledgers. Hyperledger Indy is a distributed ledger designed specifically
for decentralized identity.

4. Hyperledger Fabric
● Hyperledger Fabric is led by IBM. Hyperledger Fabric is a plug-and-
play blockchain technology implementation with a configurable degree of
permissions. The Linux Foundation manages this private and confidential
blockchain framework.
● Hyperledger Fabric is a scalable, flexible architecture-based platform
for distributed ledger applications. It is designed to allow for pluggable versions
of various aspects and to manage the financial ecosystem’s complexities and
intricacies.

5. Hyperledger Grid
● The Hyperledger Grid is an ecosystem of technologies, frameworks,
and libraries that collaborate to allow application developers to choose which
components are most suited to their industry or market model. Cargill is spending
resources on the project’s development.
● The Hyperledger Grid platform is used to create supply chain solutions
that integrate distributed ledger components. It offers an expanding range of tools
that help to expedite the development of supply chain smart contracts and client
interfaces. This is not a distributed ledger or a client application implementation.

6. Hyperledger Sawtooth
● Hyperledger Sawtooth is a flexible platform for developing,
implementing, and running distributed ledgers, and it features a revolutionary
consensus mechanism known as Proof of Elapsed Time. This consensus is
suitable for large distributed validator groups while consuming few resources.
● Intel is working on this project. Hyperledger Sawtooth is an open-
source industrial blockchain-as-a-service platform that can run customized smart
contracts without requiring knowledge of the core system’s underlying design.

Hyperledger Tools

Below are some of the hyperledger tools


1. Hyperledger Composer
● Hyperledger composer is a collaborative tool for creating blockchain
business networks, facilitating smart contract development and implementation
across a distributed ledger.
● Composer is a software development framework that makes it easier
and faster to create Hyperledger fabric blockchain apps. A business person with
little technical understanding can collaborate with a developer to build particular
aspects using Hyperledger Composer.

2. Hyperledger Cello
● The goal of Hyperledger Cello is to apply the on-demand as-a-service
methodology to the blockchain in order to simplify the effort required for
building, managing, and ending blockchains. IBM, Soramitsu, Huawei, and Intel
were the first to contribute to this project.
● Hyperledger Cello is a blockchain provisioning and operation
technology that aids in the effective management of blockchain networks. Cello is
a blockchain module toolbox and one of The Linux Foundation’s Hyperledger
initiatives.

3. Hyperledger Explorer
● Hyperledger Explorer generates a user-friendly Web application that
allows you to view, launch, deploy, and query blocks as well as any other
relevant stored data on the ledger. IBM, Intel, and DTCC initially contributed to
this initiative.
● Hyperledger Explorer is an open-source blockchain utility module that
allows users to query various blockchain artifacts and advancements. It is
intended to be used particularly on Hyperledger-based blockchain
implementations.

4. Hyperledger Caliper
● Hyperledger Caliper is a blockchain benchmarking tool that enables
users to assess the performance of a blockchain implementation against a set of
predefined use cases. Huawei, Hyperchain, and Oracle have contributed to the
Hyperledger Caliper performance benchmark tool for the Hyperledger project.
● By boosting the transparency and traceability of network transactions,
Hyperledger Fabric networks can enhance supply chain processes. Companies
with access to the ledger on a Fabric network can see the same immutable data.

5. Hyperledger Ursa
● Hyperledger Ursa is a distributed cryptography framework that allows
people and projects to avoid duplicating cryptographic work. This project is being
worked on collaboratively by fabric, Indy, and sawtooth developers.
● Within Project Ursa, developers have access to a complete library of
modular signatures and symmetric-key primitives, allowing them to swap in and
out different cryptographic methods through the setup and without having to
rewrite their code.
Hyperledger Libraries

1. Hyperledger Aries: The Hyperledger Aries architecture supports


blockchain-based peer-to-peer interactions. It provides a shared cryptographic
wallet (safe storage technology, not a user interface) for blockchain clients, as
well as a communications protocol for off-ledger transactions between those
clients. This project makes use of Hyperledger Ursa’s cryptography support to
provide secure secret management and decentralized key management capability.
2. Hyperledger Quilt: Hyperledger Quilt is a Java-based tool for
interoperability between transparent and open that implements the ILP for atomic
swaps. While the Interledger protocol is used to make transactions between
ledgers, the ILP protocol is used to transfer value across non-distributed and
distributed ledgers. The Interledger protocol’s standards and specifications are
managed by the open-source community under the Global Internet Consortium
umbrella.
3. Hyperledger Ursa: Within Project Ursa, developers have access to a
complete library of modular signatures and symmetric-key primitives, allowing
them to swap in and out different cryptographic methods through the setup and
without having to rewrite their code. Ursa’s base library is supplemented with
contemporary cryptography, such as pairing-based, threshold, and aggregate
signatures.
4. Hyperledger Transact: Smart contracts can be executed using
Transact regardless of the DLTs used. Transact accomplishes this by providing an
extensible approach to developing additional smart contract languages known as
“smart contract engines.” As a result, each smart contract engine includes a
virtual machine or interpreter for smart contracts.

Benefits of Hyperledger Architecture

1. Productivity Enhancement: To accelerate project development,


Hyperledger employs the division of labor technique. It determines everyone’s
strong suits and, based on that, places them in specialized fields.
2. Handling Of Intellectual Property: Hyperledger functions as a
blockchain greenhouse by bringing vendors, developers, and consumers from all
around the world together on a single platform.
3. Data On A Need-To-Know Basis: Data partitioning on the blockchain
allows for the privacy of data pieces. It provides physical isolation of sensitive
data. Hyperledger-supported channels allow data to be distributed exclusively to
people that need to know.
4. Rich Querying Capability: It is made up of a key-value database.
CouchDB is also an option. It is a document database that stores content in JSON
format. This allows for simple database queries. Its data model works with the
current key/value programming approach.
5. Anonymity: The network only allows signature read-write sets to pass
through. This helps to ensure anonymity because only the users and peers
committing the transactions can see the transactions.

Limitations of Hyperledger Architecture

1. Lack of Developers: It lacks highly qualified programmers due to its


origin, whereas Ethereum has a greater number of developers because of its
popularity.
2. Lack of use-cases: It has shown a lack of use cases such that more a
lack of awareness of technology and its possibilities, a scarcity of personnel and
skill sets in IT and business.
3. Complex architecture: It has a sophisticated design, while
Hyperledger, which is backed by IT titans, is only focused on enterprise
transaction-based applications.apk
4. Minimum APK: API allows client apps to communicate with
Hyperledger Fabric blockchain network smart contracts, but with fewer APIs.
5. Less fault tolerance: The job of Byzantine fault tolerance is to ensure
that each peer has the same list of transactions on its ledger, however, it is not
suited for network use.

Application of Hyperledger
1. Finance: Hyperledger can be used to streamline the settlement of
transactions, improved liquidity, and provide increased transparency by
eliminating the need for accounts on particular payment systems at a low cost.
2. Healthcare: Hyperledger can be utilized to cut expenses, improve
patient care, and increase data accessibility.
3. Supply Chain: Using Hyperledger, organizations may create
initiatives that aim to limit the prevalence of counterfeit goods while also tracing
the provenance of components and services.
4. Insurance: The Insurance firm can refer to the transaction data
recorded in the ledger using Hyperledger. Hyperledger Fabric may also use chain
code to speed up claim processing and automate payment.
5. Digital payment: Interledger and other Hyperledger applications have
the potential to set new standards in the finance sector. More importantly, it has
the potential to revolutionize two-party cross-border payments.

Consensus in Hyperledger Fabric

Hyperledger Fabric is a Distributed Ledger technology developed by Linux, it is


open-source and enterprise-grade. It was primarily developed to help in the
development of Decentralized Applications that use Blockchain Technology.
Consensus plays a vital role in Hyperledger Fabric because it confirms the
agreement of all the participants (blocks) in a network based on the validity of the
transaction happening and the current step of the ledger. The article focuses on
discussing the consensus in Hyperledger Fabric.

What is Consensus?

The term “consensus” means an agreement or a decision taken by a group of


individuals. It also states that regarding a certain topic or problem, all the
members of a team or group have come to the conclusion that everyone will
accept the certain way or method using which they will solve the problem.

● Consensus is taken into account in certain situations where to solve a


particular problem or reach a goal or something, an entire group or team is
involved, and there are at least two different opinions on how to solve the
problem or reach the goal.
● Blockchain Technology depends heavily on consensus mechanisms. As
the transaction will not happen if all the blocks or nodes of a blockchain come to
an agreement that the transaction is done by some authorized personnel and not
any hacker, and then only the transaction occur successfully, if any one of the
blocks or nodes doesn’t agree with others, then the transaction will not happen.

This is why Consensus is very important in the case of Blockchain Technology


and Hyperledger Fabric.

Comparison of the Different Types of Consensus:


Consensus Name
Brief Description Advantages Disadvantages

1. Very high energy


1. Very secure dueconsumption,
to which
complex mathematical
affects the environment.
Here, the miners solve
processes.
complex mathematical
2. Slow transaction.
Proof of Work
problems and whoever
2. It is Decentralized
solves it first gets to add
3. Vulnerable to attacks if
and used in major
the block to the Chain.
cryptocurrenciesonlylikeone person controls
Bitcoin. the majority of the mining
and adding.

Proof of Stake
Here, validators,1.i.e.
Environment-friendly
1. Those “Validators”
miners are invited to and
create
energy efficient.
who have a greater
a new block based on the “stake” have greater
number of 2. Faster transaction
control over the chain.
cryptocurrencies theyspeed
put compared to
at “stake.”
PoW.
2. Those who put bigger
stakes receive bigger
3. Not vulnerable to
rewards.
51% attack

1. As it depends on
voting, those who get the
1. Scalable and Fast
maximum votes hold
Everyone is given the
transaction. most of the power.
opportunity to vote for a
Delegated Proof
limited
of amount of people
2. uses less energy
2. Due
thanto this there might
Stake who are responsible for
PoW and is morebe some problems
new block creation and
decentralized than
between them. People
validation.
normal PoS.tend to vote less so that
they could be selected as
a candidate.

ProofConsensus
of which is used1.inAnyone can
1. Finding the importance
NEM Blockchain. participate.
Considers both the number of an account becomes
of coins held as well2.asThose
the who actively
tough sometimes.
Importance
number of transactionsparticipate and
contributes gets
done by a single account 2. Prone to Sybil attacks
while creating a block. rewarded.

1. Miners allocating more


space has the advantage.
1. Energy efficiency as
compared to PoW.
Miners need to use their 2. Setup cost is high as
Proof of Capacity/
own storage to solve and the miners need to use
Proof of Space 2. The more storage
my cryptocurrencies. their own device’s space.
they use, the better
rewards they get
3. Miners can have some
evil intentions.

Proof of Elapsed
This is developed by Intel,
1. Energy efficient.
1. Requires trusted
hardware (mostly Intel’s
own hardware).
here the miners need to
prove that they have 2. Limited
Time 2. easily scalable.
waited a certain amount of decentralization.
time.
3. Prone to time
manipulation attacks.

1. Uses the advantages


Combination of both PoW
of both PoW and PoS.
1. Implementation is
and PoS. PoW is used for
complex.
Hybrid Proof
block
of creation due to its
2. More secure due to
Activity
secure nature, PoS is used
the use of PoW2.and
Centralization risk due
for validation due to its
energy efficient duetotothe use of PoW.
energy efficiency.
the use of PoS.

Proof of Authority
The network approves
1. High transaction
1. It relies upon very few
some Block validatorsthroughput
who with low validators.
latency.
validate already created
2. Less censorship due to
blocks and can also create
2. Efficient, Scalable,
more centralized control.
new blocks.
uses less energy

1. Alternative of PoW
1. Destruction process
and PoS. can’t be reversed.
Miners burn coins
allocated to them by the
Proof of Burn 2. Due to burning, 2. Limited use
network to earn the rights
reduces the supply of
to mine blocks.
coins, the value of3.coins
Distribution of coins
increases might not be the same.

Byzantine Fault
Even if there are faulty
1. High fault tolerance.
1. Limited scalability.
Toleranceblocks, a consensus is
2. Fast
reached amongst others so and efficient
2. Communication

that the network works. finality. overhead increases with


the increase in number of
nodes.
3. Compatible with
permission and private
3. Requires a set of
networks
trusted nodes.

Consensus and Its Interaction with Other Architectural Layers

1. Network Layer

Every consensus requires smooth and reliable communication between each node
in the network to reach an agreement. Networking protocols are used to exchange
information and do transactions.

2. Data Layer

Every node in the network consists of validated transaction information,


consensus protocol ensures the order of these blocks by discussing with other
nodes.

3. Cryptography Layer

Cryptography plays a crucial role in doing transactions and keeping the network
secure. Different techniques like Hash Function, Digital Signature, etc. are used
in various consensus mechanisms.
4. Smart Contract Layer

These are executed based on the condition of the network, consensus mechanisms
ensure the state of the network which ensures consistent execution of transactions
among each node.

5. Incentive Layer

Many consensus mechanisms use Incentive mechanisms or reward mechanisms


to encourage more miners to join.

6. Governance Layer

Some mechanisms of voting are used to select miners, validators, etc. This layer
controls all the governance-related things such as voting to select the miner,
upgrading the network protocols, etc.

7. Security Layer

The use of the Proper consensus mechanism plays a vital role in securing the
network.

8. User Interface Layer

This provides information about the current state of the network i.e. entire
Blockchain. The consensus mechanism makes sure that all the nodes are in a
stable state and that the transactions are happening smoothly.
Property of Consensus:

There are two properties of Consensus that must be satisfied to guarantee


agreement among the participating nodes/blocks. They are:

1. Liveness

Liveness means that all the participating nodes in the network will receive
complete information regarding the transaction that is happening so that they can
agree to that, and the transaction is moved to the next node.

2. Safety

Safety means that each participating node must receive the same sequence of
input and input details and the same sequential output. When a single node
receives some sequential input from another node, it changes its state, and all the
states of each node should be identical in the entire network. Which signifies that
the transaction has been done by an authorized party and is valid.

3. Finality

It ensures that after a transaction has been made and validated and stored in the
block, it can’t be reversed.

4. Decentralization
It means distributing the ownership and decision-making capability amongst the
participants of the network. So that no one can single-handedly manipulate the
network.

5. Scalability

It means that the consensus can handle the growing number of nodes in the
network without causing any problems.

6. Energy Efficiency

Being energy efficient is very important as the number of nodes is growing very
fast, miners need to keep in mind that the mining process doesn’t harm the
environment heavily.

Phases of Consensus in Hyperledger Fabric:

There are three phases of consensus used in Hyperledger Fabric.

1. Endorsement

Endorsement works on the principle that how many nodes vote for the transaction
to be valid, i.e., endorse it. It is like collecting signatures for a petition. The more
there are the stronger the support for the petition. This logic is used here, the
more endorsements by nodes, the sure you are that the transaction is valid.

2. Ordering
The ordering phase comes after the Endorsement phase, it agrees to the sequential
order of the execution of the Hyperledger decided earlier.

3. Validation

Validation, as the name suggests, is the validation of the data stored in any node.
It takes into account the nodes in which the transactions are occurring in the order
decided in the earlier stage. Checks the input and the result stored in the node and
gives validation.

Phases of Consensus:

1. Electing a Leader: Deciding and Electing a leader is one of the most


important things in any Distributed Network because that leader will be
responsible for carrying out the consensus process and trying to convince
everyone to agree on a certain conclusion so that the network can be formed.
2. Proposal and Acceptance: After electing the leader, they will propose
a condition to the other nodes upon which they will agree or share their views to
reach a consensus.
3. Agreement: When the majority of the follower nodes accept the
decision made by the elected leader, the consensus stage is achieved.
4. Commitment: Once the consensus is reached, all the follower nodes
are committed to follow what has been agreed upon. In a system like Kafka, these
agreed-upon values are either committed to the database or added to the log.

THE NETWORK TOPOLOGY


Hyperledger Fabric forms a decentralized network. Participating organizations
have their own roles in the network and manage different nodes. The diagram
presents one of the simplest and probably the most common network topology,
when the root organization is responsible for both the network membership and
the consistency of the state.There are basically three most important node types in
the Hyperledger Fabric network. Certificate Authorities (CA) connect the whole
network via certificate's chain of trust. Orderers maintain the consistency of the
state and create blocks of transactions. Peers store the ledger, which consists of
the transaction log (i.e. the blockchain) and the world state. channel is a key
abstraction in Hyperledger Fabric. It forms a kind of subnet in the network
isolating the state and smart contracts. All peers belonging to a channel have
access to the same data and smart contracts. There is no access to it outside the
channel.

NODE TYPES

Certificate Authority (CA)

Typically CA nodes form a tree-like topology with Root CA at the top. Root CA
is a self-signed instance. CAs that belong to other organizations are signed by
Root CA. All other nodes need to be signed by respective CAs to become part of
the blockchain network and each user needs a valid certificate to interact with the
network.
Hyperledger provides a reference implementation of CA, however, it may be
replaced by any CA that can generate ECDSA certificates. You can also connect
it with the LDAP repository or attach an HSM (Hardware Security Module) to it.
Read more in the documentation.

Note that the user information from CA is included in the certificates, and the
certificates are attached to every invoked transaction and therefore stored in
blockchain. Since blockchain is immutable, you cannot remove the certificates.
You cannot provide sensitive information to CA if you want your blockchain to
be GDPR-compliant.

Orderer

Orderers or ordering nodes form an ordering service. It is responsible for keeping


the blockchain state consistent and final. They guarantee the single global order
of transactions in the chain. Since the ordering service is separated from the
peers, it gives many advantages regarding Hyperledger Fabric network
performance and scalability.

Besides, orderers play a significant role in managing access to the channels. They
keep a system channel that contains access control lists (ACLs) of organizations
that can create channels. They restrict who can configure, read, and write data to
particular channels.

Peer

Peers are fundamental nodes in the network since they host copies of ledgers and
smart contracts. The blockchain itself, i.e. an immutable log of transactions, as a
part of the ledger is stored on peers. Typically, an organization will have multiple
peers to have a redundancy of data and handle a high load.

A peer belongs to one organization, can belong to multiple channels, and can host
multiple ledgers and smart contracts.

Peers forward smart contract calls to dedicated chaincode containers in the


network and update the network state on the basis of smart contract results.

Peers can be connected to orderers to receive new blocks of transactions and


update the local blockchain copy, however, it is not necessary. Instead, they can
synchronize the state with other peers via p2p gossip protocol.

You can read more in the documentation about peers.


Other node types

Hyperledger Fabric network may contain other node types as well. Each CA
might use an embedded LevelDB database or a dedicated PostgreSQL node. Each
peer can use an embedded LevelDB database or an external CouchDB. Finally,
each chaincode for a peer forms an additional container in the network.

Then, you may want to add some monitoring to the network - Prometheus for
metrics exposed by the Hyperledger Fabric, Graylog or Kibana for collecting the
logs. Then, there are additional tools that might be useful like block browser,
benchmark tools, and others.

You might also like