Hyperledger Fabric - A Complete Step by Step Guide

Wolfie Zhao
Mar 18, 2020 at 06:49 PM
Updated Mar 19, 2020 at 11:06 AM

Greetings to my fellow readers, crypto geerks, and blockchain enthusiasts, 

This article is gonna be a complete guide to one of the most popular hyperledger frameworks, Hyperledger Fabric. If you don’t have an idea about what is hyperledger fabric, where it can be used, and how it works, then keep on reading this guide, you will find answers for all the questions in the end.

Contents

  1. What is Hyperledger Fabric?
     
  2. Hyperledger fabric architecture
     
  3. How hyperledger fabric works
    • hyperledger fabric performance
       
    • Transactions in hyperledger fabric
       
  4. Hyperledger fabric use cases
    • Industry Adoption
       
  5. Hyperledger Fabric 2.0
    • Hyperledger Fabric Highlights
       
  6. Who We Are?

Hyperledger and Its Frameworks 

Before understanding the hyperledger fabric, let us have a glance about hyperledger technology and its other frameworks.

Hyperledger is an open-source collaborative blockchain project which is powered by Linux foundation. It was first introduced in 2015, and with the support of IBM, SAP, Intel, and more contributors, the project has been lifted to the next level to enhance the blockchain-based distributed ledgers. The ultimate objective of the projects is to improve the cross-industry collaborations with the advancement in developing blockchain-based distributed ledgers

So to fulfill the objective, the following frameworks and tools have been released one by one. In that list of frameworks, hyperledger fabric has grabbed a unique place in the middle of blockchain-based application developers here is the list of frameworks and tools.

Hyperledger Frameworks

  1. Hyperledger Sawtooth
     
  2. Hyperledger Burrow
     
  3. Hyperledger Fabric
     
  4. Hyperledger Indy
     
  5. Hyperledger IROHA
     
  6. Hyperledger Grid

Hyperledger Tools

  1. Hyperledger Caliper
     
  2. Hyperledger Cello
     
  3. Hyperledger Composer
     
  4. Hyperledger Explorer
     
  5. Hyperledger Quilt
     
  6. Hyperledger URSA

We will explain all the frameworks and tools one by one in upcoming articles.

What Is Hyperledger Fabric?

Hyperledger fabric is a framework in the hyperledger family. It can be known as an enterprise-grade permissioned distributed ledger framework, with a large set of industry use cases. It is a foundation for developing cross-industry blockchain applications with modular architectures. Hyperledger fabric has some plug and play components, such as consensus, membership services, and privacy. Hyperledger fabric offers modular, scalable and secured platforms for private transactions between the nodes inside peer to peer permissioned networks. 

It can be a little bit confusing while reading the definition, let me convey in layman terms, 

In general frameworks, are a set of components like tools, libraries, and some specific inbuilt features. So, Hyperledger fabric is also such a kind of open-source framework, which can be used to build blockchain applications for various industries. So, that we can say hyperledger fabric as a cross-industry blockchain framework. While a framework comes as an open-source, for cross-industry applications, it should ensure the privacy and security for the transactions between the users (So-called nodes). Hyperledger fabric fulfills privacy along with the implementation of specially made “chain codes” which are known as smart contracts.

Hyperledger Fabric Architecture
 

Hyperledger Fabric Archietecture
 
Source : Demystifying Hyperledger Fabric (1/3): Fabric Architecture
 

Components of Hyperledger Fabric Architecture
 

Source: Hyperledger Fabric component design
 

Membership Service Provider

Membership Services Provider, acts as an authenticator. It sets the rules to validate the User ID’s, of clients who want to join the network. MSP uses the power of certificate authority for client's validation. 

  • Local MSP
  • Channel Level MSP

Client
Clients are the front end applications, and propose transactions to the network on behalf of a user. Client Use Fabric SDK, to propose transactions and receive responses.

Certificate Authority (CA )
CA manages user certificates. Registration, enrollments, and revocations. The default certificate authority of fabric is Fabric- CA API. 

