Open In App

What is Chaincode in Hyperledger Fabric?

Blockchain is the technology that has been making a lot of news lately. It’s a hot topic because it’s believed to be revolutionary by many. Hyperledger Fabric is one of the leading blockchain frameworks out there, and this article will explain what Chaincode is within Hyperledger Fabric. The following topics will be discussed here:

  1. What is Chaincode In Hyperledger Fabric?
  2. Types of Chaincode In Hyperledger Fabric?
  3. System Chaincodes
  4. Chaincodes For Developers In Blockchain
  5. Chaincodes For Operators In Blockchain
  6. Conclusion

Let’s start discussing each of these topics in detail.



What is Chaincode in Hyperledger Fabric?

A Chaincode (or “smart contract”) is an application that runs on top of the underlying architecture to enforce business rules and maintain the state. This application can define its own data structures, or use the types of services exposed by other chain codes running in parallel on the same peer node.

Types of Chaincodes in Hyperledger Fabric

In Hyperledger Fabric, there are two different types of chaincodes:



What are System Chaincodes?

Chaincode For Developers in Blockchain

Chaincode is a program that lives in the blockchain and it executes transactions when instructed. It offers an alternative to using scripts to create smart contracts. 

Chaincode For Operators

Chaincode is a fabric-specific script written to perform operations within the framework. Hyperledger Fabric’s chaincode enables a user with no knowledge of blockchain technology to build and deploy smart contracts and transactions. 

Conclusion 

In chaincode, we have seen that blocks are represented as transactions, and peers are grouped into peer groups that are interconnected through a leader peer. There will be some different types of transactions generated in Hyperledger, and these different types can have the same concept of a block where the transactions of the same type all go into a block. A transaction is a message sent by an external source (for example, an API call or other external messaging service), which contains certain values. If a transaction is being processed by another peer group (peer group for business rules) or core node(Core node for messages sent from other peers or as part of messages), then we say that transaction is being put into a block.


Article Tags :