Blockchain Databases 2


This chapter deals with the concept of databases in blockchain technologies and its scope in current trend and scenarios. In the present time, blockchain database is a conveyed database that maintains a persistently growing tamper-proof data structure blocks which hold batches of individual transactions, without any involvement of third parties. Due to which the demand for blockchain and related technologies is going to increase more in the coming days. Here, many concepts are discussed thoroughly like BigchainDB, file storage in BigchainDB, smart contracts, transaction concepts and permissions, privacy in blockchain databases and many others with its future aspects.


“A database is an organized way of storing a bunch of information, or data, that are stored in electronic in a computer system. A database is usually managed by a database management system (DBMS). Taking as together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often abbreviated to just database” [1,19]. Similarly, in terms of block- chain technology, blockchain database consists of many decentralized nodes. Every node takes an interest in the organization all the nodes to check the new increments to the blockchain and is equipped for entering new data into the database. For expansion to be made to the blockchain, most of the nodes must arrive at a consensus. This consensus system ensures the security of the system [9,10].

There are many databases available to store our information, namely:

  • • traditional database
  • • decentralized database
  • • centralized database
  • • relational database

In a centralized database, the input information from the users is stored at a fixed position such that different users from different locations can access it. This type of database helps the users to access the database from remote areas.

In a decentralized database, rather than storing data at a fixed central point of control, data are stored in a distributed architecture at different geographical locations. This implies that it is a group of independent database instances which have no direct logical connections established between them. This is one of the most exciting properties of blockchain technology.

In a relational database, information’s are distributed among a set of tables where information are stored in a pre-structured table. The table consists of a number of rows and columns, where rows contain instance for the data according to its type and columns contains an entry for the information for a specific purpose.

The idea of blockchain has become popular due to massive-scale adoption of its different achievements like a smart contract (to be discussed in the following topic), P2P digital currencies called cryptocurrencies, under the name of bitcoin which is a revolutionary in the digital market [11]. BigchainDB is one of the best examples of blockchain-based technology, that integrates the concept of blockchain and traditional database, to provide best in class output that utilizes the areas of both the worlds.

BigchainDB is an application that has properties similar to the blockchain (e.g., decentralization concept, immutability property, owner-controlled assets, etc.) and the database properties (e.g., high transaction rate, low latency, indexing, querying processing of structured data, etc.) [6]. It is an open-source application, whose first version is released in February 2016. Its latest edition is 2.0 which has significant improvement over the previous one and is continuously upgrading. BigchainDB enables engineers and ventures to send blockchain evidence of ideas, different stages, and applications with a versatile blockchain database [6]. BigchainDB has various applications in different areas like supply chain, Internet of Things (IoT), stock market, financial system, etc.

BigchainDB is preferred due to its high throughput, high latency, high capacity, and low communication cost.


In the last few' years, blockchain technologies become an emerging area due to its anonymous behavior, P2P transaction, distributed consent, and the most important are its decentralized immutable property. Due to which many problems and technical glitches related to the technology have been resolved.

This segment focused on a popular computer program used in blockchain technologies integrated with significant applications of blockchain technologies.

What Is Smart Contract?

The w'ord “contract” is defined as a legal and formal agreement that is undersigned by two parties. Similarly, smart contract is also a regular contract that exits in the form of code in a computer program having its own verifying, executing, and tamper- resistant properties (Figure 4.1).

Nick Szabo introduced the concept of smart contract in 1994. He is a computer researcher, legitimate scholar, and cryptographer known for his investigation in computerized deals and digitized cash. Nick Szabo defined smart contract in the form of “A computerized transaction protocol that executes a term of a contract” [2]. He suggested translating contractual clauses into code and placing them into a property that can self-execute them. However, in blockchain technologies, the meaning of smart contracts has been coined. Within the blockchain terminologies, smart contracts are coded scripts recorded on the blockchain.

Outline of smart contract

FIGURE 4.1 Outline of smart contract.

A smart contract allows executing code, only when fixed terms and conditions are matched without the help of any third parties. These are legal contracts w'hich are purely written in a digital form of code of the agreement, which is based on blockchain. These self-executing contracts come into existence when terms and conditions met by parties involved are satisfied. Then only these contracts will execute it, causing the exchange of assets between the parties. These assets may be money (a cryptocurrency like Bitcoin), property, content or other like values between the users.

