Preface

This book has one goal. To teach the theory and practice of distributed ledger technology to anyone interested in learning this fascinating new subject. Whether a seasoned technologist, student, business executive or merely an enthusiast; anyone with an interest in blockchain technology can benefit from this book. To this end, I aim to provide a comprehensive and in-depth reference of distributed ledger technology that not only serves the expert, but is also accessible for beginners. I especially focus on describing the core characteristics of blockchain, so that readers can establish a strong foundation on which to build further knowledge and expertise. I also envisage that with this approach, the book will remain useful in the future despite constant advancements. Some of these core topics include core blockchain principles, cryptography, consensus algorithms, distributed systems theory, and smart contracts. In addition, practical topics such as programming smart contracts in Solidity, building blockchain networks, using blockchain development frameworks such as Truffle, and writing decentralized applications, also constitute a significant part of this book. Moreover, many different types of blockchain, related use cases and cross-industry applications of blockchain technology have been discussed in detail.

This approach makes this book a unique blend of theoretical principles and hands-on applications. After reading this book, readers will not only be able to understand the technical underpinnings of this technology, but will also be empowered to write smart contract code and build blockchain networks themselves. Practitioners can use this book as a reference, and it can also serve as a textbook for students wishing to learn this technology. Indeed, some institutions have adopted the second edition of this book as a primary textbook for their courses on blockchain technology.

Soon after the advent of blockchain technology, several texts were written on the subject. However, they mostly concentrated on a specific aspect of blockchain technology, such as cryptocurrencies. Especially between 2015 and 2017, no single text was available that could provide a detailed account of the whole picture of blockchain technology.

To fill this gap, the first edition of this book was written in 2017. In 2018, due to rapid development in the area of blockchain technology, the need was felt to update the book. As a result, the second edition of the book was published in early 2018 with some important updates. Inevitably, since the publication of the second edition, blockchain technology has evolved quite significantly. Some of the ideas that contributed to the evolution of blockchain technology include novel cryptographic protocols, new consensus algorithms, new privacy techniques, and extensive work on scalability. Moreover, innovative types of blockchain, developed to address limitations in the underlying technology, have emerged, along with a deep interest in the adoption of blockchain technology in enterprise settings. Each of these changes inspired us to update the book again with the latest industry developments.

This book has four new chapters on some of the latest topics, including consensus algorithms, Ethereum 2.0, tokenization, and enterprise blockchains.

Moreover, all chapters have been thoroughly revised, and various new topics, including a discussion on new blockchains or cryptocurrencies, such as Tezos, EOS, and Quorum, are now part of the book package. Also, many additional details on oracles, cryptography, scalability, and privacy techniques have been added. Some of the older material that is not quite so relevant today has been removed. We have also created a bonus online content pack, which contains academic slides and review questions and answers, which will enable teachers to use this book readily as an academic textbook. In addition, the bonus content includes advanced material on alternative coins, full end to end decentralized application development using Solidity, Truffle and Drizzle, and an exploration of various alternative blockchain platforms. I encourage the readers to read this book in conjunction with the online content, which can be found here: https://static.packt-cdn.com/downloads/Altcoins_Ethereum_Projects_and_More_Bonus_Content.pdf. This will enable them to fully benefit from this book.

I hope that this book will serve technologists, teachers, students, scientists, developers, business executives, and indeed anyone who wants to learn about this fascinating technology well for many years to come.

Who this book is for

This book is for anyone who wants to understand blockchain technology in depth. It can also be used as a reference resource by developers who are developing applications for blockchain. Also, this book can be used as a textbook or learning resource for courses, examinations, and certifications related to blockchain technology and cryptocurrencies.

What this book covers

Chapter 1, Blockchain 101, introduces the basic concepts of distributed computing, on which blockchain technology is based. It also covers the history, definitions, features, types, and benefits of blockchains, along with various consensus mechanisms that are at the core of the blockchain technology.

Chapter 2, Decentralization, covers the concept of decentralization and its relationship with blockchain technology. Various methods and platforms that can be used to decentralize a process or a system are also introduced.

Chapter 3, Symmetric Cryptography, introduces the theoretical foundations of symmetric cryptography, which is necessary in order to understand how various security services such as confidentiality and integrity are provided.

