Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Artificial Intelligence and Blockchain

You're reading from   Practical Artificial Intelligence and Blockchain A guide to converging blockchain and AI to build smart applications for new economies

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781838822293
Length 290 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Ganesh Prasad Kumble Ganesh Prasad Kumble
Author Profile Icon Ganesh Prasad Kumble
Ganesh Prasad Kumble
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Section 1: Overview of Blockchain Technology
2. Getting Started with Blockchain FREE CHAPTER 3. Introduction to the AI Landscape 4. Section 2: Blockchain and Artificial Intelligence
5. Domain-Specific Applications of AI and Blockchain 6. AI- and Blockchain-Driven Databases 7. Empowering Blockchain Using AI 8. Cryptocurrency and Artificial Intelligence 9. Section 3: Developing Blockchain Products
10. Development Life Cycle of a DIApp 11. Implementing DIApps 12. The Future of AI with Blockchain 13. Moving Forward - Resources for you 14. Other Books You May Enjoy

Consensus algorithms

The laws that human society relies on to function are much more difficult to enforce when it comes to computers. Consensus algorithms are the specific instructions programmed on computers in a network so that they have a common definition of objects and instructions to agree on changes. Crashes, failures, and Byzantine faults in computers led to a better approach in forming an agreement in a digital network and so consensus algorithms rose to great heights, well before the dawn of the internet. This concept has been revisited thanks to the new leap in innovation to blockchains.

The following sections look at some of the important consensus algorithms used by blockchains.

Proof of work

Proof of work (PoW) is a consensus algorithm introduced by the anonymous founder of Bitcoin—Satoshi Nakamoto. The PoW consensus algorithm is one of the earliest consensus algorithms used in a blockchain environment. It leverages a combination of cryptography, P2P network communications, and a Merkle data structure to offer a distributed, immutable, and cumulative state of accounts in the Bitcoin blockchain. The solution computed by the first node is verified by the remaining nodes and the block producer is broadcast in the network:

  • Merit: The PoW algorithm has been time tested in the Bitcoin blockchain network and there is not a single hack/compromise of the account states in the network leading to double spend.
  • Demerit: As the PoW algorithm needs to find a solution to a mathematical problem, significant CPU cycles are required to generate hashes and so it is an energy-intensive technique.

Proof of stake

Proof of stake (PoS) is a new consensus algorithm designed and developed to address some of the trade-offs of the PoW algorithm. The block-producing node is determined by an application of mathematical function involving a few determining factors, such as the stake (for example, ETH), the age of the node, and the randomization of eligible node candidates:

  • Merit: The PoS algorithm is energy-efficient as there are fewer computational requirements and it does not select a block-producing node based on a solution-verification model.
  • Demerit: Although the PoS algorithm is efficient in its block times and is environment-friendly, there have been criticisms relating to the algorithm's vulnerability to capitalist attacks on the network of the node owner and tries to compete with other candidates with a stupendous amount of cryptocurrency at stake, higher than all the other candidates.

Proof of burn

Proof of Burn (PoB) is a consensus algorithm with an interesting approach to solving transition problems from one version of cryptocurrency to another in the blockchains. Through the PoB algorithm, the old cryptocurrency (or its preceding version) is burnt in order to reduce its supply and gradually increase the supply of the new cryptocurrency (or its succeeding version). This consensus algorithm is practiced in various forms, including a method wherein users can transfer the old cryptocurrency to an unspendable wallet address in exchange for new ones:

  • Merit: The PoB algorithm is convenient during the transition of cryptocurrencies and network upgrades if the system trusts the participating entities.
  • Demerit: The PoB algorithm is usually applicable in PoW-based blockchains and so has a limitation of applicability. This is due to the requirement of verifiable proofs and the ability to decay the burnt coins over time, which is naturally capable through PoW algorithms.

Delegated Proof of Stake

Delegated Proof of Stake (dPOS) is a consensus algorithm developed and used by the Block.one EOS platform. Under dPOS, the token holders reserve the right to nominate the validators (also called block producers). The selection of block producers is a continuous process and performs the duties of packaging user transactions into blocks with Byzantine fault-tolerant safety:

  • Merit: dPOS is Byzantine Fault Tolerance (BFT) -ready and scales easily in a public network environment.
  • Demerit: Although dPOS is efficient, it is prone to capitalistic efforts to supersede other minor token stakeholders.