A smart contract may consist of many properties like different values, addresses, functions, and states. It always accepts the transaction as an input executes the relating code and furthermore, triggers the output result. After the complete process depending upon the logic implemented, state changes. The procedures are trackable and irreversible. Since 2008 when blockchain innovation appears through Bitcoin cryptocurrency, the significance of smart contract integration of blockchain technology becomes a key area to develop. Because, it gives peer to peer (P2P) transaction and database, that can be maintained openly in a protected manner in a trustful situation.

For the implementation of smart contract in blockchain technologies programming languages like Solidity has been preferred. It is a high-level programming language used to implement smart contracts. Solidity is used to execute the smart contract in different developing blockchain platforms like Ethereum, ErisDB, Zeppelin, and many more.

Some of the critical characteristics of a smart contract are:

  • • The smart contract is machine executable codes runs on different platforms of blockchain technologies.
  • • The smart contract is part of a single application program. That means each program is created and runs on a single application.
  • • The smart contract is event-driven programming. That means the flow of the program is determined by different events like user actions (key pressed on the keyboard, mouse clicks, voice command, fingerprint scanner), sensor outputs, received messages from other programs or threads, etc.
  • • The smart contract has once created no need to monitor. That means they are autonomous.
  • • Smart contract are shareable; means have distributive property.

How Smart Contract Works?

The concept of smart contract proposed by Nick Szabo and defined it as a computerized transaction protocol that executes a term of a contract. According to the above definition, the contractual clauses (security agreement, bonds, contents, the outline of property rights, etc.) must be encoded and embedded in the required hardware and software. Since smart contract allows executing code, only when fixed terms and conditions are matched without the help of any third-parties communication, which also secures the system from malicious attack. In the case of blockchain terminologies, smart contracts are coded scripts placed on the blockchain, wdiich has the executive power. One can activate the transaction process to a smart contract by using its own or unique allotted address by the blockchain technologies.

Let us take an example to get a better understanding of the above scenario on working of smart contracts. Suppose you want to rent or sell your vehicle to someone in the blockchain network, so you can quickly deploy a smart contract in the above existing system. Different features regarding the car are stored in the blockchain, and those who are belonging to the same network can show their interest but cannot allow manipulating the existing features. In this way, we can find a buyer for the vehicle without involving any third party for the same.

There are wide ranges of dynamic applications; blockchain-based smart contracts could offer several significant advantages:

  • • High speed and quick real-time updates
  • • Privacy
  • • High accuracy
  • • Lower execution risk [7]
  • • Fever intermediaries
  • • Minimum cost

Use Cases of Smart Contracts

Supply Chain

The supply chain system consists of different stages of the transaction. Each step consists of some terms and related conditions. The various areas of supply chain management system are like the food packaging sector, shipment sector, power supply system, and many more. Since multiple system layers are involved in this area. So it is crucial to make it as a reliable and trustful management system. This can be done using a smart contract integrated with blockchain technologies. Digital ledger database helps supply chain management system more transparent, reliable, trustful and most important without any third party interrogation (Figure 4.2).

Internet of Things

The Internet of Things (IoT) is an arrangement of interrelated gadgets, mechanical pieces of equipment, advanced machines, items, living bodies or even individuals that are furnished with its own unique identity and the capacity to move information over a system without expecting human-to-human or human-to-computer association. The IoT is one of the most optimistic areas when integrated with a smart contract concept. It helps IoT devices to emerge in a more autonomous way compared to past behavior. Some of the areas where blockchain technology already used are a smart home, smart city, smart grids, industrial internet, connected cars, and many more [13] (Figure 4.3).

Insurance Claim

Insurance is a formal agreement from financial loss. But, conventional insurance system takes long time process to claim on your policy. There is much vagueness

Outline of supply chain

FIGURE 4.2 Outline of supply chain.

Outline of IoT framework

FIGURE 4.3 Outline of IoT framework.

emerges between various stakeholder during preparation. A smart contract-based system can streamline the procedure and utilizing blockchain technology [14], by which everything can be made straightforward just as system secure without third- party intercession into it (Figures 4.4 and 4.5).

There may more use cases of smart contacts like in the stock market, financial system [8], healthcare system [12], digital right management, real estate, and so on.

Outline of insurance claim

FIGURE 4.4 Outline of insurance claim.

Use case of smart contracts

FIGURE 4.5 Use case of smart contracts.

< Prev   CONTENTS   Source   Next >