HYPERLEDGER FABRIC – KEY CONCEPTS

 

Hyperledger Fabric is a highly-modular, private, and permissioned Distributed Ledger technology. It is the open-source engine for blockchain and takes care of the most important features for evaluating and using blockchain for business use cases. 

Key concepts of this Blockchain network are listed below.

 

GENESIS BLOCK

The configuration block that initializes the ordering service, or serves as the first block on a chain. It is also known as Block 0.

 

ORGANIZATION

Organizations are members of a blockchain network which are invited to join the blockchain network by a blockchain network provider. An organization in Hyperledger Fabric corresponds to a real organization, company, etc.

 

MSP 

MSP is the entity that defines rules, permissions, and roles of different actors, whose identities have been issued by a valid CA (Certificate Authority). MSP abstracts away the protocols behind issuing certificates, validating certificates, and user authentication with all the cryptographic mechanisms, handled by CAs.

In Hyperledger Fabric Network each organization is identified by its Membership Service Provider identification (MSP ID).  

 

ASSET

Asset is represented as a collection of key-value pairs in binary or JSON form.

 

TRANSACTION

Transactions are created when the client invokes chaincode that leads to reading or writing data to the Ledger. It is possible to disable the creation of a new transaction when a read operation is performed.

 

LEDGER

In Hyperledger Fabric, a Ledger consists of two parts – a world state and a blockchain.

Blockchain represents a transaction log that records all the changes that have resulted in the current world state. The blockchain data structure is very different to the world state because once written, it cannot be modified.

 

WORLD STATE

World State is also known as the current state of the Ledger. The World State will change each time the value of key changes or when a new key is created. The current state of the key-value pair must be known before it can be changed. World state is stored in a state database for efficient reads and queries from chaincode. 

 

SMART CONTRACT (CHAINCODE)

A smart contract defines the rules between different organizations in executable code.

Chaincode is a packaged smart contract code prepared for installation, written in one of the supported programming languages, that manages access and modifications to a set of key-value pairs in the World State via Transaction

Chaincode functions are executed against the Ledger’s current state (World State). It is installed on the Peers and then instantiated and used on one or more Channels. Chaincode should  be instantiated only once on a channel from one of the Peers.

 

ORDERER

A Orderer is a node running on the Hyperledger Fabric peer binary. An Orderer node packages the Transactions into a block, which is then sent to Peers, and after verification appended to the Ledger.

The ordering service can consist of one or multiple Orderer nodes. An ordering service does transaction ordering but only for chaincode invoke requests.

 

PEERS

A Peer is a node running on the Hyperledger Fabric peer binary. Each organization is supposed to have multiple Peers. Each Peer maintains a copy of the Ledger for each channel of which they are a member.

There are three types of peers:

    • LEADING PEER – Peer that always receives a new block from the Orderer and shares it with the other Peers using the Gossip protocol
    • ANCHOR PEER – Peer that can be discovered by all other Peers across all organizations. If an organization does not have an anchor peer in a channel and a new peer is joined to the channel, the organization might not be able to learn about this new peer.
    • ENDORSING PEER – Peer that will validate the Transaction.

CHANNELS

Channel provides a mechanism for the Peer to communicate & transact privately. Each channel has its own Ledger and because of that is a totally separated network. 

Data between Channel members are shared through the channel but not between channels. Data in the channel is shared and visible to all participants. 

That means that all members of a channel have the same set of data stored in their own Peers in the channel’s Ledger.