Proof of authority

As the name suggests, the Proof of Authority (PoA) algorithm facilitates a distributed consensus with a few eligible verifiable nodes preserving the right to add transactions to blocks, if some criteria is met. There are many variants of the PoA algorithm, with or without the reputations of the validating nodes used in the public, private, and permissioned blockchains:

  • Merit: The PoA algorithm is energy-efficient and not prone to capitalistic pitfalls as the validator nodes are authorized to add transactions to blocks based on their reputation. If the node is observed to malfunction, its reputation is severely affected and cannot proceed as a validator.
  • Demerit: The PoA algorithm is partially centralized as the authority of adding or rejecting transactions lies in the purview of very few nodes in the network.

Practical Byzantine fault tolerance

Practical Byzantine Fault Tolerance (PBFT) is one of the replication algorithms brought to light by academic research. Authored by Miguel Castro and Barbara Liskov in 1999 (http://pmg.csail.mit.edu/papers/osdi99.pdf), this algorithm was primarily aimed at solving the Byzantine faults caused by the arbitrary point of failures in the nodes of a network.

Notably, the PBFT algorithm is used by the Hyperledger Fabric blockchain framework:

  • Merit: The PBFT algorithm is efficient, with fast transaction processing and scalable to hundreds of nodes in a private network.
  • Demerit: The algorithm is based on a gatekeeper technique and is hence criticized for its centralized approaches. PBFT is not suitable for public blockchains.

Proof of elapsed time

Proof of Elapsed Time (PoET) is a consensus algorithm developed and used by the Hyperledger Sawtooth blockchain framework. The PoET algorithm ensures security and randomness involved in the leadership of validator nodes with special CPU instructions available in most of the advanced processors featuring secure virtual environments:

  • Merit: PoET allows anyone with eligible hardware to participate as a validator node, allowing legitimate ways of verifying the leader election.
  • Demerit: Although PoET does not involve staking cryptocurrencies to form a validatory node, the cost of affording specialized hardware does not come cheap. So, there have been criticisms highlighting this as an unfair bar to enter the network.

RAFT

RAFT is a consensus algorithm designed and developed by Diego Ongaro and John Ousterhout with the main motivation to bring about a distributed consensus algorithm that is much easier to understand than Paxos. Notably, RAFT ensures safe leader election, appending log entries in a distributed manner, and state machine consistency. The RAFT consensus is implemented in the Quorum blockchain to inherit the preceding described safety features:

  • Merit: RAFT is one of the fastest algorithms in processing complex transaction payloads with the security of leadership and state machine consistency.
  • Demerit: RAFT is suitable for permissioned or private blockchains only.

Ternary augmented RAFT architecture

Ternary Augmented RAFT Architecture (TARA) is a consensus algorithm designed for large-scale Byzantine-distributed networks. It is an enhanced version of the RAFT consensus algorithm to address heterogeneous transactions identifiable by their asset classes by leveraging PBFT hardening and cryptographic message exchanges. TARA introduces dynamic hierarchy to networks to ensure that their authority is not concentrated among a few nodes:

  • Merits: TARA offers service clusters to ensure high availability, throughput, and scale. It has the hardware of all form factors with the ability to compute and store transactions can participate. TARA can be applied in all three environments—public, private, and permissioned blockchain networks.
  • Demerit: Leadership election is not inherently dependent on the node's reputation, thereby allowing a potential attack on systems. These constraints must be implemented explicitly.

Avalanche

The Avalanche consensus is a protocol for distributed systems, introducing leaderless Byzantine fault tolerance, using a metastable mechanism achieving the same level of security and consistency among the nodes. Avalanche depends on the Snowball family to form a DAG, which stores the user transactional data, instead of blocks:

  • Merit: Avalanche guarantees liveness and is immune to race conditions in the network.
  • Demerit: Leadership consensus may not be applicable to all blockchain environments as there is not a carefully analyzed set of heuristics to ensure consistency.

With this detailed analysis of consensus algorithms, let's now go through the development tools available to blockchain developers.

You have been reading a chapter from
Practical Artificial Intelligence and Blockchain
Published in: Jul 2020
Publisher: Packt
ISBN-13: 9781838822293
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime