Open In App

Hyperledger Fabric Component Design

Hyperledger Fabric is a modular, open-source distributed ledger platform designed for enterprise-grade solutions. It is a framework for building blockchain applications that can be customized and extended to meet the specific needs of different industries and use cases.

Hyperledger Fabric is also known as smart contracts. It is one of the projects under the umbrella of the Hyperledger blockchain consortium, which is an effort by the Linux Foundation to advance cross-industry collaboration for developing blockchain technologies. Fabric is designed to support pluggable implementations of different components, including consensus and membership services, and it uses container technology to host smart contracts called “chaincode” that can be written in a variety of programming languages. Fabric is intended to be a foundation for developing applications or solutions with a modular architecture, allowing components such as consensus and membership services to be plug-and-play.



Hyperledger Fabric Infrastructure Components

One of the key design principles of Hyperledger Fabric is modularity and extensibility. The platform is composed of several components that can be customized and extended to meet the specific requirements of different applications and use cases. The following are some of the main components of Hyperledger Fabric and their roles in the platform:

Hyperledger Fabric Architecture



1. Peer Node

This is the main component of Hyperledger Fabric. It is responsible for managing the ledger, executing smart contracts, and participating in the consensus process. A peer node in Hyperledger Fabric is a server that runs the Hyperledger Fabric software and is part of a network of peer nodes that make up a Hyperledger Fabric blockchain. Each peer node stores a copy of the ledger and participates in the consensus process to validate and endorse transactions, as well as maintain the state of the ledger. Peer nodes can also run smart contracts, known as chaincode in Hyperledger Fabric, which define the business logic of the blockchain network. There are 5 types of Peer nodes:

2. Orderer

In Hyperledger Fabric, an orderer is a component that is responsible for ensuring the delivery of transactions to the appropriate peer nodes for validation and endorsement. The orderer maintains an ordered log of all transactions that have occurred on the network and provides a communication channel for the peer nodes to reach a consensus on the order in which transactions should be processed. The orderer does not validate or endorse transactions but rather acts as a mediator to facilitate communication between the different peer nodes. There are 5 types of Orderer:

3. Membership service provider (MSP)

In Hyperledger Fabric, a Membership Service Provider (MSP) is a component that defines the rules for identity management and authentication within a Hyperledger Fabric network. MSPs are used to verify the identity of participants in the network, such as users, applications, and peer nodes. They do this by managing the certificates and cryptographic materials that are used to identify and authenticate entities on the network. MSPs play a crucial role in ensuring the security and integrity of the Hyperledger Fabric network by ensuring that only authorized entities can access the network and participate in transactions. There are several types of membership service providers (MSPs) in Hyperledger, including:

4. Ledger

In Hyperledger Fabric, the ledger is a distributed database that records all of the transactions that occur on the network. Each peer node maintains a copy of the ledger, and the ledger is updated whenever a new transaction is endorsed and committed to the network. The ledger is composed of two parts: the world state, which stores the current state of all assets on the network, and the transaction log, which stores a record of all transactions that have occurred on the network. The ledger is used to provide an immutable record of all transactions and to ensure the consistency and integrity of the data on the network.  There are several types of ledgers in Hyperledger, including:

5. Chaincode

In Hyperledger Fabric, chaincode is the term used to refer to smart contracts. Chaincode is written in Go and defines the business logic of a Hyperledger Fabric network. It specifies the rules for updating the ledger and determines which transactions are valid. When a transaction is submitted to the network, it is sent to the appropriate peer nodes for endorsement. The chaincode is then executed on the endorsing peer nodes, and the endorsed transaction is sent back to the client for ordering and finally commit to the ledger. Chaincode is an important part of the Hyperledger Fabric architecture, as it allows users to define the specific rules and functionality of their blockchain network.
In Hyperledger, chaincode refers to the smart contract code that is written in a programming language, such as Go or Java, and deployed on the blockchain network. There are two types of chaincode in Hyperledger Fabric:

6. Consensus Algorithm

In Hyperledger Fabric, the consensus algorithm is the mechanism by which the peer-ordering service nodes in a network reach an agreement on the order and validity of transactions. The consensus algorithm is an important part of the overall architecture of a Hyperledger Fabric network, as it ensures the integrity and consistency of the ledger by ensuring that all peer nodes have a consistent view of the state of the network. Hyperledger Fabric supports several different consensus algorithms, including the Practical Byzantine Fault Tolerance (PBFT) algorithm and the Kafka-based consensus algorithm. The specific consensus algorithm used by a Hyperledger Fabric network can be configured and customized to meet the needs of the specific application.

7. Channels

In Hyperledger Fabric, a channel is a private “subnet” within a Hyperledger Fabric network that allows a group of participants to execute transactions and confidentially share data. Each channel has its separate ledger, and the participants on a channel can only see the transactions that are submitted to that channel. This allows different groups of participants within a Hyperledger Fabric network to have their own private, confidential interactions without revealing sensitive information to the other participants on the network. Channels provide an additional layer of security and privacy within a Hyperledger Fabric network. In Hyperledger Fabric, there are three types of channels:

8. HyperLedger Fabric Certification Authority(CA)

9. Client 

Represents the end user or client applications that trigger blockchain events. Clients are software programs that propose transactions on a network on behalf of a person. Clients communicate with peers and ordering services.
The Client interacts with the network using a Fabric SDK. When reading or writing data from a Fabric blockchain the clients interact with the SDK. To ensure that a legitimate client has started the network transaction, the CA authority issues a certificate to the client as well.  

These components work together to provide a modular, extensible platform for building blockchain applications. By customizing and extending these components, developers can create applications that are tailored to the specific requirements of different industries and use cases.

Transaction Work Flow

  1. A participant/client in the organization initiates a transaction request.
  2. The transaction invocation request is broadcasted to endorser peers by the client application.
  3. The transaction is now validated by the endorser reviewing the Certificate details and others, and then according to the chainCode’s logic, the endorser approves or rejects the transactions.
  4. After the approval, the transaction is now sent by the client to the committer peer to properly order & add it to the block.
  5. The transaction block is then sent to order servicing nodes by the committer to add them to the blockchain.
  6. The order servicing nodes verify the block with the consensus protocol and then commit to the Ledger.

Example:

The below example shows how the components of Hyperledger Fabric work together to build a blockchain application:

  1. A group of participants, such as banks or other financial institutions, form a consortium to create a blockchain network for a specific use case, such as trade finance.
  2. The participants deploy peer nodes on their respective networks and join the consortium. The peer nodes are connected to the ordering service, which generates blocks of transactions and propagates them to the network.
  3. The membership service provider (MSP) manages the identities of the participants and enforces the access control policies of the consortium.
  4. The participants deploy a smart contract, or chaincode, on the network that defines the business logic of the application, such as the rules for creating, modifying, and settling trade finance transactions.
  5. The participants interact with the network by submitting transactions to the ledger. The peer nodes execute the transactions and update the state of the network according to the rules defined in the smart contract.
  6. The consensus algorithm ensures the integrity and consistency of the ledger across the network. It ensures that the transactions are processed fairly and consistently and that the ledger is replicated across the network for availability and reliability.

In this example, the components of Hyperledger Fabric work together to create a decentralized, secure, and transparent platform for trade finance applications. By customizing and extending these components, the consortium can create a blockchain network that is tailored to the specific requirements of the trade finance industry.


Article Tags :