AbstractThe utilization of IoT technology increases uninterrupted. The sensors in IoT environments collect great amounts of data and give them to the service providers. This generous content of user’s individual data for IoT applications introduces new security challenges. Indeed privacy preserving is a very significant issue for IoT applications. In this paper, we propose a protocol for privacy preserving in IoT environments using blockchain technology and smart contract concept. Blockchain provides a condition that non-trusting members can correlate with each other without a trusted intermediary. Smart contract is a computer code that executes the conditions of a contract itself. Smart contract helps us to exchange our valuable things in a transparent way without any need to a middleman. The key issue in this work is a secure transmission of the shared key between a sender and a receiver using smart contract and blockchain technology in IoT environments. The secure exchange of shared key can result privacy preserving. We have implemented a prototype of the proposed protocol using pyethereum, and evaluate its security via AVISPA tool. Index TermsBlockchain, Internet of Things (IoT), privacy, security, smart contract. I. INTRODUCTION Internet of Things (IoT) generally refers to scenarios where network connectivity and computing capability extends to individuals, wireless identifiable objects, sensors, sensor embedded-smart tiny devices and everyday items (not normally considered computers) enabling these to generate, exchange and consume data with minimal human intervention [1], [2]. The fundamental fact that IoT consists of a ubiquitous array of devices having sensing and actuating abilities being confined to the Internet depicts the scenario that the relationships between objects and people are tightly intertwined. Additionally, the deployed proportion of IoT devices will get doubled (50 billion devices) by 2020 is the forecast predicted by Cisco’s Internet Business Solutions Group [2], [3]. Some examples of IoT applications lies in EHealth, Smart Transportation, Smart Home Experience, Environmental Monitoring, Precision Agriculture, Retail and Logistics and numerous such domains [2]. Two important challenges for IoT technology are security and user privacy. For instance, in the ubiquitous IoT application such as smart city, data is usually gathered from various sources owned by different administrative domains (e.g., smart phones, and public or private transportation Manuscript received March 20, 2018; revised May 10, 2018. This work was supported in part by Cloud Computing and Value added services Lab (CCVL), Alzahra University, Tehran, Iran. Zahra Dehrouyeh and Reza Azmi are with the Alzahra university, Tehran, Iran (e-mail: reyhane.dehrouyeh@gmail.com, azmi@alzahra.ac.ir). providers) [4]. The data collection may be out of the user’s knowledge and data transmitting may be in plaintext, since the massive collected data is shared among different departments [4].Which may be accessed by unauthorized users to cause serious problems or even be used to harm the owners of the data if no security restriction is made on it [4]. Blockchains have recently attracted the interest of stakeholders across a wide span of industries: from finance and healthcare, to utilities, real estate, and the government sector [5]. The reason for this explosion of interest: With a blockchain in place, applications that could previously run only through a trusted intermediary, can now operate in a decentralized fashion, without the need for a central authority, and achieve the same functionality with the same amount of certainty [5]. Smart contracts _self-executing scripts that reside on the blockchain_ integrate these concepts and allow for proper, distributed, heavily automated workflows [5]. This should make blockchains enticing to researchers and developers working in the Internet of Things (IoT) domain [5]. The goal of this paper is to propose a protocol for privacy preserving in IoT environments using blockchain technology and smart contract. Our proposed protocol is using blockchain technology for transmission of shared key in IoT applications. The rest of this paper is organized as follow. Section II presents related work, in Section III we examine what a blockchain is and how it works. We present our protocol and its specifications in Section IV and details of the implementation in Section V. Section VI presents evaluation of our implementation and we conclude in Section VII. II. RELATED WORK There are different privacy preserving methods are used in IoT environments. In [6] a privacy preserving data aggregation scheme based on homomorphic encryption for sensor data collection by an untrusted aggregation was proposed. In [7] the use of data tagging was proposed. The scheme controls the flow of information based on the tag it received at creation time. Authors in [8] proposed a model where access to sensitive data is restricted to authorized users and devices. In [9] proposed a lightweight privacy-preserving trust model based on the observation that a large class of applications can be provisioned based on simple threshold detection. The main algorithm in this proposed model is an uniformization scheme that uses a combination of sensor aliases to hide the identity of the sensing source and perfunction initialization vector to reveal information only to relevant service providers. This proposal has some advantages. First, processing on sensor is minimum and can Using Smart Contract for Privacy Preserving in Internet of Things (IoT) Environments Zahra Dehrouyeh and Reza Azmi Journal of Advances in Computer Networks, Vol. 6, No. 1, June 2018 71 doi: 10.18178/jacn.2018.6.1.257