The authors defend that execute-order-validate has advantages in relation to the usual order-execute paradigm seen in blockchains like Bitcoin and Ethereum.
Chaincode executes transaction proposals against world state data, as the world state provides direct access to the latest value of these keys. Given this, there is no need to traverse the entire transaction log and calculate its values.
Channels allow participants to establish a communication path between the subset of participants that have permissions to visualize a subset of transactions.
Fabric introduces a hybrid replication model, combining active and passive replication (primarybackup-replication, ported to the untrusted environment).
the consensus is reached, concerning their ordering. Passive replication happens as endorsers send the result of the transaction processing to commit nodes.
It is a simple, fast key-value storage library that provides an ordered mapping from string keys to string values.
Such assets can be exchanged between network participants, through transactions.
- Committing peer. Each peer maintains the current snapshot of the current state of the ledger, as a store of key-value. Such peers cannot invoke chaincode functions.
- Endorser peer. Endorser peers have chaincode installed. When they receive a transaction proposal, they simulate the transaction execution on isolated containers. Based on that simulation, such peers prepare a transaction proposal that is then sent to the orderer peer. The existence of endorser peers avoids sequential execution of transactions by all peers.
- Orderer peer. Orderers receive endorsed transactions and assemble them into blocks. After grouping transactions, orderers assure consensus, by propagating such blocks to committing peers, where they are validated and then committed to the shared ledger. Orderer
peers record valid and invalid transactions, while other peers only contain valid transactions.
Anchor peers serve as an intermediary between peers from its organisation and peers from an external one.
Leader peers take the responsibility of distributing the transactions from the orderer to committing peers.
Architecture of a Fabric's solution.
The endorsement policy defines the voting-based scheme to be used by peers and, consequently, the weight of each peer regarding the validity of a transaction.
- Transaction proposal. A blockchain client, which represents an organisation, creates a transaction proposal, and sends it to endorsement peers, as defined in the endorsement policy. The proposal contains information regarding the identity of the proposer, the transaction payload, a nonce, and a transaction identifier.
- Execute (endorsement): the endorsement consists in the simulation of the transaction. The endorsers produce a write-set, containing the keys and their modified values, and a read-set. The endorsement peers also check the correctness of transaction execution. The endorsement is sent as the proposal response and contains the write-set, read-set, the transaction ID, endorser’s ID, and the endorser’s signature. When the client collects enough endorsements (which need to have the same execution result), it creates the transaction and sends it to the ordering service. The endorsement phase eliminates any eventual non-determinism.
- Order : after the endorsement, there is the ordering phase, performed by orderers. The ordering service checks if the blockchain client that submitted the transaction proposal has appropriate permissions (broadcast and receiving permissions), on a given channel. Ordering produces blocks containing endorsed transactions, in an ordered sequence, per channel. The ordering allows the network to achieve consensus. The orderer broadcasts transaction’s outputs to all the peers.
- Validate. Firstly, each peer validates the received transactions by checking if a transaction follows the correspondent endorsement policy. After that, a read-write conflict check is run against all transactions in the block, sequentially. For each transaction, it compares the versions of the keys in the read-set with those currently on the ledger. It checks if the values are the same. In case they do not match, the peers discard the transaction. Finally, the ledger is updated, in which the ledger appends the created block to its head. The ledger appends the results of the validity checks, including the invalid transactions.
- Elli Androulaki, Yacov Manevich, Srinivasan Muralidharan, Chet Murthy, Binh Nguyen, Manish Sethi, Gari Singh, Keith Smith, Alessandro Sorniotti, Chrysoula Stathakopoulou, and Et al. Hyperledger Fabric: A Distributed Operating System for Permissioned
Blockchains. Proceedings of the Thirteenth EuroSys Conference, 2018 - Hyperledger Foundation. Hyperledger Fabric Documentation, 2018. URL https://hyperledger-fabric.readthedocs.io/en/release-1.4. Accessed on 2018-11-12
- Marko Vukolic. Rethinking Permissioned Blockchains. In Proceedings of the ACM Workshop on Blockchain, Cryptocurrencies and Contracts, pages 3–7, 2017