Kaleido supports Hyperledger Fabric version 2.3 and Fabric CA version 1.4.
Hyperledger Fabric is an open source blockchain protocol custom designed for enterprise use cases in a permissioned blockchain network. As part of the Hyperledger project of the Linux Foundation, Fabric is the most widely used blockchain protocol in the umbrella project with the widest overall community participation.
Compared to other protocols in the enterprise blockchain space, Fabric has some unique designs. The burden of transaction processing computation and state management is split out into a separate type of node called "endorsers/committers", or simply "peers". The responsibilities to build consensus, order transactions and seal them into blocks are delegated to a different type of nodes called "orderers".
Channels are another unique design in Fabric. Operating like mini-blockchains, each channel contains their own permissioning policies and their own ledger to record the blocks and transactions. In essence, a single Fabric network can support many isolated blockchain instances.
Smart contracts for Fabric can be written in any languages architecturally, as the smart contracts communicate with the hosting peer nodes via a well-defined HTTP interface. Currently 3 languages are supported for Chaincode (the term used for smart contracts in Fabric lingo) to be developed in: Golang, node.js/typescript and Java.
Fabric is custom designed for use in a permissioned network context, where an elaborate onboarding process exists to allow trust to be established among the participants. Specifically, this is achieved by requiring every node to present MSP (membership service provider) credentials that are either x.509 certificates signed by the organization's Certificate Authority that's already been registered in the channel configuration, or zero knowledge proofs that are verifiable for possession of signed attributes.
The trust among the members of a channel is established through a ceremony of declaring the governance policies and signing by the founding members. The root of the trust is captured inside the genesis block of the channel. Subsequent modification to the channel configuration, including adding or removing members, adding or removing peers and orderers, updating policies, must be conducted according to the current governance policy, which itself can be modified if the signature threshold of the modification policy is met.
Fabric provides two levels of transaction privacy. With message isolation via channels, a member is completely unaware of the existence of a channel if they are not a member of it. With private data collections, a design very similar to the private transactions in Enterprise Ethereum, transaction inputs are shared in direct peer to peer communications with the parties authorized to see them. Only the hashes for the private transaction inputs are shared with the ordering service and included in the transaction to be recorded in the ledger.
Fabric consensus is three parts:
- The endorser (which is part of the peer nodes) provides endorsements by first executing the target business logic in the invoked Chaincode.
- The orderer nodes enforce global ordering (within the channel) and assemble transactions into blocks.
- Finally, the committer (which is also part of the peer nodes) validates the transactions as successful or failed and commits them into their ledger for the channel.
The Fabric design presents some unique aspects to application developers. Chaincode development is pretty straightforward, with full programming languages such as Golang, node.js/typescript, and Java, because there is no special DSL such as Solidity to learn. Interaction with the peer and orderer nodes are over a well defined, but very complex, gRPC interface with protobuf as the wire protocol. Using one of the SDKs (supported in Golang, node.js/typescript and Java) is a necessity.
The peer nodes have a built-in discovery service that makes it much easier to gather the necessary information about the network topology and determine the list of peers to call in order to fulfill the endorsement policy that is required for the transaction to succeed.
Fabric provides flexible smart contract development and deployment support. After being developed in any of the supported languages, they can be deployed either as long-running microservices, or as commands that get executed and exited when done.
Kaleido's Fabric support for Chaincode includes Golang binaries and node.js source projects.
Fabric Chaincode deployments are semantically defined as two parts:
- The executable program, which must be individually installed on each peer designated as servicing that Chaincode's functionality.
- The definition, which must go through an approve/commit lifecycle via on-chain transactions and is captured on the ledger of the channel.
Orderers do not need the Chaincode installed, as they are only concerned with processing the output of the endorsement executions. Not all peers within a membership need to install the Chaincodes. Only those designated as servicing the Chaincodes' functionalities need to have them installed.
Fabric has seen wide industry adoptions. Some of the major networks built on top of Fabric include:
For a deeper understanding of how Fabric compares with Ethereum and Corda, visit our blog A Technical Analysis of Ethereum vs. Fabric vs. Corda