github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/docs/source/glossary.rst (about) 1 Glossary 2 =========================== 3 4 Terminology is important, so that all Hechain users and developers 5 agree on what we mean by each specific term. What is a smart contract for 6 example. The documentation will reference the glossary as needed, but feel free 7 to read the entire thing in one sitting if you like; it's pretty enlightening! 8 9 .. _Anchor-Peer: 10 11 Anchor Peer 12 ----------- 13 14 Used by gossip to make sure peers in different organizations know about each other. 15 16 When a configuration block that contains an update to the anchor peers is committed, 17 peers reach out to the anchor peers and learn from them about all of the peers known 18 to the anchor peer(s). Once at least one peer from each organization has contacted an 19 anchor peer, the anchor peer learns about every peer in the channel. Since gossip 20 communication is constant, and because peers always ask to be told about the existence 21 of any peer they don't know about, a common view of membership can be established for 22 a channel. 23 24 For example, let's assume we have three organizations --- ``A``, ``B``, ``C`` --- in the channel 25 and a single anchor peer --- ``peer0.orgC`` --- defined for organization ``C``. 26 When ``peer1.orgA`` (from organization ``A``) contacts ``peer0.orgC``, it will 27 tell ``peer0.orgC`` about ``peer0.orgA``. And when at a later time ``peer1.orgB`` 28 contacts ``peer0.orgC``, the latter would tell the former about ``peer0.orgA``. 29 From that point forward, organizations ``A`` and ``B`` would start exchanging 30 membership information directly without any assistance from ``peer0.orgC``. 31 32 As communication across organizations depends on gossip in order to work, there must 33 be at least one anchor peer defined in the channel configuration. It is strongly 34 recommended that every organization provides its own set of anchor peers for high 35 availability and redundancy. 36 37 .. _glossary_ACL: 38 39 ACL 40 --- 41 42 An ACL, or Access Control List, associates access to specific peer 43 resources (such as system chaincode APIs or event services) to a Policy_ 44 (which specifies how many and what types of organizations or roles are 45 required). The ACL is part of a channel's configuration. It is therefore 46 persisted in the channel's configuration blocks, and can be updated using the 47 standard configuration update mechanism. 48 49 An ACL is formatted as a list of key-value pairs, where the key identifies 50 the resource whose access we wish to control, and the value identifies the 51 channel policy (group) that is allowed to access it. For example 52 ``lscc/GetDeploymentSpec: /Channel/Application/Readers`` 53 defines that the access to the life cycle chaincode ``GetDeploymentSpec`` API 54 (the resource) is accessible by identities which satisfy the 55 ``/Channel/Application/Readers`` policy. 56 57 A set of default ACLs is provided in the ``configtx.yaml`` file which is 58 used by configtxgen to build channel configurations. The defaults can be set 59 in the top level "Application" section of ``configtx.yaml`` or overridden 60 on a per profile basis in the "Profiles" section. 61 62 .. _Block: 63 64 Block 65 ----- 66 67 .. figure:: ./glossary/glossary.block.png 68 :scale: 50 % 69 :align: right 70 :figwidth: 40 % 71 :alt: A Block 72 73 Block B1 is linked to block B0. Block B2 is linked to block B1. 74 75 ======= 76 77 A block contains an ordered set of transactions. It is cryptographically linked 78 to the preceding block, and in turn it is linked to be subsequent blocks. The 79 first block in such a chain of blocks is called the **genesis block**. Blocks 80 are created by the ordering service, and then validated and committed by peers. 81 82 83 .. _Chain: 84 85 86 Chain 87 ----- 88 89 .. figure:: ./glossary/glossary.blockchain.png 90 :scale: 75 % 91 :align: right 92 :figwidth: 40 % 93 :alt: Blockchain 94 95 Blockchain B contains blocks 0, 1, 2. 96 97 ======= 98 99 The ledger's chain is a transaction log structured as hash-linked blocks of 100 transactions. Peers receive blocks of transactions from the ordering service, mark 101 the block's transactions as valid or invalid based on endorsement policies and 102 concurrency violations, and append the block to the hash chain on the peer's 103 file system. 104 105 .. _chaincode: 106 107 Chaincode 108 --------- 109 110 See Smart-Contract_. 111 112 .. _Channel: 113 114 Channel 115 ------- 116 117 .. figure:: ./glossary/glossary.channel.png 118 :scale: 30 % 119 :align: right 120 :figwidth: 40 % 121 :alt: A Channel 122 123 Channel C connects application A1, peer P2 and ordering service O1. 124 125 ======= 126 127 A channel is a private blockchain overlay which allows for data 128 isolation and confidentiality. A channel-specific ledger is shared across the 129 peers in the channel, and transacting parties must be authenticated to 130 a channel in order to interact with it. Channels are defined by a 131 Configuration-Block_. 132 133 134 .. _Commit: 135 136 Commit 137 ------ 138 139 Each Peer_ on a channel validates ordered blocks of 140 transactions and then commits (writes/appends) the blocks to its replica of the 141 channel Ledger_. Peers also mark each transaction in each block 142 as valid or invalid. 143 144 .. _Concurrency-Control-Version-Check: 145 146 Concurrency Control Version Check 147 --------------------------------- 148 149 Concurrency Control Version Check is a method of keeping ledger state in sync across 150 peers on a channel. Peers execute transactions in parallel, and before committing 151 to the ledger, peers check whether the state read at the time the transaction 152 was executed has been modified in a new block that was in-flight at time of execution 153 or in a prior transaction in the same block. 154 If the data read for the transaction has changed between execution time and 155 commit time, then a Concurrency Control Version Check violation has 156 occurred, and the transaction is marked as invalid on the ledger and values 157 are not updated in the state database. 158 159 .. _Configuration-Block: 160 161 Configuration Block 162 ------------------- 163 164 Contains the configuration data defining members and policies for a system 165 chain (ordering service) or channel. Any configuration modifications to a 166 channel or overall network (e.g. a member leaving or joining) will result 167 in a new configuration block being appended to the appropriate chain. This 168 block will contain the contents of the genesis block, plus the delta. 169 170 .. _Consensus: 171 172 Consensus 173 --------- 174 175 A broader term overarching the entire transactional flow, which serves to generate 176 an agreement on the order and to confirm the correctness of the set of transactions 177 constituting a block. 178 179 .. _Consenter-Set: 180 181 Consenter set 182 ------------- 183 184 In a Raft ordering service, these are the ordering nodes actively participating 185 in the consensus mechanism on a channel. If other ordering nodes exist on the 186 system channel, but are not a part of a channel, they are not part of that 187 channel's consenter set. 188 189 .. _Consortium: 190 191 Consortium 192 ---------- 193 194 A consortium is a collection of non-orderer organizations on the blockchain 195 network. These are the organizations that form and join channels and that own 196 peers. While a blockchain network can have multiple consortia, most blockchain 197 networks have a single consortium. At channel creation time, all organizations 198 added to the channel must be part of a consortium. However, an organization 199 that is not defined in a consortium may be added to an existing channel. 200 201 .. _Chaincode-definition: 202 203 Chaincode definition 204 -------------------- 205 206 A chaincode definition is used by organizations to agree on the parameters of a 207 chaincode before it can be used on a channel. Each channel member that wants to 208 use the chaincode to endorse transactions or query the ledger needs to approve 209 a chaincode definition for their organization. Once enough channel members have 210 approved a chaincode definition to meet the Lifecycle Endorsement policy (which 211 is set to a majority of organizations in the channel by default), the chaincode 212 definition can be committed to the channel. After the definition is committed, 213 the first invoke of the chaincode (or, if requested, the execution of the Init 214 function) will start the chaincode on the channel. 215 216 .. _Dynamic-Membership: 217 218 Dynamic Membership 219 ------------------ 220 221 Hechain supports the addition/removal of members, peers, and ordering service 222 nodes, without compromising the operationality of the overall network. Dynamic 223 membership is critical when business relationships adjust and entities need to 224 be added/removed for various reasons. 225 226 .. _Endorsement: 227 228 Endorsement 229 ----------- 230 231 Refers to the process where specific peer nodes execute a chaincode transaction and return 232 a proposal response to the client application. The proposal response includes the 233 chaincode execution response message, results (read set and write set), and events, 234 as well as a signature to serve as proof of the peer's chaincode execution. 235 Chaincode applications have corresponding endorsement policies, in which the endorsing 236 peers are specified. 237 238 .. _Endorsement-policy: 239 240 Endorsement policy 241 ------------------ 242 243 Defines the peer nodes on a channel that must execute transactions attached to a 244 specific chaincode application, and the required combination of responses (endorsements). 245 A policy could require that a transaction be endorsed by a minimum number of 246 endorsing peers, a minimum percentage of endorsing peers, or by all endorsing 247 peers that are assigned to a specific chaincode application. Policies can be 248 curated based on the application and the desired level of resilience against 249 misbehavior (deliberate or not) by the endorsing peers. A transaction that is submitted 250 must satisfy the endorsement policy before being marked as valid by committing peers. 251 252 .. _Follower: 253 254 Follower 255 -------- 256 257 In a leader based consensus protocol, such as Raft, these are the nodes which 258 replicate log entries produced by the leader. In Raft, the followers also receive 259 "heartbeat" messages from the leader. In the event that the leader stops sending 260 those message for a configurable amount of time, the followers will initiate a 261 leader election and one of them will be elected leader. 262 263 .. _Genesis-Block: 264 265 Genesis Block 266 ------------- 267 268 The configuration block that initializes the ordering service, or serves as the 269 first block on a chain. 270 271 .. _Gossip-Protocol: 272 273 Gossip Protocol 274 --------------- 275 276 The gossip data dissemination protocol performs three functions: 277 1) manages peer discovery and channel membership; 278 2) disseminates ledger data across all peers on the channel; 279 3) syncs ledger state across all peers on the channel. 280 Refer to the :doc:`Gossip <gossip>` topic for more details. 281 282 .. _Fabric-ca: 283 284 Hechain CA 285 --------------------- 286 287 Hechain CA is the default Certificate Authority component, which 288 issues PKI-based certificates to network member organizations and their users. 289 The CA issues one root certificate (rootCert) to each member and one enrollment 290 certificate (ECert) to each authorized user. 291 292 .. _Init: 293 294 Init 295 ---- 296 297 A method to initialize a chaincode application. All chaincodes need to have an 298 an Init function. By default, this function is never executed. However you can 299 use the chaincode definition to request the execution of the Init function in 300 order to initialize the chaincode. 301 302 Install 303 ------- 304 305 The process of placing a chaincode on a peer's file system. 306 307 Instantiate 308 ----------- 309 310 The process of starting and initializing a chaincode application on a specific 311 channel. After instantiation, peers that have the chaincode installed can accept 312 chaincode invocations. 313 314 **NOTE**: *This method i.e. Instantiate was used in the 1.4.x and older versions of the chaincode 315 lifecycle. For the current procedure used to start a chaincode on a channel with 316 the new Fabric chaincode lifecycle introduced as part of Fabric v2.0, 317 see Chaincode-definition_.* 318 319 .. _Invoke: 320 321 Invoke 322 ------ 323 324 Used to call chaincode functions. A client application invokes chaincode by 325 sending a transaction proposal to a peer. The peer will execute the chaincode 326 and return an endorsed proposal response to the client application. The client 327 application will gather enough proposal responses to satisfy an endorsement policy, 328 and will then submit the transaction results for ordering, validation, and commit. 329 The client application may choose not to submit the transaction results. For example 330 if the invoke only queried the ledger, the client application typically would not 331 submit the read-only transaction, unless there is desire to log the read on the ledger 332 for audit purpose. The invoke includes a channel identifier, the chaincode function to 333 invoke, and an array of arguments. 334 335 .. _Leader: 336 337 Leader 338 ------ 339 340 In a leader based consensus protocol, like Raft, the leader is responsible for 341 ingesting new log entries, replicating them to follower ordering nodes, and 342 managing when an entry is considered committed. This is not a special **type** 343 of orderer. It is only a role that an orderer may have at certain times, and 344 then not others, as circumstances determine. 345 346 .. _Leading-Peer: 347 348 Leading Peer 349 ------------ 350 351 Each Organization_ can own multiple peers on each channel that 352 they subscribe to. One or more of these peers should serve as the leading peer 353 for the channel, in order to communicate with the network ordering service on 354 behalf of the organization. The ordering service delivers blocks to the 355 leading peer(s) on a channel, who then distribute them to other peers within 356 the same organization. 357 358 .. _Ledger: 359 360 Ledger 361 ------ 362 363 .. figure:: ./glossary/glossary.ledger.png 364 :scale: 25 % 365 :align: right 366 :figwidth: 20 % 367 :alt: A Ledger 368 369 A Ledger, 'L' 370 371 372 A ledger consists of two distinct, though related, parts -- a "blockchain" and 373 the "state database", also known as "world state". Unlike other ledgers, 374 blockchains are **immutable** -- that is, once a block has been added to the 375 chain, it cannot be changed. In contrast, the "world state" is a database 376 containing the current value of the set of key-value pairs that have been added, 377 modified or deleted by the set of validated and committed transactions in the 378 blockchain. 379 380 It's helpful to think of there being one **logical** ledger for each channel in 381 the network. In reality, each peer in a channel maintains its own copy of the 382 ledger -- which is kept consistent with every other peer's copy through a 383 process called **consensus**. The term **Distributed Ledger Technology** 384 (**DLT**) is often associated with this kind of ledger -- one that is logically 385 singular, but has many identical copies distributed across a set of network 386 nodes (peers and the ordering service). 387 388 .. _Log-entry: 389 390 Log entry 391 --------- 392 393 The primary unit of work in a Raft ordering service, log entries are distributed 394 from the leader orderer to the followers. The full sequence of such entries known 395 as the "log". The log is considered to be consistent if all members agree on the 396 entries and their order. 397 398 .. _Member: 399 400 Member 401 ------ 402 403 See Organization_. 404 405 .. _MSP: 406 407 Membership Service Provider 408 --------------------------- 409 410 .. figure:: ./glossary/glossary.msp.png 411 :scale: 35 % 412 :align: right 413 :figwidth: 25 % 414 :alt: An MSP 415 416 An MSP, 'ORG.MSP' 417 418 419 The Membership Service Provider (MSP) refers to an abstract component of the 420 system that provides credentials to clients, and peers for them to participate 421 in a Hechain network. Clients use these credentials to authenticate 422 their transactions, and peers use these credentials to authenticate transaction 423 processing results (endorsements). While strongly connected to the transaction 424 processing components of the systems, this interface aims to have membership 425 services components defined, in such a way that alternate implementations of 426 this can be smoothly plugged in without modifying the core of transaction 427 processing components of the system. 428 429 .. _Membership-Services: 430 431 Membership Services 432 ------------------- 433 434 Membership Services authenticates, authorizes, and manages identities on a 435 permissioned blockchain network. The membership services code that runs in peers 436 and orderers both authenticates and authorizes blockchain operations. It is a 437 PKI-based implementation of the Membership Services Provider (MSP) abstraction. 438 439 .. _Ordering-Service: 440 441 Ordering Service 442 ---------------- 443 444 Also known as **orderer**. A defined collective of nodes that orders transactions into a block 445 and then distributes blocks to connected peers for validation and commit. The ordering service 446 exists independent of the peer processes and orders transactions on a first-come-first-serve basis 447 for all channels on the network. It is designed to support pluggable implementations beyond the 448 out-of-the-box Kafka and Raft varieties. It is a common binding for the overall network; it 449 contains the cryptographic identity material tied to each Member_. 450 451 .. _Organization: 452 453 Organization 454 ------------ 455 456 ===== 457 458 459 .. figure:: ./glossary/glossary.organization.png 460 :scale: 25 % 461 :align: right 462 :figwidth: 20 % 463 :alt: An Organization 464 465 An organization, 'ORG' 466 467 468 Also known as "members", organizations are invited to join the blockchain network 469 by a blockchain network provider. An organization is joined to a network by adding its 470 Membership Service Provider (MSP_) to the network. The MSP defines how other members of the 471 network may verify that signatures (such as those over transactions) were generated by a valid 472 identity, issued by that organization. The particular access rights of identities within an MSP 473 are governed by policies which are also agreed upon when the organization is joined to the 474 network. An organization can be as large as a multi-national corporation or as small as an 475 individual. The transaction endpoint of an organization is a Peer_. A collection of organizations 476 form a Consortium_. While all of the organizations on a network are members, not every organization 477 will be part of a consortium. 478 479 .. _Peer: 480 481 Peer 482 ---- 483 484 .. figure:: ./glossary/glossary.peer.png 485 :scale: 25 % 486 :align: right 487 :figwidth: 20 % 488 :alt: A Peer 489 490 A peer, 'P' 491 492 A network entity that maintains a ledger and runs chaincode containers in order to perform 493 read/write operations to the ledger. Peers are owned and maintained by members. 494 495 .. _Policy: 496 497 Policy 498 ------ 499 500 Policies are expressions composed of properties of digital identities, for 501 example: ``OR('Org1.peer', 'Org2.peer')``. They are used to restrict access to 502 resources on a blockchain network. For instance, they dictate who can read from 503 or write to a channel, or who can use a specific chaincode API via an ACL_. 504 Policies may be defined in ``configtx.yaml`` prior to bootstrapping an ordering 505 service or creating a channel, or they can be specified when instantiating 506 chaincode on a channel. A default set of policies ship in the sample 507 ``configtx.yaml`` which will be appropriate for most networks. 508 509 .. _glossary-Private-Data: 510 511 Private Data 512 ------------ 513 514 Confidential data that is stored in a private database on each authorized peer, 515 logically separate from the channel ledger data. Access to this data is 516 restricted to one or more organizations on a channel via a private data 517 collection definition. Unauthorized organizations will have a hash of the 518 private data on the channel ledger as evidence of the transaction data. Also, 519 for further privacy, hashes of the private data go through the 520 Ordering-Service_, not the private data itself, so this keeps private data 521 confidential from Orderer. 522 523 .. _glossary-Private-Data-Collection: 524 525 Private Data Collection (Collection) 526 ------------------------------------ 527 528 Used to manage confidential data that two or more organizations on a channel 529 want to keep private from other organizations on that channel. The collection 530 definition describes a subset of organizations on a channel entitled to store 531 a set of private data, which by extension implies that only these organizations 532 can transact with the private data. 533 534 .. _Proposal: 535 536 Proposal 537 -------- 538 539 A request for endorsement that is aimed at specific peers on a channel. Each 540 proposal is either an Init or an Invoke (read/write) request. 541 542 543 .. _Query: 544 545 Query 546 ----- 547 548 A query is a chaincode invocation which reads the ledger current state but does 549 not write to the ledger. The chaincode function may query certain keys on the ledger, 550 or may query for a set of keys on the ledger. Since queries do not change ledger state, 551 the client application will typically not submit these read-only transactions for ordering, 552 validation, and commit. Although not typical, the client application can choose to 553 submit the read-only transaction for ordering, validation, and commit, for example if the 554 client wants auditable proof on the ledger chain that it had knowledge of specific ledger 555 state at a certain point in time. 556 557 .. _Quorum: 558 559 Quorum 560 ------ 561 562 This describes the minimum number of members of the cluster that need to 563 affirm a proposal so that transactions can be ordered. For every consenter set, 564 this is a **majority** of nodes. In a cluster with five nodes, three must be 565 available for there to be a quorum. If a quorum of nodes is unavailable for any 566 reason, the cluster becomes unavailable for both read and write operations and 567 no new logs can be committed. 568 569 .. _Raft: 570 571 Raft 572 ---- 573 574 New for v1.4.1, Raft is a crash fault tolerant (CFT) ordering service 575 implementation based on the `etcd library <https://coreos.com/etcd/>`_ 576 of the `Raft protocol <https://raft.github.io/raft.pdf>`_. Raft follows a 577 "leader and follower" model, where a leader node is elected (per channel) and 578 its decisions are replicated by the followers. Raft ordering services should 579 be easier to set up and manage than Kafka-based ordering services, and their 580 design allows organizations to contribute nodes to a distributed ordering 581 service. 582 583 .. _SDK: 584 585 Software Development Kit (SDK) 586 ------------------------------ 587 588 The Hechain client SDK provides a structured environment of libraries 589 for developers to write and test chaincode applications. The SDK is fully 590 configurable and extensible through a standard interface. Components, including 591 cryptographic algorithms for signatures, logging frameworks and state stores, 592 are easily swapped in and out of the SDK. The SDK provides APIs for transaction 593 processing, membership services, node traversal and event handling. 594 595 Currently, there are three officially supported SDKs -- for Node.js, Java, and Go. While the Python SDK 596 is not yet official but can still be downloaded and tested. 597 598 .. _Smart-Contract: 599 600 Smart Contract 601 -------------- 602 603 A smart contract is code -- invoked by a client application external to the 604 blockchain network -- that manages access and modifications to a set of 605 key-value pairs in the :ref:`World-State` via :ref:`Transaction`. In Hechain, 606 smart contracts are packaged as chaincode. Chaincode is installed on peers 607 and then defined and used on one or more channels. 608 609 .. _State-DB: 610 611 State Database 612 -------------- 613 614 World state data is stored in a state database for efficient reads and queries 615 from chaincode. Supported databases include levelDB and couchDB. 616 617 .. _System-Chain: 618 619 System Chain 620 ------------ 621 622 Contains a configuration block defining the network at a system level. The 623 system chain lives within the ordering service, and similar to a channel, has 624 an initial configuration containing information such as: MSP information, policies, 625 and configuration details. Any change to the overall network (e.g. a new org 626 joining or a new ordering node being added) will result in a new configuration block 627 being added to the system chain. 628 629 The system chain can be thought of as the common binding for a channel or group 630 of channels. For instance, a collection of financial institutions may form a 631 consortium (represented through the system chain), and then proceed to create 632 channels relative to their aligned and varying business agendas. 633 634 .. _Transaction: 635 636 Transaction 637 ----------- 638 639 .. figure:: ./glossary/glossary.transaction.png 640 :scale: 30 % 641 :align: right 642 :figwidth: 20 % 643 :alt: A Transaction 644 645 A transaction, 'T' 646 647 Transactions are created when a chaincode is invoked from a client application 648 to read or write data from the ledger. Fabric application clients submit transaction proposals to 649 endorsing peers for execution and endorsement, gather the signed (endorsed) responses from those 650 endorsing peers, and then package the results and endorsements into a transaction that is 651 submitted to the ordering service. The ordering service orders and places transactions 652 in a block that is broadcast to the peers which validate and commit the transactions to the ledger 653 and update world state. 654 655 .. _World-State: 656 657 World State 658 ----------- 659 660 .. figure:: ./glossary/glossary.worldstate.png 661 :scale: 40 % 662 :align: right 663 :figwidth: 25 % 664 :alt: Current State 665 666 The World State, 'W' 667 668 Also known as the “current state”, the world state is a component of the 669 Hechain :ref:`Ledger`. The world state represents the latest values 670 for all keys included in the chain transaction log. Chaincode executes 671 transaction proposals against world state data because the world state provides 672 direct access to the latest value of these keys rather than having to calculate 673 them by traversing the entire transaction log. The world state will change 674 every time the value of a key changes (for example, when the ownership of a 675 car -- the "key" -- is transferred from one owner to another -- the 676 "value") or when a new key is added (a car is created). As a result, the world 677 state is critical to a transaction flow, since the current state of a key-value 678 pair must be known before it can be changed. Peers commit the latest values to 679 the ledger world state for each valid transaction included in a processed block. 680 681 682 .. Licensed under Creative Commons Attribution 4.0 International License 683 https://creativecommons.org/licenses/by/4.0/