Brief Details Of Consensus Protocols For Beginners-2

The Blockchain Cafe
15 min readJul 30, 2019
Brief Details Of Consensus Protocols For Beginners-2

Consensus protocols are important components of distributed blockchain systems required for their functionality. Users can interact with each other conveniently with the help of the consensus protocols. The correct uses of the consensus protocols in cryptocurrency platforms have already shown their extraordinary potential.

Proof-of-Concept (POC)

A proof-of-concept (POC) is a demonstration. Demonstrating that certain concepts or theories have the potential for real-world applications is a purpose of POC. It is actually used to determine feasibility. POC is also known as a prototype and a proof-of-principle (PoP).
POC is a term which has multiple meanings in different kinds of areas.
In software development, PoC comes with different processes which have different objectives and participants roles. PoC is a partial solution which has a small number of users. The main purpose of the users is to act in business roles. Whether certain requirements are fulfilled by a system will be determined by the users. This approach shows the way through which the integration of systems can be done. It also shows the way through which throughput can be obtained with the help of a given configuration. Finding solutions to technical problems is an overall objective of POC.
In the business world, whether a product is viable in terms of finance will be demonstrated by startups. An extensive research and review is included in PoC. The submission of the extensive research and review is done as a single package to concerned partners. The examination of a revenue model of a business is included in POC.
Companies show a few things in the revenue model:
Projected revenue from products & services
Development costs and long-term finance projections
The service costs for maintaining and marketing purposes. Amounts that the service costs for these purposes are also indicated.
The evaluation of a business can be done internally with the help of POC. The evolution of the business can’t just be done internally, but it can be done at proposed acquisitions and projects.

Byzantine Fault Tolerance (BFT)

Byzantine Fault Tolerance (BFT) is a difficult challenge where communication between two nodes can be done safely in a network. The two nodes will know that the same data is displayed by them. The blockchain technology addressed the challenge.
Two computers can’t completely and irrefutably guarantee that the same data is displayed by them, is stated by the “Byzantine Generals’ Problem.”
Eg: If a network is unreliable, then two computers can’t ensure ever that the arrival of their communicated data has done.
A consensus in a decentralized and distributed network is achieved by “Byzantine Generals’ Problem.” Some devices can be faulty while some devices are tired of hackers.
If a unanimous agreement on the decision of the loyal and non-faulty nodes is achieved in Peer-to-Peer (P2P) network, then a consensus will be achieved.
An incoming message is duplicated and sent to other recipients in the existing network in BFT. An assumption of all nodes is that the issue of Byzantine nodes is excluded by the act of repeating a message.
A node in BFT can lie. The node can’t just lie, but it can deliberately mislead other nodes in BFT. If Byzantine nodes in the network are limited, then they will be able to perform work accurately and reach a consensus despite the illicit interventions.
The blockchain faced the “Byzantine Generals’ Problem.” Unsafe and reliable communication between nodes is a problem. The problem has been resolved. All the nodes can reach a consensus effectively.
The idea came from a story of a group of Byzantine generals. The group of Byzantine generals surrounded a city with the intention of conquering it. The attack was done one time synchronically in order to conquer the city successfully. The attack co-ordination was done through the foot.
This scenario faces several problems. A message would not be delivered and a synchronized attack would not be possible due to the capturing of any of the messengers. A false message would be sent and the attack of the generals would be sabotaged due to traitors in the mask of generals.
Half of the generals could be informed by a dishonest general that the plan is now to retreat. The plan of the dishonest general is to ensure that they do this.
While half of the generals could be told to attack. The plan of the dishonest general is to doom them.
Overcoming this challenging situation is possible with BFT.
The story is just like nodes in the network and their tasks and challenges. Nodes in the P2P network try to agree on the information which is displayed. This was the main issue to create a digital currency in the past. Satoshi Nakamoto who has successfully founded a digital currency called Bitcoin and blockchain technology. Different consensus protocols take different approaches to reach a secure and efficient consensus.

Proof-of-Authority (PoA)

