简体   繁体   中英

How are Hyperledger transactions ordered in a block?

In Bitcoin blockchain a node/peer will order transactions, create a block, does the PoW and "announces" this block to the other miners.

Once the other miners agree (by hashing the block+nounce+etc...) that the block is valid it is part of the blockchain.

But in Hyperledger (as far as I understood) the VPs don't do mining (and hence don't spread the mined block). So how does the individual VPs order them so that all VPs have the same ordered transactions of blocks?

For the Fabric implementation the goal is to have ( link ):

Consensus is a method for validating the order of network requests, or transactions (deploy and invoke), on a blockchain network. The correct ordering of transactions is critical, because many types of network transactions have a dependency on one or more prior transactions (account debits often have a dependency on prior credits, for example). On a blockchain network, there is no single authority that determines the transaction order; instead, each blockchain node (or peer) has an equal say in establishing the order, by implementing the network consensus protocol. Consensus, therefore, ensures that a quorum of nodes agree on the order in which transactions are appended to the shared ledger. By resolving any discrepancies in the proposed transaction order, consensus guarantees that all network nodes are operating on an identical blockchain. In other words, consensus guarantees the integrity and consistency of blockchain network transactions.

Nevertheless in current version there is a leader (one of validation peers) who is responsible for ordering transactions before they are executed by other peers.

In next Fabric's version this behavior can be changed ( Next Consensus Architecture Proposal ):

A peer communicates with the consensus service and maintain the blockchain state and the ledger. Such peers receive ordered state updates from the consensus service and apply them to the locally held state

Peers are clients of the consensus service, to which the consensus service provides a shared communication channel offering a broadcast service for messages containing transactions. Peers connect to the channel and may send and receive messages on the channel. The channel supports atomic delivery of all messages, that is, message communication with total-order delivery and (implementation specific) reliability. In other words, the channel outputs the same messages to all connected peers and outputs them to all peers in the same logical order. This atomic communication guarantee is also called total-order broadcast, atomic broadcast, or consensus in the context of distributed systems. The communicated messages are the candidate transactions for inclusion in the blockchain state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM