Department of Computer Science and Automation,
1Indian Institute of Science.
Blockchain technology is promising to herald a new revolution in a rich variety of industrial and societal settings. In the timeline 2012-2015, the term blockchain was more of a buzzword; not any longer. Many important global businesses are trying to embrace the blockchain technology to find solutions to their difficult problems. Governments, financial institutions, banks, industrial supply chains, service companies, and even educational institutions and hospitals are investing substantial sums of money in the hope of improving business efficiency and operational robustness. Currently there are several hundreds of startups all over the world; India certainly has a few dozens of startups in the blockchain space. There are hundreds of whitepapers and well compiled technical reports available on the web and these documents provide the multidimensional impact and promise of the technology. Multiple books have been written; the one by Don Tapscott and Alex Tapscott  is one of the more prominent ones. The book by Antonopoulos , and, the book by Narayanan, Bonneau, Felten, Miller, and Goldfeder  provide an excellent, rigorous, and comprehensive introduction to cryptocurrency technologies.
Let us look at an enticing example, that of property titles in popular cities. For instance, the city of Bengaluru in India, popularly referred to as the Silicon Valley of India, is one of India’s most sought after cities to live in, and predictably, real estate prices have been skyrocketing at a furious pace. It is known that a good percentage of property titles may not be trustworthy, in fact, could even be fake. Further, titles and documents have often been fabricated or manipulated. There are many prominent layouts in trouble because of this problem and in many cases, the unsuspecting citizens go through hardships due to this problem. Imagine how socially good it would be if the land records were immutable, safely and securely stored in a distributed public ledger, and new data is allowed to be included only after consensus is reached among all stakeholders. If such a shared ledger were maintained, real estate related fraud could be eliminated. In fact, in the nations of Honduras, Ghana, and Republic of Georgia, startups have helped the Governments there to place all land titles in a secure ledger to ensure that property owners feel secure and assured about their landed properties.
Under the pseudonym Satoshi Nakamoto, an anonymous person or a group of persons wrote a brilliant paper  in 2008 in which the bitcoin digital currency was introduced. This paper introduced a simple but powerful data structure which Satoshi Nakamoto called the blockchain. Using this data structure which uses hashing to achieve immutability of data and through an intelligent design of incentives, the bitcoin revolution got launched with this paper. The bitcoin is now a household topic. In this paper, however, our interest is not on bitcoin but on the blockchain data structure which has characteristics that make it perfectly applicable to a rich set of possibilities beyond bitcoin. We explore these exciting possibilities that blockchains offer to numerous usecases in industrial and societal settings.
The objective of this paper is to gain a sound understanding of the various building blocks and foundational principles underlying blockchain technology. The trajectory we follow in this paper is as below.
- Section 2: Blockchain Building Blocks. We introduce the blockchain data structure and describe the all important problem of achieving distributed consensus through mining of blocks. This section highlights the critical contribution of cryptography in blockchain operations.
- Section 3: Key Features of Blockchains. We bring out the unique features of blockchains in this section. We focus on: asset ledger, token ledger, and smart contracts.
- Section 4: Types of Blockchains. We describe two broad categories of blockchains, namely, public blockchains (also known as permissionless blockchains) and permissioned blockchains. We also briefly describe the Ethereum blockchain and the Hyperledger project, which apart from the bitcoin blockchain, are the most prominent meta-platforms for blockchains.
- Section 5: Applications. We dwell on the vast canvas of blockchain applications. First we present generic applications under the following heads: financial, supply chain, IoT based, and social good. Next we present briefly four specific case studies: land registry, tamper-proof academic transcripts, crowdfunding, and a supply chain B2B platform.
- Section 6: Conclusions. We discuss briefly the challenges involved in making blockchains a successful technology and we also outline a few directions for future research.
- Glossary: We provide a glossary of key concepts in blockchain technology
This is a companion paper to the article “Cryptocurrencies: Science and Socio-Economics” by Veni Madhavan and Kumar Swamy  .
Disclaimer. In this article, we have included only a subset of essential references that we are aware of. There are hundreds of webpages, blogs, research papers, and whitepapers on blockchain technology, and numerous textbooks as well. We regret any important omissions.
2. Blockchain Building Blocks
A blockchain network is typically a peer-to-peer network where each node has computing resources and a data repository. The data repoitory at each node contains an an up-to-date copy of the blockchain.Figure 1 shows a picture of a blockchain network.
Figure 1: A Blockchain network
2.1 Blockchain Data Structure
The blockchain data structure is a structured collection or shared ledger of blocks. Figure 2 depicts a part of a typical blockchain. In this subsection, we describe the data structure that is used in the bitcoin blockchain, to bring out all essential features of a blockchain. A blockchain may contain any number of blocks. For example, the bitcoin blockchain (as of January 2018) contains more than 210000 blocks.
Figure 2: A Blockchain
As a data structure, a blockchain is a doubly linked list of the blocks. Thus, each block has a pointer to the next block as well as a pointer to the previous block. Each block contains the following:
- Data corresponding to a number of transactions. Each transaction may involve a small subset of nodes and is represented in some digital form. A block may contain any number of transactions. For example, a block in the bitcoin blockchain could contain hundreds of transactions.
- A hash value corresponding to the current block.
- A hash value corresponding to the previous block.
Each hash value above is also called proof-of-work for that block. Proof-of-work for a block is computed by solving a difficult cryptographic puzzle: this puzzle takes as input the transaction data of that block and produces a final hash value, after a very large number of hash computations, such that the final value that satisfies a certain criterion that is difficult to achieve (for example, the hash value should start with a string of four zeros, etc.). Because of the intensive nature of this computation and the massive amount of computational work involved in producing this final hash value, the latter is aptly called proof-of-work.
Since every block contains proof of work for the current block and proof-of-work for the previous block, the blockchain becomes virtually immutable. This is because, in order to modify a block, not only do you have to modify the current block but also all successive blocks.
The data corresponding to each block is organized as a Merkle tree (shown in Figure 3). Merkle tree is a binary tree data structure where hashing is used to facilitate efficient verification of the contents of the tree (See Figure 3). The leaf nodes contain the hash values of individual transaction data. Each internal node contains only a hash value that is computed using the hash values contained in its children. The root node will thus contain a hash value which is called the root hash value. Given a Merkle tree, in order to verify that a given a set of transactions is precisely the same as the transactions stored in the Merkle tree, we only have to compute the hash value from the given transaction data and verify that the hash value is the same that of the root hash value in the given Merkle tree.
A new block is included into the blockchain using a process called mining which is described in the next section. Once a new block gets included, the updated blockchain becomes available at all the nodes. The manner in which the blockchain data structure is organized, updated, and