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)

Background of DLT

Ever since the invention of networking, there has been debate about the centralization and decentralization of computing architecture. We have seen interest between these two computing architecture models fluctuate over time. Mainframe architectures were used in enterprises to house great amounts of computing power, memory, and storage. They were largely centralized, and terminals without much computing power were used to connect to these machines in order to perform required operations. Then, personal computers were introduced for household usage, with enough computation power, memory, and storage to perform basic operations. This gave rise to the client-server architecture, in which clients communicate with the server to perform computation. The server usually performs heavy computing in a distributed system and syncs the result with the client.

The cloud computing architecture provides easy access to the server from any computing device, since the architecture itself is globally accessible. However, a cloud computing architecture is centralized, and its hardware resources are distributed and not transparent to the client. There is still a lack of trust between cloud vendors and end users. This is the reason why we are witnessing a transition from other computing models to decentralization. DLT is the key to achieving this milestone and ushering in the age of decentralization.

A distributed ledger is, at its core, a replicated and shared digital database that is spread across geographical regions. A P2P network and a consensus algorithm are required to ensure an effective distributed ledger. Blockchain technology is one of the techniques used to achieve a distributed ledger, but it is not the only data structure of DLT:

Figure 1.2: The evolution of computer architectures, up to the birth of DLT (source: https://en.wikipedia.org)
Background: The earliest thing that could be compared to DLT dates back to 500 AD when the Pacific island of Yap depended upon a currency called Rai, which were stones that could weigh more than 200 kilograms. Since the stones were incredibly heavy to carry, ownership of Rai was memorized by every adult of the island. The oral ownership record made sure that there was no need for a single party to maintain records of who had Rai.