Peer
It is a node that commits transactions and maintains a copy of a ledger inside the network. It received order updates from the orderer and maintains the world state. There are four types of peers, 

  1. Endorsing Peer
  2. Committing Peer
  3. Anchor Peer
  4. Leading Peer

Orderer
Orderers take responsibility to order the transactions that happened on different timing intervals and send the ordered collection endorser to register the transaction in a block. There are three ordering mechanisms used in the fabric. They are, 

  1. SOLO
  2. Kafka
  3. SBFT

Nodes
There are three types of nodes, 

  1. Clients, 
  2. Peer
  3. Orderer

Fabric SDK
It is the medium for client applications and blockchain networks to communicate with each other.

Channels
Channels are the gateway for multiple organizations to participate in the same network, by maintaining the separation between multiple blockchains. 

Ledger
It is a journal of transactions, it keeps all transaction records in blocks. It has two elements, one is the worldstate, and another one is blockchain. 

WorldState
It is a Database, that holds the current state of the ledger

Chain Code 
It is a smart contract that controls the method of transactions and its logic.

How Hyperledger Fabric Works


​Source: Hyperledger Fabric — Part 1 — Components and Architecture

Watch this explainer video of hyperledger fabric to understand how it works

The architecture of hyperledger fabric contains channels as main components, organizations inside a channel can communicate with each other. Also, the fabric gives access for one organization to participate in multiple channels at the same time. Hyperledger fabric works based on the permissoned voting-based consensus whereas the consensus can be classified into three different phases. 

  1. Endorsing 
  2. Ordering
  3. Validating and Committing

How Transactions Happens in Hyperledger Fabric

 

Hyperledger Fabric Transaction Flow
 
Workflow
 
  1. Clients sents transaction proposals to the endorsing peer with registered User ID.
     
  2. Endorsing peer verifies the transaction proposal, Verifies the user ID, approves the transaction proposal, and sends a response to the client with reading/write access. 
     
  3. Clients receive the responses from endorsing peers.
     
  4. Clients send the approved transaction to the orderer along with the endorsed proposal.
     
  5. Orders, orders the transactions and creates a new block for ordered transactions. 
     
  6. Orderer notifies all the peers in the network about the ordered transactions, 
     

Hyperledger Fabric Performance: Demo

Hyperledger Fabric Use Cases

The high-end security and privacy of hyperledger fabric provide enriched transactions between nodes in a blockchain network. Here are the extended use cases of hyperledger as listed by openblockchain.readthedocs.io

  1. Single Trade, Single Contract
     
  2. Direct Communication Between Nodes
     
  3. Separation Of Asset Ownership
     
  4. Assets Interoperability
     
  5. Privacy

Check out more about the use case of hyperledger fabric by openblockchain.readthedocs.io

Industry Adoption
Hyperledger fabric can be used to improve the performance of the following industries

  1. Supply chain
  2. Education and Training
  3. Energy & Fuel 
  4. Government
  5. Digital Identity : 
  6. Business with B2B Smart Contracts
  7. Fintech ( Banking, Finance, and Insurance)
  8. Healthcare

Check out real time projects that are made with hyperledger fabric

Hyperledger Fabric 2.0

Hyperledger Fabric 2.0 is the recent version, which was announced recently by the hyperledger team. The hyperledger fabric version 2.0 arrives with the goal of maximizing the flexibility in the chain code lifecycle and to bring more options for distributing governance to the nodes. 

Highlights of hyperledger fabric 2.0

  1. Decentralized Governance Of Smart contracts
     
  2. New ChaniCode Patterns for Consensus and Collaborations
     
  3. External Chain code launcher
     
  4. Performance Improvements
     
  5. Private Data Enhancements
     
  6. State Database Cache to improve the performance of CouchDB
     
  7. Alpine Docker Images

Who We are?

Bitdeal, A renowned blockchain development company, providing hyperledger blockchain development services for industries around the globe, we have a team of expert developers who can generate cross-industry blockchain applications on hyper ledger fabric v1.0 and hyper ledger fabric version 2.0. We commit ourselves to the complexities and bring the best possible and easy to handle solution for industries with hyperledger blockchain.

hyperledger blockchain development hyperledger fabric tutorial