github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/docs/source/whatis.md (about) 1 # Introduction 2 3 In general terms, a blockchain is an immutable transaction ledger, maintained 4 within a distributed network of _peer nodes_. These nodes each maintain a copy 5 of the ledger by applying transactions that have been validated by a _consensus 6 protocol_, grouped into blocks that include a hash that bind each block to the 7 preceding block. 8 9 The first and most widely recognized application of blockchain is the 10 [Bitcoin](https://en.wikipedia.org/wiki/Bitcoin) cryptocurrency, though others 11 have followed in its footsteps. Ethereum, an alternative cryptocurrency, took a 12 different approach, integrating many of the same characteristics as Bitcoin but 13 adding _smart contracts_ to create a platform for distributed applications. 14 Bitcoin and Ethereum fall into a class of blockchain that we would classify as 15 _public permissionless_ blockchain technology. Basically, these are public 16 networks, open to anyone, where participants interact anonymously. 17 18 As the popularity of Bitcoin, Ethereum and a few other derivative technologies 19 grew, interest in applying the underlying technology of the blockchain, 20 distributed ledger and distributed application platform to more innovative 21 _enterprise_ use cases also grew. However, many enterprise use cases require 22 performance characteristics that the permissionless blockchain technologies are 23 unable (presently) to deliver. In addition, in many use cases, the identity of 24 the participants is a hard requirement, such as in the case of financial 25 transactions where Know-Your-Customer (KYC) and Anti-Money Laundering (AML) 26 regulations must be followed. 27 28 For enterprise use, we need to consider the following requirements: 29 30 - Participants must be identified/identifiable 31 - Networks need to be _permissioned_ 32 - High transaction throughput performance 33 - Low latency of transaction confirmation 34 - Privacy and confidentiality of transactions and data pertaining to business 35 transactions 36 37 While many early blockchain platforms are currently being _adapted_ for 38 enterprise use, Hyperledger Fabric has been _designed_ for enterprise use from 39 the outset. The following sections describe how Hyperledger Fabric (Fabric) 40 differentiates itself from other blockchain platforms and describes some of the 41 motivation for its architectural decisions. 42 43 ## Hyperledger Fabric 44 45 Hyperledger Fabric is an open source enterprise-grade permissioned distributed 46 ledger technology (DLT) platform, designed for use in enterprise contexts, 47 that delivers some key differentiating capabilities over other popular 48 distributed ledger or blockchain platforms. 49 50 One key point of differentiation is that Hyperledger was established under the 51 Linux Foundation, which itself has a long and very successful history of 52 nurturing open source projects under **open governance** that grow strong 53 sustaining communities and thriving ecosystems. Hyperledger is governed by a 54 diverse technical steering committee, and the Hyperledger Fabric project by a 55 diverse set of maintainers from multiple organizations. It has a development 56 community that has grown to over 35 organizations and nearly 200 developers 57 since its earliest commits. 58 59 Fabric has a highly **modular** and **configurable** architecture, enabling 60 innovation, versatility and optimization for a broad range of industry use cases 61 including banking, finance, insurance, healthcare, human resources, supply 62 chain and even digital music delivery. 63 64 Fabric is the first distributed ledger platform to support **smart contracts 65 authored in general-purpose programming languages** such as Java, Go and 66 Node.js, rather than constrained domain-specific languages (DSL). This means 67 that most enterprises already have the skill set needed to develop smart 68 contracts, and no additional training to learn a new language or DSL is needed. 69 70 The Fabric platform is also **permissioned**, meaning that, unlike with a public 71 permissionless network, the participants are known to each other, rather than 72 anonymous and therefore fully untrusted. This means that while the participants 73 may not _fully_ trust one another (they may, for example, be competitors in the 74 same industry), a network can be operated under a governance model that is built 75 off of what trust _does_ exist between participants, such as a legal agreement 76 or framework for handling disputes. 77 78 One of the most important of the platform's differentiators is its support for 79 **pluggable consensus protocols** that enable the platform to be more 80 effectively customized to fit particular use cases and trust models. For 81 instance, when deployed within a single enterprise, or operated by a trusted 82 authority, fully byzantine fault tolerant consensus might be considered 83 unnecessary and an excessive drag on performance and throughput. In situations 84 such as that, a 85 [crash fault-tolerant](https://en.wikipedia.org/wiki/Fault_tolerance) (CFT) 86 consensus protocol might be more than adequate whereas, in a multi-party, 87 decentralized use case, a more traditional 88 [byzantine fault tolerant](https://en.wikipedia.org/wiki/Byzantine_fault_tolerance) 89 (BFT) consensus protocol might be required. 90 91 Fabric can leverage consensus protocols that **do not require a native 92 cryptocurrency** to incent costly mining or to fuel smart contract execution. 93 Avoidance of a cryptocurrency reduces some significant risk/attack vectors, 94 and absence of cryptographic mining operations means that the platform can be 95 deployed with roughly the same operational cost as any other distributed system. 96 97 The combination of these differentiating design features makes Fabric one of 98 the **better performing platforms** available today both in terms of transaction 99 processing and transaction confirmation latency, and it enables **privacy and confidentiality** of transactions and the smart contracts (what Fabric calls 100 "chaincode") that implement them. 101 102 Let's explore these differentiating features in more detail. 103 104 ## Modularity 105 106 Hyperledger Fabric has been specifically architected to have a modular 107 architecture. Whether it is pluggable consensus, pluggable identity management 108 protocols such as LDAP or OpenID Connect, key management protocols or 109 cryptographic libraries, the platform has been designed at its core to be 110 configured to meet the diversity of enterprise use case requirements. 111 112 At a high level, Fabric is comprised of the following modular components: 113 114 - A pluggable _ordering service_ establishes consensus on the order of 115 transactions and then broadcasts blocks to peers. 116 - A pluggable _membership service provider_ is responsible for associating 117 entities in the network with cryptographic identities. 118 - An optional _peer-to-peer gossip service_ disseminates the blocks output by 119 ordering service to other peers. 120 - Smart contracts ("chaincode") run within a container environment (e.g. Docker) 121 for isolation. They can be written in standard programming languages but do not 122 have direct access to the ledger state. 123 - The ledger can be configured to support a variety of DBMSs. 124 - A pluggable endorsement and validation policy enforcement that can be 125 independently configured per application. 126 127 There is fair agreement in the industry that there is no "one blockchain to 128 rule them all". Hyperledger Fabric can be configured in multiple ways to 129 satisfy the diverse solution requirements for multiple industry use cases. 130 131 ## Permissioned vs Permissionless Blockchains 132 133 In a permissionless blockchain, virtually anyone can participate, and every 134 participant is anonymous. In such a context, there can be no trust other than 135 that the state of the blockchain, prior to a certain depth, is immutable. In 136 order to mitigate this absence of trust, permissionless blockchains typically 137 employ a "mined" native cryptocurrency or transaction fees to provide economic 138 incentive to offset the extraordinary costs of participating in a form of 139 byzantine fault tolerant consensus based on "proof of work" (PoW). 140 141 **Permissioned** blockchains, on the other hand, operate a blockchain amongst 142 a set of known, identified and often vetted participants operating under a 143 governance model that yields a certain degree of trust. A permissioned 144 blockchain provides a way to secure the interactions among a group of entities 145 that have a common goal but which may not fully trust each other. By relying on 146 the identities of the participants, a permissioned blockchain can use more 147 traditional crash fault tolerant (CFT) or byzantine fault tolerant (BFT) 148 consensus protocols that do not require costly mining. 149 150 Additionally, in such a permissioned context, the risk of a participant 151 intentionally introducing malicious code through a smart contract is diminished. 152 First, the participants are known to one another and all actions, whether 153 submitting application transactions, modifying the configuration of the network 154 or deploying a smart contract are recorded on the blockchain following an 155 endorsement policy that was established for the network and relevant transaction 156 type. Rather than being completely anonymous, the guilty party can be easily 157 identified and the incident handled in accordance with the terms of the 158 governance model. 159 160 ## Smart Contracts 161 162 A smart contract, or what Fabric calls "chaincode", functions as a trusted 163 distributed application that gains its security/trust from the blockchain and 164 the underlying consensus among the peers. It is the business logic of a 165 blockchain application. 166 167 There are three key points that apply to smart contracts, especially when 168 applied to a platform: 169 170 - many smart contracts run concurrently in the network, 171 - they may be deployed dynamically (in many cases by anyone), and 172 - application code should be treated as untrusted, potentially even 173 malicious. 174 175 Most existing smart-contract capable blockchain platforms follow an 176 **order-execute** architecture in which the consensus protocol: 177 178 - validates and orders transactions then propagates them to all peer nodes, 179 - each peer then executes the transactions sequentially. 180 181 The order-execute architecture can be found in virtually all existing blockchain 182 systems, ranging from public/permissionless platforms such as 183 [Ethereum](https://ethereum.org/) (with PoW-based consensus) to permissioned 184 platforms such as [Tendermint](http://tendermint.com/), 185 [Chain](http://chain.com/), and [Quorum](http://www.jpmorgan.com/global/Quorum). 186 187 Smart contracts executing in a blockchain that operates with the order-execute 188 architecture must be deterministic; otherwise, consensus might never be reached. 189 To address the non-determinism issue, many platforms require that the smart 190 contracts be written in a non-standard, or domain-specific language 191 (such as [Solidity](https://solidity.readthedocs.io/en/v0.4.23/)) so that 192 non-deterministic operations can be eliminated. This hinders wide-spread 193 adoption because it requires developers writing smart contracts to learn a new 194 language and may lead to programming errors. 195 196 Further, since all transactions are executed sequentially by all nodes, 197 performance and scale is limited. The fact that the smart contract code executes 198 on every node in the system demands that complex measures be taken to protect 199 the overall system from potentially malicious contracts in order to ensure 200 resiliency of the overall system. 201 202 ## A New Approach 203 204 Fabric introduces a new architecture for transactions that we call 205 **execute-order-validate**. It addresses the resiliency, flexibility, 206 scalability, performance and confidentiality challenges faced by the 207 order-execute model by separating the transaction flow into three steps: 208 209 - _execute_ a transaction and check its correctness, thereby endorsing it, 210 - _order_ transactions via a (pluggable) consensus protocol, and 211 - _validate_ transactions against an application-specific endorsement policy 212 before committing them to the ledger 213 214 This design departs radically from the order-execute paradigm in that Fabric 215 executes transactions before reaching final agreement on their order. 216 217 In Fabric, an application-specific endorsement policy specifies which peer 218 nodes, or how many of them, need to vouch for the correct execution of a given 219 smart contract. Thus, each transaction need only be executed (endorsed) by the 220 subset of the peer nodes necessary to satisfy the transaction's endorsement 221 policy. This allows for parallel execution increasing overall performance and 222 scale of the system. This first phase also **eliminates any non-determinism**, 223 as inconsistent results can be filtered out before ordering. 224 225 Because we have eliminated non-determinism, Fabric is the first blockchain 226 technology that **enables use of standard programming languages**. In the 1.1.0 227 release, smart contracts can be written in either Go or Node.js, while there are 228 plans to support other popular languages including Java in subsequent releases. 229 230 ## Privacy and Confidentiality 231 232 As we have discussed, in a public, permissionless blockchain network that 233 leverages PoW for its consensus model, transactions are executed on every node. 234 This means that neither can there be confidentiality of the contracts 235 themselves, nor of the transaction data that they process. Every transaction, 236 and the code that implements it, is visible to every node in the network. In 237 this case, we have traded confidentiality of contract and data for byzantine 238 fault tolerant consensus delivered by PoW. 239 240 This lack of confidentiality can be problematic for many business/enterprise use 241 cases. For example, in a network of supply-chain partners, some consumers might 242 be given preferred rates as a means of either solidifying a relationship, or 243 promoting additional sales. If every participant can see every contract and 244 transaction, it becomes impossible to maintain such business relationships in a 245 completely transparent network -- everyone will want the preferred rates! 246 247 As a second example, consider the securities industry, where a trader building 248 a position (or disposing of one) would not want her competitors to know of this, 249 or else they will seek to get in on the game, weakening the trader's gambit. 250 251 In order to address the lack of privacy and confidentiality for purposes of 252 delivering on enterprise use case requirements, blockchain platforms have 253 adopted a variety of approaches. All have their trade-offs. 254 255 Encrypting data is one approach to providing confidentiality; however, in a 256 permissionless network leveraging PoW for its consensus, the encrypted data is 257 sitting on every node. Given enough time and computational resource, the 258 encryption could be broken. For many enterprise use cases, the risk that their 259 information could become compromised is unacceptable. 260 261 Zero knowledge proofs (ZKP) are another area of research being explored to 262 address this problem, the trade-off here being that, presently, computing a ZKP 263 requires considerable time and computational resources. Hence, the trade-off in 264 this case is performance for confidentiality. 265 266 In a permissioned context that can leverage alternate forms of consensus, one 267 might explore approaches that restrict the distribution of confidential 268 information exclusively to authorized nodes. 269 270 Hyperledger Fabric, being a permissioned platform, enables confidentiality 271 through its channel architecture. Basically, participants on a Fabric network 272 can establish a "channel" between the subset of participants that should be 273 granted visibility to a particular set of transactions. Think of this as a 274 network overlay. Thus, only those nodes that participate in a channel have 275 access to the smart contract (chaincode) and data transacted, preserving the 276 privacy and confidentiality of both. 277 278 To improve upon its privacy and confidentiality capabilities, Fabric has 279 added support for [private data](./private-data/private-data.html) and is working 280 on zero knowledge proofs (ZKP) available in the future. More on this as it 281 becomes available. 282 283 ## Pluggable Consensus 284 285 The ordering of transactions is delegated to a modular component for consensus 286 that is logically decoupled from the peers that execute transactions and 287 maintain the ledger. Specifically, the ordering service. Since consensus is 288 modular, its implementation can be tailored to the trust assumption of a 289 particular deployment or solution. This modular architecture allows the platform 290 to rely on well-established toolkits for CFT (crash fault-tolerant) or BFT 291 (byzantine fault-tolerant) ordering. 292 293 Fabric currently offers two CFT ordering service implementations. The first is 294 based on the [`etcd` library](https://coreos.com/etcd/) of the [Raft protocol](https://raft.github.io/raft.pdf). 295 The other is [Kafka](https://kafka.apache.org/) (which uses [Zookeeper](https://zookeeper.apache.org/) 296 internally). For information about currently available ordering services, check 297 out our [conceptual documentation about ordering](./orderer/ordering_service.html). 298 299 Note also that these are not mutually exclusive. A Fabric network can have 300 multiple ordering services supporting different applications or application 301 requirements. 302 303 ## Performance and Scalability 304 305 Performance of a blockchain platform can be affected by many variables such as 306 transaction size, block size, network size, as well as limits of the hardware, 307 etc. The Hyperledger community is currently developing [a draft set of measures](https://docs.google.com/document/d/1DQ6PqoeIH0pCNJSEYiw7JVbExDvWh_ZRVhWkuioG4k0/edit#heading=h.t3gztry2ja8i) within the Performance and Scale working group, along 308 with a corresponding implementation of a benchmarking framework called 309 [Hyperledger Caliper](https://wiki.hyperledger.org/projects/caliper). 310 311 While that work continues to be developed and should be seen as a definitive 312 measure of blockchain platform performance and scale characteristics, a team 313 from IBM Research has published a 314 [peer reviewed paper](https://arxiv.org/abs/1801.10228v1) that evaluated the 315 architecture and performance of Hyperledger Fabric. The paper offers an in-depth 316 discussion of the architecture of Fabric and then reports on the team's 317 performance evaluation of the platform using a preliminary release of 318 Hyperledger Fabric v1.1. 319 320 The benchmarking efforts that the research team did yielded a significant 321 number of performance improvements for the Fabric v1.1.0 release that more than 322 doubled the overall performance of the platform from the v1.0.0 release levels. 323 324 ## Conclusion 325 326 Any serious evaluation of blockchain platforms should include Hyperledger Fabric 327 in its short list. 328 329 Combined, the differentiating capabilities of Fabric make it a highly scalable 330 system for permissioned blockchains supporting flexible trust assumptions that 331 enable the platform to support a wide range of industry use cases ranging from 332 government, to finance, to supply-chain logistics, to healthcare and so much 333 more. 334 335 Hyperledger Fabric is the most active of the 336 Hyperledger projects. The community building around the platform is growing 337 steadily, and the innovation delivered with each successive release far 338 out-paces any of the other enterprise blockchain platforms. 339 340 ## Acknowledgement 341 342 The preceding is derived from the peer reviewed 343 ["Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains"](https://arxiv.org/abs/1801.10228v2) - Elli Androulaki, Artem 344 Barger, Vita Bortnikov, Christian Cachin, Konstantinos Christidis, Angelo De 345 Caro, David Enyeart, Christopher Ferris, Gennady Laventman, Yacov Manevich, 346 Srinivasan Muralidharan, Chet Murthy, Binh Nguyen, Manish Sethi, Gari Singh, 347 Keith Smith, Alessandro Sorniotti, Chrysoula Stathakopoulou, Marko Vukolic, 348 Sharon Weed Cocco, Jason Yellick