Consensus algorithms in blockchains can be divided into permissionless and permissioned. Blockchains of cryptocurrencies like Bitcoin (BTC) and Ethereum (ETH) are permissionless. Apla and Etherium Private are permissioned or private blockchains.
Permissioned blockchain
Every node is pre-authenticated
Consensus types can be used. The main purpose of the consensus types is to provide a high transaction rate. PoA is one of the consensus types.
PoA is a new consensus algorithm. High performance and fault tolerance are provided by PoA. Fault tolerance helps a system in working properly and continuously despite the failure. The failure can be of some of the components of the system. Nodes have to prove their authorities to create a new block. If a node passes a preliminary authentication, then the node will gain authority and a right to create a new block.
PoW requires the electricity hugely and PoS requires shares or stakes in large amounts.
PoA has various advantages:
Nodes don’t require high-performance hardware. Spending of computational resources is not required to solve mathematical equations. The prediction of the interval of time at which nodes create new blocks is possible. The interval of time varies for PoW and PoS.
PoA has a high transaction rate. Authorized network nodes create blocks in a sequence. The blocks are created at an appointed time interval. The speed at which the authorized network nodes validate transactions is increased.
A ban mechanism for malicious nodes is implemented by Apla. Rights to create blocks are revoked for the malicious nodes.
It is an example of a Denial-of-service (DoS) attack
A Denial-of-service (DoS) attack is a cyber attack. In the cyberattack DoS, an attacker tries to target users and stop them from accessing the service temporarily or indefinitely.
An attacker sends a digital currency in large amounts to a targeted network node
The operation of the targeted network node will be disrupted
PoA can be used to defend against the attack:
All nodes in the network are pre-authenticated. Nodes who can stand against DoS attacks will be provided with rights for the creation of a new block.
PoA will remove a node from a group of validating nodes due to the unavailability of the node for a new block to completion.
51% Attack
An attacker requires control over 51% of network nodes for a 51% attack. The 51% attack in PoA is not like the 51% attack of PoW. It is difficult to gain control over nodes in a permissioned blockchain network.
In PoA, decisions of the blockchain network will not be affected by computational power.
Working of PoA in Apla
New blocks will be created by validated nodes or selected nodes. The blockchain network and the distributed ledger will be maintained by the validated nodes only.
The blockchain registry is used to keep the list of validating nodes. The sequence is determined by the order of nodes in this list. Nodes create new blocks in the sequence.
Creation of a new block
A leader node of the current interval time creates a new block. The role of a leader node is transferred to the next validating node at each interval time. The next validating node will be selected from the list of validating nodes. In simple words, the current leader node means a node who creates a new block at the current time.
The current leader node is determined by a formula.
leader = ((time — first) / step) % nodes
Leader: the current leader node
Time: the current time (UNIX)
First: the first block generation time (UNIX)
Step: the number of seconds in the block generation interval
Nodes: the number of nodes at the current block generation interval.
The current leader node will collect all new transactions. All the new transactions will be collected from a transaction queue.
Transactions will be executed one by one. Invalid transactions will be rejected.
Compliance to block generation limits will also be checked.
A new block will be created. The new block will be signed with the private key of the node.
The new block will be sent to other validating nodes.
Validation of the new block:
Other validating nodes will receive the new block. The validating nodes will validate the new block.
The leader node of a current interval time created the new bock.
The leader node of a current interval doesn’t create any block.
iii. The generation and signing of the new block will be done.
Transactions from the block will be executed one by one. Whether transactions are executed successfully will be checked. Whether the transactions are executed within block generation limits will also be checked.
The successfully validated block will be added to the existing blockchain. Whereas the unsuccessful validated block will not be added. It will be rejected. A bad block transaction will be sent. If a validating node creates invalid blocks continuously, then the node will be removed from the list of validating blocks.

Delegated Byzantine Fault Tolerance (dBFT)

