Uniti Iv Hyperledger
Uniti Iv Hyperledger
UNIT 4 HYPERLEDGER
Hyperledger Fabric:
Introduction - Fabric v/s Ethereum – Hyperledger Iroha - Features of Iroha.
Hyperledger Sawtooth:
Components of sawtooth - Proof of Elapsed time.
Introduction
What is Hyperledger Fabric?
Since Fabric is the permissioned Blockchain it has some major advantages over
other blockchain systems.
Fabric Architecture
Blockchain developer codes Application and Smart Contract
He deploys the app on a server and smart contract on a peer
using DEPLOY
A registered user interacts with the app sending order (INVOKE) or
retrieving information (QUERY) through the smart contract
Smart contract can emit an event subscribed by the app
How Hyperledger Works?
Hyperledger can host almost any type of business network. With the scalability
as an advantage, a number of use cases are being developed on the Fabric.
Use Case: Interoperability of Assets
Description: Interoperability of assets means the exchange of assets among a
group of people.
Problem statement: If an organization requires 20,000 units of asset B but
instead owns 10,000 units of asset A, it needs a way to exchange asset A for
asset B. Though the current market might not offer enough liquidity to fulfill
this trade quickly, there might be plenty of liquidity available between asset A
and asset C, and also between asset C and asset B.
Now there are market limits on direct trading between A & B, so what can be
the probable solution?
Solution: In this case, a chain network connects buyers with “buried” sellers,
finds the best match (which could be buried under several layers of assets), and
executes the transaction. So basically a business network of a group of
individuals can be set up on the Hyperledger Fabric and the assets can be
exchanged among the buyer and the sellers.
Hyperledger vs Ethereum
What is Hyperledger?
MC4013 Cryptocurrency and blockchain technologies
Every business and industry is distinctive in their own way and the applications
serving to their needs must be personalized. The Ethereum Blockchain works
with a very generalized protocol for everything that runs on its network. You
can think of Hyperledger, on the other hand, as a software for people to develop
their own personalized blockchains tending to the needs of their businesses.
Hyperledger is an open source collaborative project hosted by The Linux
Foundation. It is neither a tool nor a platform like Ethereum. It’s an umbrella
strategy with multiple platforms for developing enterprise solutions.
Purpose:
The most essential distinction between Hyperledger and Ethereum is the intent
they are designed for.
Ethereum runs the Smart Contracts on the EVM for applications that are
attributed to being decentralized and are for mass consumption.
On the other hand, Hyperledger leverages blockchain technology for business.
It is designed to support pluggable implementations of components delivering
high degrees of confidentiality, resilience and scalability. Hyperledger has a
modular architecture and provides a lot of flexibility in how you want to use it.
Its extensible architecture provides futuristic solutions for enterprise
blockchains.
Confidentiality:
Let’s say Andy runs a pie manufacturing industry on blockchain.
MC4013 Cryptocurrency and blockchain technologies
Such an arrangement would not be possible if Andy was using Ethereum for the
same. Because Ethereum is absolutely transparent and every transaction is
visible to everyone on the network.
Thus, Hyperledger allows confidential transactions. Consequently, it gives
businesses the flexibility and security to make transactions visible to select
parties having correct encryption keys.
This means that in Ethereum, anybody can participate in the network at any
time. But Hyperledger has a predefined community of participants, and access
to the network is restricted only to them. One requires permission to join the
network. This mode of participation has a profound impact on how consensus is
reached.
Consensus Mechanism:
With Ethereum, all the network participants (or nodes) have to reach consensus
over all the transactions. This is irrespective of whether a node takes part in a
particular transaction or not. Presently, Ethereum’s establishes its consensus
mechanism by mining based on the Proof-of-Work (PoW) algorithm. All the
nodes have to agree upon a common ledger and all of them have access to all
entries ever recorded.
MC4013 Cryptocurrency and blockchain technologies
Programming Language:
Another key difference is the use of Smart contracts in Ethereum, written in a
high-level contract-oriented language called Solidity.
However, in Hyperledger you can use the term “chaincode” as a synonym for
smart contract. A chaincode typically handles business logic agreed to by
members of the network, so it may be considered as a smart contract. These
chaincodes are written in Golang, a programming language created by Google.
Cryptocurrency:
Hyperledger doesn’t require cryptocurrencies for transactions. It doesn’t have a
built-in native cryptocurrency like Ethereum’s token, Ether. Hence, there is no
requirement of mining at all. This allows for scalable consensus algorithm that
is capable of handling high transaction rates required by most enterprise
applications. But, looking at both sides of the coin (or token, eh?)
since Ethereum has its own ether, it can be advantageous over Hyperledger in
the use cases which require a cryptocurrency.
MC4013 Cryptocurrency and blockchain technologies
chaincode to automate business processes across your network. You could also
develop custom tokens via chaincode, if required.
Hyperledger Iroha
Iroha is for building secure, robust, and trusted decentralized applications using
the Byzantine Fault-Tolerant (BFT) Consensus algorithm. It provides a set of
fast commands and queries for common operations for digital asset identity
management. Its applications include interbank settlements and logistics.
It is useful for apps like central bank digital currencies, national IDs, logistics
and interbank settlement.
Iroha does not have any native cryptocurrency; instead, its interaction with the
system is permissioned so that only people with access can participate in the
system. Moreover, queries are permissioned, enabling data access control. With
prebuilt commands, Hyperledger Iroha allows users to do tasks like creating and
transferring digital assets.
Using Iroha, a business can create and manage simple digital assets like any
standard cryptocurrency or complex ones like indivisible rights, certificate
authenticity, and patents.
Certifications
Iroha allows building certifying identities, which enables granting as well as
verification of various certificates issued to individuals by educational and
healthcare institutes. A candidate's university degree can be stored on the
blockchain, and any qualifying hiring agency or employer can be given
verification rights to authenticate the candidate's information during the hiring
process.
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. For instance, the current owner of
a vintage car can create a digital asset that represents the vintage car on the
blockchain and then link its ownership to themself. To transfer ownership, they
can then create an offer using a multi-signature transaction, which includes the
cost of transfer in a particular currency. The interested counterparty can accept
the offer on the blockchain and complete the transaction by transferring the
currency to the present owner, and receive the ownership of the car in return.
MC4013 Cryptocurrency and blockchain technologies
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
In this way, Iroha can offer an alternative to Ethereum’s smart contracts, which
may require writing cumbersome code. The same can be achieved quickly and
simply by using the built-in commands in Iroha to complete common tasks
more quickly and with lower complexity and lower risk.
Sawtooth enables selective permissions – that is, one can easily deploy certain
select clusters of Sawtooth nodes with different permissions on the same
MC4013 Cryptocurrency and blockchain technologies
blockchain. The ledger stores the necessary details about the permissions,
nodes and identities.
The operating performance of the Sawtooth network is boosted by the
mechanism of parallel transaction execution, which has an upper hand over the
serial execution mechanism that often is a bottleneck when dealing with high
volumes of transactions on many popular cryptocurrency networks.
Sawtooth supports Proof of Elapsed Time (POET) consensus mechanism that
offers benefits of low resource utilization and low energy consumption, and is
commonly used on the permissioned blockchain networks to decide the mining
rights or the block winners on the network. (For more, see Proof of Elapsed
Time.)2
Some real-world examples using Sawtooth-based applications include
Sawtooth Supply Chain, which helps an enterprise keep track of contextual and
logistics-related information of an asset represented on the
blockchain, Sawtooth Marketplace, which helps participants trade in specified
quantities of digital assets on the blockchain, and Sawtooth Private UTXO,
which facilitates digital asset creation and trading, including off-ledger and
privately-held transactions.
1. Clients
3. Transaction Processors
Transaction processors handle business logic and they have the authority to
allow or decline transactions from being added to the state. When a client
interacts with the network by sending a transaction, these validate the
transactions, apply the changes, and add them into the next block. Validator
nodes make sure if the signature of a transaction is valid.
It also allows adding additional logic in the transaction processor to check more
specific requirements. For a transaction processor to process transactions,
transaction handlers need to be added. Handlers can be summoned in two ways:
one is the “apply method” and the other one is the metadata method. Metadata
helps connect a handler to the processor. However, the bulk of the handler is
made up of apply and its other helper functions.
4. Consensus engine
The consensus API of Sawtooth has been entirely redesigned. It has been
moved to a separate process termed the ‘consensus engine.’ It is an interface
which includes the feature of language independence for consensus algorithms.
Consensus engines enable more consensus option for Sawtooth. Network
MC4013 Cryptocurrency and blockchain technologies
deployment tools have been updated. Consensus engine operates on its own
separate processes like REST API and transaction processors.
5. Validator
Ensure that the node or network participant gets the random waiting
time indeed.
Check if they are not choosing the shortest waiting time on purpose.
Verify if the node has completed the given waiting time or not.
Let’s dig a bit deeper into working on the Proof of Elapsed Time mechanism.
ensures their waiting time ended, and now they can forge a new block. When
the node wakes up, it submits the block and a cryptographic test to the PoET
controller for verification.
A newly proposed block selects if the controller approves the newly proposed
block by the first woken up node. Else it gets discarded. And then, the selection
process of assigning waiting time starts again.
Let’s break down the process more accurately into steps.
Selection Process
Generation Process
Afterthe time object ends and the node wakes up, it’s eligible to forge a
new block to the network.
The active node generates the hash (using a hash function like SHA-256)
of its block of transactions and submits it for acceptance. It doesn’t
require showing computation work done by the node.
Afterward, the update gets flooded to the network.
MC4013 Cryptocurrency and blockchain technologies
Proof of Work (PoW) demands computation work from nodes (or miners) to
become eligible for adding a new block. On the other hand, PoET randomly
selects the among participating nodes by distributing waiting time objects. Here,
each node is equally eligible to mine a new block.
PoET is way more time and energy-efficient than PoW. It is backed by one of
the renowned technology giants, Intel corporation, which makes it more trusting
and reliable.