Book Image

Learn Blockchain Programming with JavaScript

By : Eric Traub
Book Image

Learn Blockchain Programming with JavaScript

By: Eric Traub

Overview of this book

Learn Blockchain Programming with JavaScript begins by giving you a clear understanding of what blockchain technology is. You’ll then set up an environment to build your very own blockchain and you’ll add various functionalities to it. By adding functionalities to your blockchain such as the ability to mine new blocks, create transactions, and secure your blockchain through a proof-of-work you’ll gain an in-depth understanding of how blockchain technology functions. As you make your way through the chapters, you’ll learn how to build an API server to interact with your blockchain and how to host your blockchain on a decentralized network. You’ll also build a consensus algorithm and use it to verify data and keep the entire blockchain network synchronized. In the concluding chapters, you’ll finish building your blockchain prototype and gain a thorough understanding of why blockchain technology is so secure and valuable. By the end of this book, you'll understand how decentralized blockchain networks function and why decentralization is such an important feature for securing a blockchain.
Table of Contents (10 chapters)

What you will learn...

This book will help you to gain a deeper understanding of blockchain technology by building your own blockchain from scratch. Blockchain is a fairly new technology, and while it can seem tough and slightly overwhelming to learn at first, we're going to take a step-by-step approach and break it down in order to understand how it works under the hood. By the time you finish this book, you will have a very solid understanding of how blockchain technology works, and you will have built your own entire blockchain as well.

In this book, we will start by building the blockchain itself. At this point, we will build a blockchain data structure that has the following abilities:

  • Proofing work
  • Mining new blocks
  • Creating transactions
  • Validating the chain
  • Retrieving address data and other functionalities

Thereafter, we will create an API or a server that will allow us to interact with our blockchain from the internet. Through our API, we will be able to use all of the functionality that we have built into our blockchain data structure.

Furthermore, you'll be learning to create a decentralized network. This means that we'll have multiple servers running and acting as separate nodes. We'll also make sure that all of the nodes interact with each other properly and share data with each other in the correct format. In addition, you'll learn how to synchronize the entire network by making sure that any new nodes or transactions that are created are broadcast throughout the entire network.

We'll then move onto creating a consensus algorithm. This algorithm will be used to make sure that our entire blockchain stays synchronized and that this algorithm will be used to make sure that each node in our network has the correct blockchain data.

Finally, we will create a block explorer. This will be a user interface that will allow us to explore our blockchain in a user-friendly manner, and it will also allow us to query our blockchain for specific block transactions and addresses.

Firstly, however, we need to set up our development environment.