Proof-o-Work (PoW) and Proof-of-Stake (PoS) are used to power blockchains. The blockchains can also be powered through other ways. dBFT is an algorithm used to power the blockchains. Nodes can reach a consensus using dBFT. Many blockchain and cryptocurrency adopters can find difficulties to understand this concept as it is a complicated concept. It is not an easy concept like PoW or PoS.
Binance is considered as the world’s biggest cryptocurrency exchange. It has made decisions to use dBFT. dBFT can be used for its chain. Unreliable or untrustworthy participants can be countered effectively with dBFT.
NEO is the first original public blockchain project in China. NEO is called as the “Ethereum of China”. NEO wants to achieve a “smart economy”. The concept of smart contracts is used by NEO. More participations are allowed by the voting system of dBFT.
A specific ‘bookkeeper’ can be supported by a NEO token holder with a vote. BFT is used by a selected group of bookkeepers in order to create a new block. It is difficult to bifurcate the final confirmed block. It is difficult to revoke the transaction. dBFT has an absolute finality. NEO is not a complete decentralized network. This fact guarantees the finality. Only seven nodes and some delegates work on the blockchain of NEO. More nodes are linked with the NEO council.
dBFT is just like Delegated Proof-of-Stake (DPosS). Just amounts of a cryptocurrency don’t matter here. NEO token holders can use a voting process to vote for delegates. If a node fulfills certain requirements, then the node will become a delegate. A reliable internet connection, the right equipment, a validated identity, and 1,000 GAS are required. A user receives a reward as GAS. A random speaker is selected from the delegates. A new block from the transactions is created by the speaker. The new block will now be validated. The elected delegates will be proposed for the validation of the new block. All transactions can be tracked and recorded on the network by the delegates. The proposal will be shared and compared by the delegates. It is related to testing of data accuracy. More than two-thirds of the delegates have to reach a consensus and validate the new block in order to add the block to the existing blockchain. A real-time voting process happens in the NEO network.
Advantages:
A new block can be created between 15 and 20 seconds.
Almost 1,000 Transaction Per Second (TPS) is the transaction throughput. The hope of NEO is to touch 100,000 TPS. The network can support commercial applications on a large scale through the 100,000 TPS.
No need to expend energy like PoW
If the confirmation of a block is done, then the total finality will be received
No forks are present on the blockchain of NEO
Disadvantages:
Delegates will have to provide real identities to operate in dBFT
Regulated blockchains are required by dBFT. A certain level of centralization is included.
dBFT can reach a consensus despite one or more corrupted nodes. Tolerance to malicious users can be decreased through dBFT. Therefore, a worldwide public blockchain can see dBFT as their right tool. Adopters don’t use a blockchain due to the need for centralization and the lack of anonymity.
Countering Of Dishonesty
The block proposal can be verified through all delegates. The speaker will send a block to two-thirds of the delegates. The delegates will understand that whether the block is valid. Understanding to the block is easy. The block will not be validated due to the dishonesty of the speaker for sending the invalid proposal to the delegates.
How To Find Corrupt Nodes?
One of the nodes is corrupted
Other delegates will compare their own version of the block proposal in order to know the validity of the block proposal
The delegates can still reach a consensus
The sent block will be validated and the dishonest will be replaced with the agreement of two-thirds of the delegates will agree.
A consensus can be reached despite the dishonesty of the speaker and a delegate. The block comparison is helpful to recognize a corrupted node. The delegates will agree with each other for the invalidation of the block. A new speaker will be selected automatically.
A dishonest speaker and dishonest delegates require control over two-third delegates in order to corrupt data. It is not easy to gain this control due to the voting rights of every NEO token holder. Delegates have to provide their identities. Therefore, they are not anonymous anymore.

Stellar Consensus Protocols (SCP)

Stellar Consensus Protocol (SCP) is the consensus protocol of the Stellar Network developed from the concept of a consensus protocol called Byzantine Agreements (BA). It used quorums and quorum slices to move towards a decentralized and permissionless network.
Decentralized control, low latency, flexible trust, and asymptotic security are provided by the SCP. Although every consensus has its trade-offs, the SCP has a high level of effectiveness with the objective to reach a consensus in a distributed and permissionless network in no time.

Byzantine Agreements and Federated Byzantine Agreements

BA is actually Byzantine fault tolerance of distributed computing systems. A consensus can be reached despite malicious nodes. Behaviors of nodes will not be assumed by BA. While the prototypical model for BA is a consensus algorithm called Practical Byzantine Fault Tolerance (pBFT). A consensus can be reached quickly and efficiently through pBFT. Consensus can be separated from resources. Large communication overhead between participating nodes is required by BA (pBFT). Sybil attacks can be mitigated with the help of unanimous agreement on membership of the network. An attacker subverts a reputation system in Sybil attack
The SCP white paper introduced FBA. Limitations of BA are addressed explicitly. Decentralized control, flexible trust, low latency, and asymptotic security are provided by a consensus protocol. FBA can be used in a permissionless.
FBA uses a unique slot in order to come to an agreement on state updates. Update dependencies between nodes are inferred on the unique slot. Nodes have to agree on the slot update in rounds of consensus. Nodes can join and leave the system. Quorum slices are employed by FBA in SCP. Subsets of a quorum are quorum slices. The strength of quorums is to convince particular nodes of an agreement. Each node will have to select its own quorum slices in FBA. Each node can select other nodes on whom they have trust.

Quorums and Quorum Slices

