Data Sharing System Integrating Access
Control Based on Smart Contracts for
Tanzeela Sultana, Abdul Ghaﬀar, Muhammad Azeem, Zain Abubaker,
Muhammad Usman Gurmani, and Nadeem Javaid(B
COMSATS University, Islamabad 44000, Pakistan
Abstract. Development of Internet of Things (IoT) network brings new
concept of Internet. The dramatic growth of IoT increased its usage. IoT
network facilitates in several manners, more speciﬁcally, in access control
and data sharing among IoT devices. However, it has many challenges,
such as: security risks, data protection and privacy, single point of failure
through centralization, trust and data integrity issues, etc. This work
presented a blockchain based access control and sharing system. The
main aim of this work is to overcome the issues in access control and
sharing system in IoT network and to achieve authentication and trust-
worthiness. Blockchain technology is integrated with IoT, which sim-
pliﬁes the access control and sharing. Multiple smart contracts: Access
Control Contract (ACC), Register Contract (RC), Judge Contract (JC),
are used that provide eﬃcient access management. Furthermore, misbe-
haviour judging method utilizes with penalty mechanism. Additionally,
permission levels are set for sharing resources between users. Simulation
results show the cost consumption. Bar graphs illustrate the transaction
and execution cost of smart contracts and functions of main contract.
Development of Internet leads to the connection of devices. With the growth
of communication and networking technologies, devices are more likely to con-
nect to each other. Devices connected to Internet fasten the growth of Internet of
Things (IoT) network. The idea of IoT can be taken as “network of devices, which
are connected to each other, through Internet”. The main purpose of connection
of devices is to share data, information or resources with other devices. IoT net-
work is integrated with the physical world, over Internet. Growing connection of
IoT devices extend the application of IoT network in all ﬁelds. Applications of
IoT network includes vehicular network, where cars are integrated with enter-
tainment, traﬃc and navigation system; home automation (i.e., smart homes),
health-care system (i.e., transfer health data), supply chain system (asset track-
ing, forecasting, vendor relations, connected ﬂeets), security system (i.e., sensors,
buzzer connected) and many other . Because of its wide range of applications,
Springer Nature Switzerland AG 2020
L. Barolli et al. (Eds.): 3PGCIC 2019, LNNS 96, pp. 863–874, 2020.
864 T. Sultana et al.
IoT devices are connected globally. According to the Gartner report, the rate
of connected devices over Internet will grow up to 2.4 billion by 2020. Connec-
tion of devices require eﬃcient management of IoT network. As vast usage of IoT
results in growing challenges in network. Some of the major issues are: IoT device
management, data conﬁdentiality, authentication and access control, malicious
attacks, centralization, etc. . As IoT network consists of sensitive data, there
might be some solutions for network safety and security. IoT network is neces-
sary to be protected from attacks, unauthorized access to data and inappropriate
data sharing . For security and eﬃciency of IoT network, access management
and data sharing are considered as major aspects of network performance .
Several strategies are proposed to eliminate the issues that IoT network
encounters. IoT network is also integrated with cloud and fog, for eﬃcient utiliza-
tion of network for resource constrained devices. Moreover, to achieve eﬃciency,
accuracy and speed in IoT data processing. Besides the storage and processing
advantages of network, cloud and fog also brings the latency, security and pri-
vacy issues . The challenging tasks of IoT network are considered to be as:
data sharing and access control. There must be some strategies to manage access
control and data sharing of IoT network [6,7]. To eliminate the challenges in IoT
network, blockchain technology is intended to be an eﬀective solution. Blockchain
based solutions are more eﬀective, which provide data integrity, security, audit-
ing, fairness, authenticity, distribution .
Blockchain is an ingenious technology, conceptualized by Satoshi Nakamoto. The
idea of blockchain is given in 2008, via a white paper. Blockchain technology was
introduced for secure transaction of cryptocurrency, i.e., bitcoin. Blockchain is
also considered as an underlying technology for bitcoin. Bitcoin is the ﬁrst cryp-
tocurrency, which is introduced to eliminate the idea of central administration.
It is also considered as an application of blockchain. Blockchain is a decentral-
ized network technology. It is also called distributed public ledger technology. All
transactions done in blockchain network are recorded in a ledger. Ledger is main-
tained in form of blocks. Blocks in blockchain network are ordered chronologi-
cally. The basic structure of blockchain is shown in Fig.1. Blockchain is a peer-to-
peer (P2P) network technology, in which all nodes in network are interconnected.
To eliminate centralization, ledger is distributed and maintained by all nodes.
Fig. 1. Basic blockchain structure
Access Control and Data Sharing 865
Blockchain technology has great signiﬁcances than traditional transaction sys-
tems. Blockchain is also considered as more eﬃcient and reliable technology. Fea-
tures of blockchain over traditional system are: decentralization, immutability,
security, scalability, fault tolerance and trust-less nature. Demand of blockchain
is increasing day-by-day, because of its properties and features. Due to its increas-
ing demand, applications of blockchain are increasing in almost every ﬁeld. For
example: blockchain is implementing rapidly in vehicular network . Other
usage of blockchain technology are Artiﬁcial Intelligence (AI), economy, trans-
portation, health, identity management, supply chain management and smart
contract services . Major features of blockchain that make it distinct from
existing systems are: smart contracts, consensus mechanisms, cryptography tech-
A lot of work is done in literature for eﬃcient utilization of IoT devices. Many
strategies are proposed for access management and data sharing in IoT network
using blockchain technology. Some of the works considered access control and
other focused only on sharing. The work in  is based on access control man-
agement. Smart contracts are used to ensure the trustworthiness of the system.
Furthermore, authors in  proposed an access control system in order to prevent
from single point failure and unauthorized access to the network. For eﬃcient
data sharing, multiple strategies are proposed. Trust based sharing system is
proposed in . In this system, data sharing is integrated with access control,
for authorized access. Permission levels are used for authorization of access.
1.3 Problem Statement
Dramatic growth of IoT network results in numerous challenges like: sharing,
access control, security, trusworthiness, authentication, malicious attacks, cen-
tralization, etc. To manage access control in IoT network, authors in proposed
a blockchain based cross chain framework. The main aim of this system is to pro-
vide a decentralized access model, which provides security and privacy protection
to IoT data. However, user information is not protected in an eﬃcient manners.
In , an access control management is provided. A blockchain based key man-
agement scheme is proposed in terms of privacy, eﬃciency, decentralization and
scalability. The scheme improves the system performance in terms of scalabil-
ity. However, the system fails to provide full utilization of blockchain network.
Sharing of data and services is main aspect of the IoT network. To make data
sharing more eﬃcient, many schemes are proposed. The authors in proposeda
blockchain based service sharing system. The main goal of this scheme is to pro-
tect IoT terminals from unauthorized services. Also to prevent lightweight clients
from unauthorized services providers. In spite of its eﬀectiveness, this scheme is
ineﬃcient for non-cooperative scenarios. For sharing management, work in 
is based on data sharing in AI-powered networks. This scheme works on trust
based sharing strategy. Smart contracts are used to provide secure and trustless
866 T. Sultana et al.
sharing environment. However, the proposed strategy does not work well in all
By taking aforementioned limitations in literature into consideration, a system
is proposed for access control management and service sharing. The main con-
tributions of this work are as follows:
– A blockchain based access control and data sharing model is proposed,
– multiple smart contracts are used for eﬃcient access management,
– diﬀerent permission levels are set for one user to access the data of other user
or IoT device,
– the misbehaviour strategy is used in this model,
– further penalty is determined for the user who misbehaves,
– in addition gas cost is examined for each smart contract and some of the
function in main smart contract.
Further sections are organized as follows. Section 2describes the literature review
in detail. Section 3gives whole understanding of proposed system model and its
work ﬂow. Section 4presents simulation results and reasoning of graphs. Section
5provides the conclusion of the work.
2 Related Work
Several studies are presented in literature for access control management and
data sharing management in blockchain network.
The authors in  investigate the conﬂicts in access control systems in IoT.
To overcome the access control issue, authors proposed a smart contract based
access control system. The access control framework consists of multiple smart
contracts. The main goal is to achieve trustworthiness and validation of access
control. The validation is checked by the behavior of IoT device user in terms
of service requests to other users. The system is evaluated by providing the
case study using hardwares and softwares. The evaluation results show that the
system achieves better performance, by having less access time. However, in this
system IoT devices cannot directly interact with the system. Furthermore, the
time cost and overhead results does not match with real world IoT scenarios.
To further demonstrate the challenges in access management in IoT sys-
tem.  proposed a distributed IoT access management architecture. This work
aims to provide mobile, lightweight, scalable, concurrent, accessible, resilient
access control system. The system is compared with the state-of-art Lightweight
Machine to Machine (LwM2M) servers using WSN management hubs. The sys-
tem outperformed in terms of scalability, throughput rate, latency over tradi-
tional systems. However, the system does not perform well for the single man-
Access Control and Data Sharing 867
Traditional access control schemes are comprised of many issues such as:
security risks, centralization, access management complexity. To solve these chal-
lenges,  proposed an attribute based access control system for IoT. Blockchain
based decentralized system is proposed to issues like: single point failure problem,
data tampering issue. The performance of system is evaluated by using Proof of
Concept (PoC) mechanism. Through PoC, storage and computation overhead of
the system is examined. The IoT devices has less computational and communica-
tional overhead. The system also achieves the ﬂexibility and future maintenance
and update. However, only some parts of consensus algorithms enhance the ﬂex-
ibility of system and maintains the future management and updation.
In , blockchain consensus based user access strategy is proposed. The
authors investigate the data transmission and authenticity issues in data trans-
mission in wireless networks. A consensus based scheme is used to verify the
authenticity of the user and Channel State Information (CSI). The scheme also
intended to improve the eﬃciency of users. The CSI is authenticated for fraud
users, which intentionally use their CSI to get resources. CSI is encoded and
decoded by using the conventional Neural Network (NN). Simulations are done
by making a comparison of the proposed scheme with other algorithms. Results
show that proposed scheme enhanced the spectral eﬃciency. However, in this
scheme nodes are not such intelligent to perform several tasks simultaneously.
Multiple links and access in IoT network increased the issue of security and
privacy. Also the centralization problem in traditional IoT network brings chal-
lenges. For eﬃcient and secure data management in IoT network, proposeda
blockchain based cross chain framework. The framework is proposed for access
control. Multiple blockchains are also integrated with the framework. In this
work, the comparison between multiple blockchains is done. The results show
that integration of Fabric and IOTA is much eﬃcient for IoT. The eﬃciency
of the system is tested virtually for throughput and latency. Security is also
achieved. However, the system does not guarantee the protection of user privacy
and user information.
Furthermore, to tackle the issues related to access control, privacy oriented
blockchain based key management system is proposed in . Issues of third party
involvement and central authority are investigated. The main aim of the sys-
tem is to reduce latency, increase cross domain access. Blockchain technology is
used to bring decentralization. System performance is evaluated by simulations.
The interrelationship of parameters is also studied for testing performance. The
simulation results show that multi-blockchain structure improves system perfor-
mance and enhanced scalability. However, proposed scheme does not provides
full persistency of blockchain network.
The IoT data is considered as big data and the access management of this
data is a great challenge. To achieve trust, security and maximum access control,
multiple schemes are proposed in the literature. Also, there are storage issues,
which create overhead. Storage issues are also considered in diﬀerent works.
To eliminate the storage issue, as well as security and access control issues, 
proposed an oﬀ-chain based sovereign blockchain system. In this work, the mon-
868 T. Sultana et al.
itoring, control and regulation of nodes is maintained by sovereign blockchain.
The performance of the system is evaluated against several existing techniques.
The evaluation is done by using PoC. Evaluation results show that the pro-
posed scheme solves many problems like: keeping excessive data on blockchain,
security and privacy concerns. The system increased the security and eﬀective-
ness of access control. However, this system does not work well for market level
strategies. It lacks when companies intend to integrate with system.
The authors in  investigates an insecure data sharing system among smart
Mobile Terminals (MTs). Blockchain based data sharing system is proposed to
overcome the security and sharing issues. Deep Reinforcement Learning (DRL)
is used to achieve high quality data sharing system, among MTs and IoT appli-
cation. The system also aims to design an eﬃcient scheme that provides secure
data sharing system. DRL is used for safe and reliable environment for MTs. The
security analyses are performed under multiple attacks: eclipse attack, majority
attack, terminal device failure. The results show that the proposed system can
withstand under attacks and achieved reliability and security. However, the sys-
tem neither provides the eﬃcient trade-oﬀ in some parameters nor it supports
auditing and charging services.
For secure and trustworthy service sharing among IoT devices, proposeda
service sharing system for resource constrained IoT devices. The sharing system
is based on blockchain technology. Blockchain is used to validate services of IoT
devices. The system aims to protect lightweight (Lw) IoT clients from insecure
service codes. To demonstrate the eﬃciency and eﬀectiveness, proposed model is
tested using virtual cloud and edge nodes. Further comparative experiments for
throughput and latency are done by using Proof of Authority (PoA) and Proof
of Work (PoW). Evaluation results show that proposed system protects the Lw
clients from unauthorized services. In spite of this, the eﬃciency of proposed
scheme is lacked in non-cooperative scenarios.
Data sharing in mobile communication and network is becoming complex.
To manage data sharing,  proposed an Artiﬁcial Intelligence (AI) based net-
work operation framework. The authors also investigate problems in full power
exploitation of AI. To make data sharing system secure and trust-less, framework
combined smart contract based access control. Two blockchains are proposed in
this work, to improve eﬃciency and throughput rate. Further system is eval-
uated by making comparison with existing schemes in literature. The system
outperformed in terms of: security, privacy and scalability. However, the pro-
posed system is not eﬃcient for all sharing scenarios. It also does not work for
market level strategies.
3 Proposed System Model
A blockchain based access control and data sharing system for IoT network is
proposed, which is being motivated from works in  and . The proposed
system mo del is shown in Fig. 2.
Access Control and Data Sharing 869
Fig. 2. System model
3.1 Smart Contracts
In this system, three smart contracts are used: main smart contract, i.e., Access
Control Contract (ACC), Register Contract (RC) and Judge Contract (JC).
ACC controls the access control. RC is used to register the subject. It generates
a table that registers the required information of a subject. RC also maintains
authorization of user in the system. Moreover, role of JC is to manage misbe-
havior. Misbehavior happens from the side of subject. When subject sends too
many requests for any data service, it is considered as misbehavior. JC checks
for misbehavior, if the misbehavior occurs then penalty is imposed on subject. If
there is no misbehavior occur, then permission levels for the subject are checked
by smart contract. Subject can access required services, according to permission
ACC. ACC is the main smart contract. It is deployed to manage overall access
control of system. When subject wants to access data services of object. It sends
request for that service using blockchain network. The ACC contract executes
and manages all access management of the system. In the proposed system, only
one ACC is used. ACC manages the access control for each request.
870 T. Sultana et al.
Table 1. Subject registration table
Subject Object Resource Time
User A User X File1 2019/5/17
User B User Y Program2 2019/6/14
User C User Z File3 2019/8/8
RC. RC is used to manage the access control of IoT device. Its main role is to
register the peer or subject that sends the service request. RC maintains a table
called register table , for registration. The register table is shown in Table 1.
In the register table, the required information of the subject is stored, such as:
subject, object, resource, time etc. RC also veriﬁes and authenticate the subject
through a register table.
JC. JC implements a judging method that judges the misbehaviour of a sub-
ject. For further execution of service request, JC checks for misbehaviour. If the
misbehaviour is occurred then JC determines the penalty for subject. If there
is no misbehaviour occurred, JC sends the request next. JC generates following
alerts for access control (! is used for alert message):
–Requests are Blocked!
–Static Check Failed!
–Static Check failed & Misbehavior Detected!
If no misbehaviour occurs, the access is granted to subject and JC generates
message “Access Authorized”. If there is any misbehaviour happened by the
subject then other messages are generated by JC. In terms of misbehaviours,
the penalty is determined. The subject’s requests are blocked for sometimes as
a penalty for misbehaviour.
Misbehavior is determined by the judge contract. Misbehaviour is tend to happen
when subject sends too many requests for data services, in a short period of time.
A misbehaviour ﬁeld is maintained to record all the misbehaviours. Whenever
a misbehaviour happens, for that a penalty is decided by the JC. In a result,
requests of a subject are halted for a particular time. There are several types of
misbehavior, that are done by subject. Misbehavior types are:
Access Control and Data Sharing 871
– subject sends too frequent requests,
– subject sends multiple requests in particular time, i.e., 5 requests in 10 min,
– when subject cancels the request.
In a result of a misbehavior, penalty is determined by the JC. In penalty, requests
of a subject are halted. Due to its halted state, subject is no more able to send
requests in network for a certain time period.
3.3 Data Permission Control
Data permission levels are used, to ensure the trustworthiness of access control.
Permission levels are set according to the data sensitivity and the subject who
wants to access that data. Data permission is divided into four levels, which are
–L0: Data is not accessible
–L1: Data can be used in aggregated computation without revealing raw data
–L2: Data is partly allowed
–L3: Data or service is accessible.
4 Simulation Results and Reasoning
In this section, simulations of proposed system are discussed in detail. The pro-
posed system is evaluated for cost consumption in terms of gas usage. The gas
price of smart contracts and their functions is calculated.
4.1 Cost Consumption
In ethereum blockchain, cost consumption is evaluated in terms of gas. Gas is a
measurement unit, which is used to measure computational power of transaction
execution. Gas is deﬁned by miners, at start of the transaction. Gas determines
that how much fee is to be paid for any transaction. Gas price is measured in
Gwei. The amount of gas units is calculated for: execution cost and transaction
cost, of functions of smart contract.
Functions Cost. transaction and execution cost of functions of smart contracts:
ACC, RC, JC, is calculated.
Functions of ACC: Figure 3shows transaction and execution cost of functions
in ACC. As ACC is the main function which controls the overall access control
of the system. The performance tasks of ACC functions are more than other
smart contracts functions. However, only main functions are considered for gas
calculation, such as: user registration, generating permission levels for the subject
and the data access function.
872 T. Sultana et al.
Fig. 3. ACC function cost
Transaction cost: the transaction cost of the functions is shown in the graph.
The transaction of ACC functions: user register, permission level and data access
is about 89000, 25000 and 30000 gas units, respectively.
Execution cost: the execution cost of smart contract functions is also illus-
trated in graph. The transaction cost of functions: user register, permission level
and data access is 65000, 5000 and 9000 gas units, respectively.
Functions of RC: the cost consumption of RC functions is shown in Fig. 4.
RC manages the registration tasks of the subject in the network and maintains
a registration table for user information.
Transaction cost: transaction cost for RC functions: user registration and
registration table creation is about 133000 and 45000 gas units, respectively.
Execution cost: the execution cost of user registration function and registra-
tion table generation function is 130000 and 23000 gas units, respectively.
Functions of JC: the cost consumption of JC functions is illustrated in Fig. 5.
JC functions are: misbehavior calculation function and misbehavior judge func-
Transaction cost: the transaction cost of JC functions: misbehavior calcula-
tion and misbehavior judge is 80000 and 195000 gas units, respectively.
Execution cost: the execution cost for JC functions is also shown in bar graph.
The cost for misbehavior calculation and misbehavior judge function is about
60000 and 165000 gas units, respectively.
Access Control and Data Sharing 873
Fig. 4. RC function cost
Fig. 5. JC function cost
874 T. Sultana et al.
In this work, blockchain based system is utilized to overcome challenges, in IoT
access management and data sharing system. With the aid of blockchain and its
features, many beneﬁts could be bring into IoT network.
This work is intended to provide trustworthiness, authorization, authentica-
tion in access management and data sharing. This work is consist of multiple
smart contracts. Which are used to maintain authentication, authentication, reg-
istration. Furthermore, misbehavior is also implemented, whenever the subject
sends too many access requests at a short period of time. For misbehavior, the
corresponding penalty is deﬁned for subject. If there is no misbehavior occurs,
then permission levels are checked for subject to access services of object. In
addition to that, simulations are done to calculate cost consumption of smart
contracts used in ethereum platform. The cost of smart contracts and their func-
tions is calculated. Both transaction and execution cost is checked. Simulation
results show that the proposed system is cost eﬀective.
1. Zhang, Y., Kasahara, S., Shen, Y., Jiang, X., Wan, J.: Smart contract-based access
control for the internet of things. IEEE Internet Things J. 6, 1594–1605 (2018)
2. Novo, O.: Scalable access management in IoT using blockchain: a performance
evaluation. IEEE Internet Things J. (2018)
3. Ding, S., Cao, J., Li, C., Fan, K., Li, H.: A novel attribute-based access control
scheme using blockchain for IoT. IEEE Access 7, 38431–38441 (2019)
4. Lin, D., Tang, Y.: Blockchain consensus based user access strategies in D2D net-
works for data-intensive applications. IEEE Access 6, 72683–72690 (2018)
5. Jiang, Y., Wang, C., Wang, Y., Gao, L.: A cross-chain solution to integrating
multiple blockchains for IoT data management. Sensors 19, 2042 (2019)
6. Ma, M., Shi, G., Li, F.: Privacy-oriented blockchain-based distributed key manage-
ment architecture for hierarchical access control in the IoT scenario. IEEE Access
7, 34045–34059 (2019)
7. Sifah, E.B., Xia, Q., Agyekum, K.O.-B.O., Amofa, S., Gao, J., Chen, R., Xia, H.,
Gee, J.C., Du, X., Guizani, M.: Chain-based big data access control infrastructure.
J. Supercomput. 74, 4945–4964 (2018)
8. Liu, C.H., Lin, Q., Wen, S.: Blockchain-enabled data collection and sharing for
industrial IoT with deep reinforcement learning. IEEE Trans. Ind. Inform. (2018)
9. Xu, Y., Wang, G.., Yang, J., Ren, J., Zhang, Y., Cheng, Z.: Towards secure network
computing services for lightweight clients using blockchain. Wirel. Commun. Mob.
10. Zhang, G., Li, T., Li, Y., Hui, P., Jin, D.: Blockchain-based data sharing system
for AI-powered network operations. J. Commun. Inform. Netw. 3, 1–8 (2018)