Keywords

1 Introduction

Blockchain technology has gained a lot of attention from researchers and stakeholders from around the world after the inception of Bitcoin, [1] which has later become a revolutionary technology. Bitcoin, an application of Blockchain is a well-known term for cryptocurrency that is administered by users across the globe in a trustless manner without the need of a trusted third party.

Smart contract is the another famous use case of Blockchain technology, which was first introduced by Nick Szabo in 1994 [2], is a self-executing contract with the terms of the agreement in between untrusted agreed bodies and is a piece of program code to be executed when certain conditions have been met. The paper is structured in different sections as follows. Section 2 gives a brief introduction of Blockchain Technology, Sect. 3 describes briefly the smart contract, Sect. 4 describes development platform, Sect. 5 gives a detailed introduction of application areas of smart contract, Sect. 6 describes the research issues in smart contracts, and Sect. 7 concludes the paper.

2 Blockchain Technology

Blockchain was introduced in 1991 as a chain of time-stamped blocks by W. Scott Stornetta and his co-author Stuart Haber in his research paper titled “How to time-stamp a digital document” [3]. According to that paper, a document sends by a client to a times tamp server is signed by the server and also linked with the previous document. The term Blockchain became more popular after the invention of Bitcoin. A whitepaper titled “Bitcoin: A Peer to Peer Electronic Cash System” was published by Satoshi Nakamoto in 2008 [1]. This paper was aimed to enable unknown parties to do the transaction with each other directly without the need of a trusted third party like financial institution, means there is no need of relying on a trusted third party.

In 1992, W. Scott Stornetta and Stuart Haber [4] introduced the term "Merkle Trees" into the design of blockchain in his paper titled “Improving the Efficiency and Reliability of Digital Time-Stamping” to allow multiple documents to be collected into a single block. In the Merkle tree, the data structure was patented by Ralph Merkle in 1979 [5], which is used to prove the integrity of the data in the Blockchain transaction. A Blockchain is characterized by decentralization, persistency, anonymity and auditability [6]. The present Blockchain system is classified into three categories: Public Blockchain, Private Blockchain and Consortium/Federated Blockchain [7]. Public Blockchain is permissionless while the Private and Consortium Blockchain are Permissioned [6].

Dubai is planning to be the first Blockchain-powered government in the world by 2020 [8] (Fig. 1

Fig. 1
figure 1

Types of blockchain system [38]

).

3 Smart Contract

The term smart contract was coined by Nick Szabo in 1994 [2]. A smart contract is a piece of computer code used to automatically execute the terms of the contract negotiated in between two untrusted parties after meeting predetermined conditions, in other words, it is an auto-enforceable code. A simple real-life example of a smart contract is the vending machine [9], which is a contract with bearer [a person having coins]. The smart contract technology can change the way business is done in between companies or untrusted parties. Following Figs. 2 and 3 differentiate the tradition contract system with smart contract system

Fig. 2
figure 2

Traditional contract system

Fig. 3
figure 3

Smart contract system

.

The traditional contract system is more costly as compared to the smart contract system. Smart contracts are implemented on the blockchain so they also inherit some features of Blockchain-like distributed nature and immutability. A research from Gartner Group which is a leading research and advisory company predicts that by the year 2020, 25% of global organizations all over the world will be using the smart contract [10].

It usually contains four fields that help to construct a smart contract.

  1. i.

    Address: It is a unique address, by which users or other smart contracts communicate with it.

  2. ii.

    Balance: It is used to execute a smart contract. After meeting the predefined conditions or terms of contracts, the digital assets are transferred, and the balance is updated.

  3. iii.

    Code: It is the compiled piece of code which executes the terms of a contract according to the response rules.

  4. iv.

    Storage: It is an optional field used to store the data.

Figure 4 shows the structure of the smart contract

Fig. 4
figure 4

System of smart contract

.

4 Smart Contract Development Platforms

Developing a smart contract is not a big deal, but developing a smart contract with no security flaws is a very critical task because a weak smart contract invites an adversary to attack. Parity bug leads to $170 Million of Ether being inaccessible [11]. So if the integrity of the smart contract is compromised, then it falls into the area of unsecured immutability. Following are some development platforms which can be used to develop a smart contract.

