Book Image

Foundations of Blockchain

By : Koshik Raj
Book Image

Foundations of Blockchain

By: Koshik Raj

Overview of this book

Blockchain technology is a combination of three popular concepts: cryptography, peer-to-peer networking, and game theory. This book is for anyone who wants to dive into blockchain from first principles and learn how decentralized applications and cryptocurrencies really work. This book begins with an overview of blockchain technology, including key definitions, its purposes and characteristics, so you can assess the full potential of blockchain. All essential aspects of cryptography are then presented, as the backbone of blockchain. For readers who want to study the underlying algorithms of blockchain, you’ll see Python implementations throughout. You’ll then learn how blockchain architecture can create decentralized applications. You’ll see how blockchain achieves decentralization through peer-to-peer networking, and how a simple blockchain can be built in a P2P network. You’ll learn how these elements can implement a cryptocurrency such as Bitcoin, and the wider applications of blockchain work through smart contracts. Blockchain optimization techniques, and blockchain security strategies are then presented. To complete this foundation, we consider blockchain applications in the financial and non-financial sectors, and also analyze the future of blockchain. A study of blockchain use cases includes supply chains, payment systems, crowdfunding, and DAOs, which rounds out your foundation in blockchain technology.
Table of Contents (14 chapters)

The different types of blockchain

The growing number of use cases for blockchain, as well as an increasing awareness of its limitations, has given rise to a variety of successful blockchain implementations. In this section, we'll be trying to grasp the essence of each one of them.

Public blockchain (permissionless)

The blockchain concept has been widely used and adapted due to its transparency and how every node participates in contributing to the growth of the blockchain. The early blockchain model, the product of Bitcoin, is completely open and permissionless and is popularly known as a public blockchain. Public blockchains are popular due to the impartial way in which the nodes are treated.

Public blockchains work seamlessly in trustless networks due to the immutable nature of the records. Bitcoin, Ethereum, and several other projects that have inherited PoW-like consensus algorithms ensure that recorded transactions are non-editable.

Public blockchains are ideal for cryptocurrency projects where recorded transactions should not be modified. However, public blockchains often face scalability issues at some point if the necessary changes aren't implemented. One of the most visible issues of Bitcoin is its mining approach (PoW), which is very expensive in terms of the electricity required for miners to solve the puzzle. The average time for block creation is 10 minutes. Therefore, the difficulty level of mining has been adjusted to maintain this time. This has resulted in a very expensive PoW environment due to competition among miners. We'll not be able to predict the future of Bitcoin or any other public blockchain due to these complex attributes, and only the natural evolution of the technology can decide its fate.

Due to these pros and cons, the permissionless or public blockchain is well suited for transparent applications, where the blockchain should inherently secure the system since the network is trustless.

Private blockchain (permissioned)

Private blockchains were introduced mostly to widen the scope of blockchain technology. The permissioned blockchain, as the name suggests, uses the opposite approach to that of the public blockchain. Private blockchains came about mainly to solve some of the issues we saw in public blockchains and to make blockchain technology scalable.

Permissioned blockchains introduce access control to provide specific access to the participants in a network. Each permissioned blockchain will have an administrator who assigns roles for the participants in the network. Permissioned blockchains ensure that bad actors are not a part of the validation or block-creation processes and thus eliminate any potential attacks on the blockchain. A network involving a permissioned blockchain is mostly a trusted network.

Private blockchains are suitable for organizations where a ledger only needs to be shared internally. Permissioned blockchains are often mutable or not strictly immutable, and their transactions can be modified with some effort; this is in stark contrast to public blockchains, where this is nearly impossible. Permissioned blockchains are still decentralized ledgers, but they will have some nodes with limited capability within the organization, whereas nodes in public blockchains are treated impartially.

Note: Private blockchains do not use Bitcoin's PoW consensus algorithm as their consensus algorithm. In fact, private blockchains were created to eliminate the costly consensus approach of public blockchains, to make blockchain technology applicable in trusted environments.

Consortium blockchain

The consortium blockchain is a hybrid blockchain that is semi-decentralized. It combines the best features of both permissionless and permissioned blockchains. Instead of assigning most tasks to a single organization, a consortium blockchain assigns the same tasks to nodes maintained by multiple organizations. Instead of having a single validator node, there can be multiple nodes. Although a consortium blockchain is permissioned, it's more decentralized than a private blockchain.