Introduction to Hyperledger Fabric - cogeorg/teaching GitHub Wiki
Hyperledger Fabric is an open source enterprise-grade permissioned distributed ledger technology (DLT) platform. It was established under the Linux Foundation and is governed by a diverse technical steering committee. In contrast to Ethereum, Hyperledger Fabric is a blockchain technology designed for enterprise use cases that need requirements like
- participant identification
- permissioned networks
- high transaction throughput
- low transaction latency
- privacy and confidentiality of transactions and data
How is Hyperledger Fabric different from Ethereum?
Modularity
Hyperledger Fabric is modular in the following components:
- consensus mechanism
- identity management
- gossip protocol
- database management system
- endorsement and validation policy enforcement
Permissioned Blockchain
Permissioned blockchains are usually operated by a set of known and identified entities that usually trust each other to a certain degree. Since malicious actors can be identified, there is no need for a costly consensus algorithm or mining.
Smart Contracts = Chaincode
Hyperledger Fabric allows for smart contracts which are called chaincode.
Ethereum follows an order-execute architecture in which
- transactions are ordered, validated, and propagated to peers
- peers execute the transactions sequentially Smart contracts designed for an order-execute architecture must be deterministic and thus, Ethereum only runs contracts that are written in languages like Solidity.
Hyperledger Fabric does not follow order-execute but an execute-order-validate architecture that
- executes a transaction and checks its correctness, thereby endorsing it,
- orders transactions via a (pluggable) consensus protocol, and
- validates transactions against an application-specific endorsement policy before committing them to the ledger
The application-specific endorsement policy specifies which peer nodes, or how many of them, need to vouch for the correct execution of a given smart contract. This approach allows for parallel execution, thus smart contracts do not have to be deterministic. Hence, chaincode can be written in non/specific programming languages. Right now, there is support for Go and Node.js and ongoing development to add Java and Python support.
Privacy via Channels
Hyperledger Fabric, being a permissioned platform, enables confidentiality through its channel architecture. Basically, participants on a Fabric network can establish a “channel” between the subset of participants that should be granted visibility to a particular set of transactions. Thus, only those nodes that participate in a channel have access to the smart contract (chaincode) and data transacted, preserving the privacy and confidentiality of both.
Consensus
The consensus mechanism is mentioned in the Modularity section. In Hyperledger Fabric, the ordering part of execute-order-validate is delegated to a modular component, the ordering service, that is decoupled from the peers that execute transactions. This ordering service is the consensus mechanism that can be chosen and plugged in, depending on the level of trust required.
Performance and Scalability
All of the above mentioned features are meant to make Hyperledger Fabric perform better and be more scalable compared to blockchain solutions designed to be public and permissionless. A team from IBM Research has published a peer reviewed paper that evaluated the architecture and performance of Hyperledger Fabric.
Before you continue with the tutorial, please read this article on the general architecture of Hyperledger Fabric.
Feel free to browse even more through the Hyperledger Fabric Documentation.