Etherum: It is a decentralized platform to run and develop a smart contract. It is a distributed public Blockchain network. The solidity programming language, which is very simple to use, is used to create a smart contract on Etherum [12]. The best thing about Etherum is that it is free to use.

Bitcoin: It can be used to create smart contract but the problem with Bitcoin platform is that it cannot be used to create complex smart contract [13].

Hyperledger: It is the Linux foundation platform to develop a smart contract in a high-level language and is completely open-source and free to use. It provides reliable performance with many plug-in components [14]. Go and Java programming is used to code a smart contract.

NXT: It is a public Blockchain platform with templates to facilitate the development of smart contracts [12].

Stellar: If users want high-speed transactions using smart contract, then the Stellar is the best choice because its popularity is rising day by day. The disadvantage of Stellar is that its smart contracts are not turing complete but the advantage is that single transaction cost is approx $0.0000002 [15].

5 Smart Contract Application Areas

Blockchain technology has several application areas, and some of them are as follows:

Financial Services: The use of smart contract reduces the transactional cost because in traditional financial services, a third party is required due to which transactional cost increases [1, 16,17,18,19]. State Bank of India announced to use blockchain for a smart contract in November 2017.

Internet of Things (IoT): Smart contracts can be used to automate the functioning of the devices in the IoT, for example, assets tracking in shipping industry [20,21,22].

Smart Cities: The smart contract can be used in smart city development using sharing service [23].

Smart Transportation Systems: Real-time ridesharing is the excellent application scenario in the social transportation system.

Real Estate: Smart contracts can be efficiently used in renting residential and business buildings [24]. New York’s Bapple Realty was amongst the first real estate agencies to use Blockchain smart contracts. (https://dolare.com/blog/post/8-smart-contracts-use-cases).

Digital Identity Management: Digital identity management using smart contract solves the problem of storing personal data because it is stored on the blockchain, so the KYC verification becomes instants [25].

E-commerce: Smart contracts can be used to automate the fulfilment of the orders, and cryptocurrency can be used for payments.

Social Networks: Facebook has collected 300 Petabytes of user data which increase the risk of exposure of data to malware [26]. Blockchain can be used to improve the security of user’s data using a personal data management system [27].

6 Research Issues in Smart Contracts

Smart contracts not only have several benefits but also have some major research challenges which should be taken care of. Following are some smart contract issues.

Transaction Ordering Dependency Vulnerability: It is one of the major issues of the smart contract. This occurs when several dependant transactions which are included in one block invoke the same contract [28]. This creates a problem for the miner in which transaction is to be performed first. So if the transactions do not execute in the right order, then an attacker can successfully launch an attack.

Privacy Issue: It is a complicated issue because anybody can access the data on a blockchain. So an adversary can analyse the transactions patterns and may be able to reveal the actual identity [29,30,31,32].

Coding of Correct Smart Contract: A smart contract is coded by a coder, who knows the coding language. But if the coder does not able to convert the terms of contract correctly according to the involved parties, then it will create a hazardous condition because the smart contracts have their balances [33, 34].

Time stamp Dependency Vulnerability [28]: Time stamp can be used by smart contracts as a triggered condition to execute transactions. In these typess of scenarios, a miner can do the fraudulent activity by changing its local time.

Immutability of Smart Contract: The smart contracts inherit the property of immutability which makes it unchangeable [35]. But in case of legal contracts, sometimes terms of the contract have to be changed or modify due to the law of the region. So this immutability is a major problem concern to be tackled.

Re-entrancy Vulnerability [28]: This is a condition when an attacker uses a recursive call to conduct multiple withdrawals transactions but his account balance is deduced only once. The distributed autonomous organizations (DAO’s) investor had loosed 60 million US dollars due to DAO Bug in June 2016 [36].

Lack of Trustworthy Data Feeds [37]: The smart contracts which are dependent on the external data sources face problems when wrong data is provided by the external sources [3941].

7 Conclusion

The Blockchain technology-based smart contract work is in a decentralized p2p environment. The smart contract’s features are immutability, decentralization, auditability, etc. Make it famous amongst stakeholders all over the world. Smart contract features, development environment, application scenarios and some research challenges have been discussed. Due to the popularity and rapid development in the smart contract, there may be some untouched gaps, which should be identified and addressed in future.