Building decentralised applications using Blockchain's core technology
eBook - ePub

Building decentralised applications using Blockchain's core technology

Learn How to Use Blockchain as the Foundation for Next-Gen Apps (English Edition)

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Building decentralised applications using Blockchain's core technology

Learn How to Use Blockchain as the Foundation for Next-Gen Apps (English Edition)

About this book

Build decentralized applications using Blockchain's core technology Key Features

  • Explore the engineering mechanism of Blockchain, Cryptocurrency, and Ethereum.
  • Know-how of peer-to-peer networks, IPFS, and decentralised databases.
  • Explore the working of DApps and build your own blockchain app.

  • Description
    Blockchain is a revolutionary technology that shook the core of the finance world. However, Blockchain is not just about Cryptocurrency. This book focuses on Blockchain, its features, and the core technologies that are used to build the Blockchain network. In the first section, you will learn about Blockchain in-depth. Then, the book covers the two most popular Cryptocurrencies - Bitcoin and Ethereum. You will learn how these currencies work and how you can build your applications using these currencies. Moving on, you will learn about the decentralized databases. Decentralized databases can be used to build next-generation software applications. You will learn about various databases and how to use them in detail. Lastly, you will learn how the existing decentralized applications work, their architecture, and how they are incorporated into the application for the end-user. What will you learn
  • Learn to build your own P2P network.
  • Cutting-edge coverage on how cryptocurrency works.
  • Learn smart techniques to develop your own DApps on Ethereum platform.
  • Learn to use decentralized databases including OrbitDB.

  • Who this book is for
    This book is for anyone who wants to become a Blockchain developer or wants to build an application using Blockchain. Full stack developers, software engineers, web programmers, and beginners who are interested in Blockchain can find this book a true handy guide to begin their career in Blockchain. Table of Contents
    1. Introduction to Blockchain and decentralized network
    2. Ethereum, Smart Contracts and DApps
    3. Interplanetary file system
    4. OrbitDB - Peer to peer distributed database
    5. BigchainDB
    6. TiesDB
    7. BluZelle
    8. Amazon QLDB
    9. OpenBazaar
    10. DTube
    11. Ocean protocol About the Author
    Shahid Shaikh is a software architect with over 6 years of experience working in emerging technologies. He is also an author and has written three books. He is an active open source contributor. He has expertise in Blockchain, Distributed systems, and Software architecture. Apart from writing code and authoring books, he is a vintage bike enthusiast and rides his vintage Royal Enfield across various locations. He has keen interest in carbon-free energy generation, space exploration, and electric vehicles. LinkedIn Profile: //www.linkedin.com/in/skshahid/
    Blog links: https: //codeforgeek.com

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Building decentralised applications using Blockchain's core technology by Shahid Shaikh in PDF and/or ePUB format, as well as other popular books in Computer Science & Desktop Applications. We have over one million books available in our catalogue for you to explore.

CHAPTER 1

Introduction to Blockchain and Decentralized Network

Blockchain is a cryptographically secure chain of records linked together and replicated across several peers around the world. Blockchain works with various underlying technologies such as immutable Merkletree, hashing, decentralized networking, replication, and so on.

Structure

In this chapter, we will cover the following topics:
  • Introduction to Blockchain
  • Types of Blockchain
  • History of Blockchain
  • Blockchain core components
  • Consensus mechanism

Objective

After reading this chapter, you should be able to:
  • Understand the working of Blockchain
  • Know how Blockchain works
  • Know the various types of Blockchain
  • Understand how consensus is reached in a decentralized network
  • Understand decentralization
Let’s begin.

Introduction to Blockchain

“The Times 03/Jan/2009 Chancellor on the brink of second bailout for banks.”
Figure 1.1
On 3 January 2009, Satoshi Nakamoto mined the first-ever block of Bitcoin—a peer-to-peer decentralized cryptocurrency—and added the headline of The Times as a message in the block.
You might be wondering why this message is the first phrase of the book? This is because the message is marked in history as the day when the revolution in the century-old finance industry began.
In this chapter, we will study, in brief, the history of Blockchain and Bitcoin. We will also dive into the secret life of Satoshi Nakamoto, the creator of Blockchain, and distributed ledger technology and Bitcoin.
We will also learn about the different types of Blockchain and their use cases. We will look at how Bitcoin works in-depth and how this decentralized network manages the most important thing in history—money.
But first, let’s understand the basics of Blockchain in brief.

What is Blockchain?

