Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PBFT algorithm in hyperledger

Can anyone explain PBFT Algorithm in detail without giving any link for the same? And how it works in hyperledger. So, once the transaction is sent to the blockchain:

  1. Who validates the transaction?

  2. How the consensus is achieved on the transaction?

  3. How the transaction is committed to the blockchain?

like image 615
Saurabh Avatar asked Jan 18 '17 03:01

Saurabh


People also ask

What is PBFT algorithm?

PBFT is an algorithm based on state machine replica replication, which is used to solve the problem of state machine replica consistency in distributed systems16 and allows the correct implementation of consensus when the fault node does not exceed the total network node (N-1)/3.

What consensus algorithm does Hyperledger fabric use?

Hyperledger Iroha introduces a BFT consensus algorithm called Sumeragi, which tolerates f numbers of Byzantine faulty nodes in a network, like all BFT systems.

What is the difference between PBFT and raft consensus mechanism?

Istanbul BFT is Byzantine Fault Tolerant (BFT) while Raft is Crash Fault Tolerant (CFT). BFT protects the blockchain against bad actors, while CFT only protects against nodes crashing.

What is the correct sequence of operations in PBFT algorithm?

Prepare : Broadcast by every node in the Preparing phase. Commit : Broadcast by every node in the Committing phase. ViewChange : Sent by any node that suspects that the primary is faulty. NewView : Sent by the node that will be the new primary to complete a view change.


2 Answers

"Hyperledger" is a blockchain consortium under The Linux Foundation. Currently there are at least 4 different implementations of blockchain frameworks under Hyperledger:

  • Fabric (IBM)
  • Corda (R3)
  • Iroha
  • Sawtooth Lake (Intel)

In Fabric v0.6:

All validation peers keep open connection to each other. You can submit your transaction to any of them, and this transaction will be broadcasted to other peers in the network. One of peer is elected as "leader". At the moment when a new block is going to be generated:

  1. The leader orders the transactions candidates that should be included in a block, and broadcasts this list of ordered transactions to all other validation peers in the network.
  2. When each of the Validation Peers receives the ordered list of transactions, each validation peer does the following:
    1. It starts executing the ordered transactions one by one.
    2. As soon as all the transactions are executed, it will calculate the hash code for the newly created bloc (the hash code includes hashes for executed transactions and final state of the world).
    3. Then it broadcasts its answer (the resulting hash code) to other peers in the network, and starts counting the responses from them.
    4. If it sees that 2/3 of all validation peers have the same hash code, it will commit the new block to its local copy of the ledger.

In Fabric v1.0:

This version is still in development. In v1 the is no "leader", separate service "Orderer" is responsible for transactions order in a block. This service is pluggable and announced that the will be 3 different options:

  1. Solo - single process is responsible for ordering
  2. Kafka orderer - leverages the Kafka pubsub system to perform the ordering
  3. PBFT - is not implemented yet.

In Corda:

PBFT is not used. This implementation uses another architecture approach.

like image 53
Sergey Balashevich Avatar answered Sep 18 '22 15:09

Sergey Balashevich


In Corda, consensus is provided by notaries. It is up to the notary operator which consensus algorithm they use. BFT is one option. You can see a Corda BFT notary sample here: https://github.com/corda/corda/tree/master/samples/notary-demo.

To answer your questions:

(1). Who validates the transaction?

The transaction is validated by a cluster of one or more notaries. Notaries are nodes with the sole purpose of deconflicting double-spend attempts.

(2). How the consensus is achieved on the transaction?

Using a standard BFT algorithm. Each node in the notary cluster votes on whether they consider the transaction to be a double-spend attempt. The final decision is based on a majority rule, and can tolerate up to 1/3rd of the nodes in the cluster being malicious.

(3). How the transaction is committed to the blockchain?

In Corda, there is no central store of information that the transaction is committed to. The notary cluster simply adds the spent state reference to an internal database table. It will check future attempts to spend states against this table, and reject the spending attempt if the state reference is already stored there.

like image 38
Joel Avatar answered Sep 16 '22 15:09

Joel