A quorum consists of nodes. It is used to reach an agreement. Nodes will communicate with each other with the purpose to reach an agreement. An update will be valid due to the meeting of a specific threshold of nodes.
While subsets of a quorum are quorum Slices. The strength of quorums is to convince particular nodes of an agreement. The dependency of a node can be on numerous quorum slices for outside information. The building of this trust will be done in the configuration file of the node. Quorum slices and subsequent decentralization can be formed dynamically.
Node A can come to the conclusion that it has no trust in banks after its research. It can require another quorum slice on whom it can rely on for an agreement with banks. A quorum will be formed due to the reaching of an agreement. The requirement of traditional BA is that all nodes accept the same slices. Traditional BA doesn’t require that all the nodes discern sources of trusted information for themselves. Distinguishing slices and quorums is difficult as there is no way to distinguish them. A closed and permissioned member access to the network is required.
The dependency of the FBA model is on individual nodes for the selection of their own sets of quorum slices. The organic and more decentralized creation of quorums is enabled effectively. The dependency of the quorums is on individual decisions. The evaluation of quorum intersection and disjoint quorums is required in the discussion of safety and liveness in the FBA protocol.
If quorums share a node, then they intersect. Good quorums can create overlapping quorums. Nodes make sure that their selected quorum slices don’t violate quorum intersection. Nodes are required to select conservative slices. The nodes aren’t only required to choose the nodes, but they are also required to create large quorums. Quorums will be known as disjoint quorums due to their non-intersection. The disjoint quorums are actually bad quorums. They can create contradictory statements. Consensus is undermined through the contradictory statements. If nodes balance safety and liveness, then they will ensure a proper slice selection process. Nodes lack safety due to the externalization of those values which oppose other nodes. If nodes are blocked for an agreement, then they will lack liveness. A critical role for an agreement is played by a Federated Voting Model.
In the Federated Voting Model, participants make statements and the SCP agrees on the statements. Nodes exchange two sets of messages. The sub-division of the two message rounds can be done into agreement states. Unknown, accepted, and confirmed are the agreement states. The federated voting process becomes more complicated due to the accumulation of open membership. It is made of four steps. Initial Voting, acceptance, ratification, and confirmation are the four steps.
Initial Voting: Nodes vote for a statement. The statement is valid according to the nodes. Contradictory statements are not voted by them. A node can change its vote. Votes are preliminary votes in terms of technical in this step.
Acceptance: A node can only accept a statement in the situation where the node has not accepted a contradictory statement or a v-blocking set of nodes.
Ratification: A statement will be ratified due to the acceptance of the statement by all members of a quorum. Suppose banks are not trusted by Node A. If Node A shares a quorum slice with other nodes in order to accept a statement, then Node A will only ratify the statement.
Confirmation: The system will agree on a statement due to the processing of a sufficient threshold of messages. The main purpose of nodes in this step is to propagate acceptance messages from nodes within their quorum. Other nodes can be influenced by the acceptance messages to accept a message in the situation also where a different initial message is accepted by the nodes. The broadcast of a round of confirmation messages will be done for the confirmation of the message. The round of voting will be concluded.
Stellar provides resources for doing this voting process effectively than before. A “Galactic Consensus” graphic is provided by Stellar for the purpose of a broader overview. A useful blog post is also provided by Stellar with the help of the Lunchtime Example.

The Stellar Consensus Protocol

The SCP is a construction of the Federated Byzantine Agreement (BFA) Protocol. Instances of a blocked agreement are minimized. They are neutralized with the help of a ballot system. The SCP consists of the nomination protocol and the ballot protocol.
Candidate values are produced for every consensus slot through the nomination protocol. A convergence value for the slot can be deterministically created by each node at the last. Nodes can’t know about the occurring of convergence. The nomination process can be reset by malicious nodes.
When the nomination protocol has converged, and nodes agree about this nomination protocol convergence, then the ballot protocol is performed. The tie of a ballot and a candidate value is done in the ballot protocol. A node has to commit or abort the candidate value in the ballot protocol only. If nodes abort certain votes and moves on to another, then agreement blocking will be avoided. A ballot is committed through votes of nodes. The candidate value is externalized.
The way of treating the slot independently by the SCP at a high-level is just like single-slot consensus in Paxos. In the SCP, no blocked states are present with quorum intersection. A dispensible set mechanism helps to bypass those nodes (befouled nodes) which depend upon bad nodes heavily. Statements can be ratified with no helps from befouled nodes. Consensus can’t be undermined through befouled nodes.
Some highly complex details are contained by the nomination protocol. They are not only contained by the nomination protocol, but they are also contained by the ballot protocol. The details are contained by both the protocols for a split votes scenario.
Safety can be guaranteed in the situation where adequate quorum slices are selected by nodes and it is a limitation of the SCP. A possibility is a security issue in federated systems. Federated systems consist of widely trusted nodes. The main purpose of the trusted nodes is to leverage their positions for unethical advantages. Banks haven’t an information advantage available for other nodes due to their dependency upon wide nodes.

--

--

The Blockchain Cafe

The Blockchain Cafe is your #1 Source for Cryptocurrency and Blockchain News aggregator. https://theblockchaincafe.com/