Blockchain is an immutable, peer-to-peer, distributed ledger containing the records in a format called “blocks” that are linked together using cryptography, and hence the name Blockchain.
Blockchain is distributed, which means each computer running the program contains a copy of the entire Blockchain. It improves the reliability of the data across the network.
Blockchain is p2p based, and there is no central server required. Anyone with a computer and internet connection can become part of the network.
The distributed ledger was built for Bitcoin to handle the money aspect of the system. Ledger is a financial recording system containing the credit and debit of the particular person or account. While banks have a central ledger, Blockchain provides distributed ledger spread across thousands of machines.
Blockchain was built by Satoshi Nakamoto—a pseudonym for the programmer who built the Bitcoin, the first cryptocurrency ever. Blockchain was built to remove the “trust” factor from the system and allows computers to send/receive money.
Blockchain is linked using cryptographic functions. Each block in a chain knows the address of the previous block till the Genesis block.
Tip: The genesis block is the first block that is not mined but hardcoded in the system. You can check the Genesis block code here: Genesis block code.
Blockchain stores the blocks that consist of transactions. Once the entry is made in the Blockchain, it can’t be reversed, so it is immutable. In the upcoming section, we will learn how the entry of blocks is done in the chain.
The key characteristics of Blockchain are as follows:
  • Immutability
  • Cryptographic
  • Decentralization
  • Provenance
  • Anonymity
  • Transparency
One of the key characteristics of the Blockchain is immutability. Once data is submitted in the chain and has been confirmed by 51% of the peers in the network, you can never alter it.
Blockchain is cryptographically secure and uses asymmetric cryptography, where only an intended party with the key can decrypt and see the data.
Blockchain is decentralized, which means there is no central authority controlling the network. It’s controlled by the participants of the network.
Blockchain provides the record of ownership. So, it supports true provenance.
Blockchain provides true anonymity to the end user. No user information such as name, IP, and location is stored in the chain, ensuring zero chances of censorship and tracking.
Blockchain is transparent. You can view every transaction since its origin to date on your browser. Everything is available to the public with no hidden agenda!
Before we proceed further, let’s look at the types of Blockchain.

Types of Blockchain

Blockchain was meant to be a public ledger. However, due to corporations not wanting to share their data with the public, some Blockchains are intended to serve such entities.
Blockchain, in a nutshell, can be divided into three groups:
  • Public Blockchain
  • Federated (or Consortium) Blockchain
  • Private Blockchain
Let’s learn about them in brief.

Public Blockchain

A public Blockchain, as the name suggests, is public; so, anyone can join the Blockchain network, read the data, and write to it.
The Bitcoin network is among the first few public Blockchains in the world. You might be wondering how it’s secure if it’s completely open to the public.
Well, it’s a valid question.
A public Blockchain such as Bitcoin has a consensus mechanism that ensure that the network is secure and data is valid across every peer connected to the system. The second part is the encryption mechanism used by Bitcoin is asymmetric, so it needs the key of the sender and receiver both to decrypt the data, which makes it secure and fraud-proof.
The consensus mechanisms used by the public Blockchain can vary between proof of work, proof of stake algorithms. We will understand the consensus system in the next section.
Public Blockchains are slower and less efficient than private and federated ones.

Federated (Consortium) Blockchain

Federated blockchains are shared Blockchain among various federations or entities. In simple words, instead of going public, the Blockchain is only shared among a few organizations.
Every read and write operation can be done only using the permissions granted by the authorities. As it has fewer peers, a federated Blockchain is fast and efficient as compared to a public Blockchain.
A federated Blockchain does not require any consensus algorithm to handle conflict issues as all the peers in the Blockchain network are identified.

Private Blockchain

Private Blockchain, as the name suggests, is used only by the organization. It’s not shared with anyone and is only used within the network. Private Blockchains do not use any consensus to solve conflict issues as it’s predefined in the system. Only selected peers can insert a block in the network.
We have studied the Blockchain and its types; now, let’s understand the history of Blockchain.

History of Blockchain

The core principles of Blockchain—distributed computing, cryptography, decentralization, and consensus algorithms—are not new. They have been around since the 90s and are taught in computer science classes all around the world.
So, one may ask why distributed ledgers technology and Blockchain came into existence in 2009.
Well, to find the answer to this, we must understand how our banking system works. Banks are the central authority that owns your money and keeps a record of every transaction you make.
There was a time when paper currency was printed based on the number of natural resources one country possesses, mainly gold and silver. It’s unlikely that we find gold and silver mines every day, so the supply was limited, and so the value of the currency.
The paper currency you currently hold is printed based on credit without the backing of natural resources such as gold and silver. This move allows federal banks to print as much money as they want.
Remember the newspaper cut on the first page? That’s the time when this economic model failed and when banks closed like small shops. That was the 2008 global recession.
So, where is the problem?
Satoshi thinks it’s the central authority of the banks. Satoshi had a vision of the currency supported globally and transferred anywhere without a bank. This vision later became Bitcoin.
But, is Bitcoin the first cryptocurrency ever?
The first work on cryptocurrency can be traced back to 1991 by Stuart Haber and W. Scott Stornetta. This duo wanted to develop a cryptographically secured document timestamp system, where the document cannot be altered once stored in the system.
They used the Merkle-tree concept to store and track the documents in the system. Th...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. About the Author
  6. About the Reviewer
  7. Acknowledgement
  8. Preface
  9. Errata
  10. Table of Contents
  11. 1. Introduction to Blockchain and Decentralized Network
  12. 2. Ethereum, Smart Contracts, and DApps
  13. 3. Interplanetary File System
  14. Decentralized Databases
  15. Decentralized Apps and Frameworks
  16. Index