Chapter 4, Public Key Cryptography, introduces concepts such as public and private keys, digital signatures, and hash functions, and includes a number of practical examples.

Chapter 5, Consensus Algorithms, covers the fundamentals of consensus algorithms and describes the design and inner workings of several such algorithms. It covers both traditional consensus protocols and blockchain consensus protocols.

Chapter 6, Introducing Bitcoin, covers Bitcoin, the first and largest blockchain. It introduces technical concepts related to the Bitcoin cryptocurrency in detail.

Chapter 7, Bitcoin Network and Payments, covers the Bitcoin network, relevant protocols, and various Bitcoin wallets. Moreover, advanced protocols, Bitcoin trading and payments are also introduced.

Chapter 8, Bitcoin Clients and APIs, introduces various Bitcoin clients and programming APIs that can be used to build Bitcoin applications.

Chapter 9, Alternative Coins, introduces alternative cryptocurrencies that were introduced after the invention of Bitcoin, along with their theoretical foundations.

Chapter 10, Smart Contracts, provides an in-depth discussion on smart contracts. Topics such as their history and definition, Ricardian contracts, oracles, and the theoretical aspects of smart contracts are presented in this chapter.

Chapter 11, Ethereum 101, introduces the design and architecture of the Ethereum blockchain in detail. It covers various technical concepts related to the Ethereum blockchain that explain the underlying principles, features, and components of this platform in depth.

Chapter 12, Further Ethereum, continues the introduction of Ethereum from the previous chapter, and covers topics related to the Ethereum Virtual Machine, mining, and supporting protocols for the Ethereum chain.

Chapter 13, Ethereum Development Environment, covers topics related to setting up private networks for Ethereum smart contract development and programming.

Chapter 14, Development Tools and Frameworks, provides a detailed practical introduction to the Solidity programming language, and different relevant tools and frameworks that are used for development with Ethereum.

Chapter 15, Introducing Web3, covers the development of decentralized applications and smart contracts using the Ethereum blockchain. A detailed introduction to the Web3 API is provided, along with multiple practical examples.

Chapter 16, Serenity, introduces the latest developments in Serenity, the update that will introduce Ethereum 2.0. It covers the theory relating to the beacon chain, validator nodes, and explores various phases of Ethereum 2 development.

Chapter 17, Hyperledger, presents a discussion about the Hyperledger project from the Linux Foundation, which includes different blockchain projects introduced by its members.

Chapter 18, Tokenization, introduces the topic of tokenization, stable coins, and other relevant ideas such as initial coin offerings, decentralized exchanges, decentralized finance, and token development standards.

Chapter 19, Blockchain – Outside of Currencies, provides a practical and detailed introduction to applications of blockchain technology in fields others than cryptocurrencies, including the Internet of Things, government, media, and finance.

Chapter 20, Enterprise Blockchains, explains the use and application of blockchain technology in enterprise settings, and covers distributed ledger platforms such as Quorum and Corda.

Chapter 21, Scalability and Other Challenges, is dedicated to a discussion of the challenges faced by blockchain technology and how to address them.

Chapter 22, Current Landscape and What's Next, is aimed at providing information about the current landscape, projects, and research efforts related to blockchain technology, and includes a number of predictions based on the current state of blockchain technology.

To get the most out of this book

In order to gain the most from this book, some familiarity with computer science and basic knowledge of a programming language is desirable. However, beginner-level knowledge of computing in general and enthusiasm to learn should suffice!

Download the example code files

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at http://www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the on-screen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-Blockchain-Third-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781839213199_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example, "The call, callcode, and delegatecall functions are provided in order to interact with functions that do not have an ABI."

A block of code is set as follows:

pragma solidity >5.0.0;
contract Test1
{
    uint x=2;
    function addition1() public view returns (uint y)
    {
        y=x+2;
    }
}

Any command-line input or output is written as follows:

$ sudo apt-get install solc

Bold: Indicates a new term, an important word, or words that you see on screen, for example, in menus or dialog boxes, which also appear in the text like this. For example: "Two notable schemes that originate from ECC are Elliptic Curve Diffie-Hellman (ECDH) for key exchange and Elliptic Curve Digital Signature Algorithm (ECDSA) for digital signatures."

Warnings or important notes appear like this.

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected], and mention the book's title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book we would be grateful if you would report this to us. Please visit, http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http://authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset