Secure Service Provisioning Scheme
for Lightweight Clients with Incentive
Mechanism Based on Blockchain
Ishtiaq Ali, Raja Jalees ul Hussen Khan, Zainib Noshad, Atia Javaid,
Maheen Zahid, and Nadeem Javaid(B
COMSATS University, Islamabad 44000, Pakistan
Abstract. The Internet of Things (IoT) industry is growing very fast
to transform factories, homes and farms to make them automatic and
eﬃcient. In the past, IoT is applied in diﬀerent resilient scenarios and
applications. IoT faces a lot of challenges due to the lack of compu-
tational power, battery and storage resources. Fortunately, the rise of
blockchain technology facilitates IoT devices in security solutions. Nowa-
days, blockchain is used to make reliable and eﬃcient communication
among IoT devices and emerging computing technologies. In this paper,
a blockchain-based secure service provisioning scheme is proposed for
Lightweight Clients (LCs). Furthermore, an incentive mechanism based
on reputation is proposed. We used consortium blockchain with the
Proof of Authority (PoA) consensus mechanism. Furthermore, we used
Smart Contracts (SCs) to validate the services provided by the Service
Providers (SPs) to the LCs, transfer cryptocurrency to the SPs and main-
tain the reputation of the SPs. Moreover, the keccak256 hashing algo-
rithm is used for converting the data of arbitrary size to the hash of ﬁxed
size. The simulation results show that the LCs receive validated services
from the SPs at an aﬀordable cost. The results also depict that the par-
ticipation rate of SPs is increased because of the incentive mechanism.
Keywords: Internet of Things ·Blockchain ·Service provisioning
The Internet of Things (IoT) industry is remarkably evolved in the last ten years.
At present, 13 billion IoT devices are connected and in the near future, it would
increase up to 30 billion . Gartner in  says that the total amount of spending
on IoT devices and its services till 2017 is almost $2 trillion. The author also
predicted that the number of connected IoT devices all over the world will grow
up to 20 billion by 2020.
The IoT is optimizing and transforming the hand-operated (manual) pro-
cesses to automatic processes and make them part of the modern era. Central-
ized architecture like cloud computing has extremely contributed to IoT devel-
opment. During the last decade, cloud computing technology has contributed
Springer Nature Switzerland AG 2020
L. Barolli et al. (Eds.): 3PGCIC 2019, LNNS 96, pp. 82–93, 2020.
Secure Service Provisioning Scheme for Lightweight Clients 83
a lot to provide the necessary functionalities to IoT devices. Using these func-
tionalities the IoT devices analyze and process the information and convert it to
real-time information .
Meanwhile, the abilities of resource constraint IoT devices are extended by fog
computing, edge computing and transparent computing. The abilities of the IoT
devices are extended through service provisioning and sharing. Security issues
arise unintentionally during service provisioning to IoT devices. The services
provided by transparent computing technologies are not always accurate. The
services must be validated before executing it. The researchers in some of the
early studies work on validation of the services before execution, which is pro-
vided by cloud computing. The authors in  used block-stream techniques to
encode the services and provide the encoded services to the IoT devices. The
authors in  proposed a scheme that uses local trusted ﬁrmware and trusted
platform modules to validate the services before executing.
Nakamoto in 2008 presented a cryptocurrency based on blockchain .
Blockchain is a technology in which transactions are validated by untrusted
actors. Blockchain provides an immutable, distributed, secure, transparent and
auditable ledger. The information in the blockchain is structured in a chain of
blocks. The blocks contain the number of transactions and these blocks are linked
together through cryptographic hashes.
After the invent of blockchain, researchers used Smart Contracts (SCs) for
validation of services before executing it. Due to the aforementioned features of
the blockchain, it is used as an underlying security fabric in the service provision-
ing systems. In this work, we proposed a secure service provisioning scheme for
Lightweight Clients (LCs) with an incentive mechanism based on the reputation
of Service Providers (SPs). In the proposed scheme, the LCs send requests to
the SPs through blockchain. The SP provides the service codes in an oﬀ-chain
method. The LC validates the service codes and pays the price of the service
to the SP. The Incentive mechanism is based on the reputation of the SP. The
reputation of the SP is increased when it provides valid services and that SP
will receive more requests from the LCs and more incentives will be gathered.
Consortium blockchain with Proof of Authority (PoA) consensus mechanism
is used. A consortium blockchain is used because it has both the features of
the public blockchain and private blockchain. PoA consensus mechanism is used
because it requires less computational power as compared to other consensus
mechanisms. Moreover, the Keccak256 hashing algorithm is used for ﬁnding the
hash of the service codes. Keccak256 is used because it consumes less cost as
compared to other hashing algorithms. The evaluation results show that the
LCs receive validated services at an aﬀordable cost. Moreover, the results also
depict that the participation rate of the SPs increase because of the incentive
The rest of the paper is organized as follows. Section 2presents the literature
review. In Sect. 3, the problem statement is presented. Section4,Presentsthe
proposed scheme for secure service provisioning with fair payment and incen-
84 I. Ali et al.
tive mechanism. In Sect. 5, simulation and results are discussed. Finally, Sect. 6
concluded our work.
2 Related Work
Blockchain is the emerging technology and most of the researchers are attracted
to it. Every ﬁeld in the current era leveraged some of the features of blockchain.
The following are the ﬁelds in which blockchain is used by researchers in past
years. Blockchain is one of the emerging topics for research in recent years.
Some of the researchers integrated blockchain with IoT to overcome the issues
of openness, scalability, data storage, security and channel reliability.
Lin et al. integrated blockchain in Long Range Wide Area Network
(LoRaWAN) server. Using blockchain in the LoRaWAN server, an open, trusted,
decentralized and tamper-proof system is developed. However, the scalability of
the network is ignored .
The author in  presented a proof of concept architecture to implement an
access management system for IoT using blockchain technology. The permissions
and credentials of diﬀerent IoT resources are stored globally. The results show
that the proposed system performed well when the Wireless Sensor Networks
(WSNs) are connected to multiple management hubs. However, when the WSNs
are connected with a single management hub, the architecture performs as a
centralized IoT system. Furthermore, when the management hub fails the devices
connected to it disappear.
Sharma et al. proposed a novel hybrid network architecture by leverag-
ing Software Deﬁned Network (SDN) and blockchain technology. The proposed
architecture is divided into two parts: core network and edge network. By divid-
ing the architecture into two parts, the architecture has both centralized and
distributed features and strengths. The proposed architecture is compared to
Ethereum blockchain and the diﬀerence of 16.1 sec is observed in latency. How-
ever, edge nodes are not deployed eﬃciently and have issues in enabling the
caching technique at edge nodes .
The author used blockchain for research data rights management, monetiza-
tion of data and energy eﬃciency and truthfulness of the networks in [10–12].
Sharma et al. proposed a distributed secure SDN architecture for IoT using
the blockchain technology. The results show that the proposed system performs
well in terms of scalability, accuracy, defense eﬀects and eﬃciency. However, the
data storage issue is ignored in .
For data storage, Jiang et al. proposed a blockchain architecture and net-
work model by considering the participation of the Internet of Vehicles (IoVs).
The lag timestamp range function is used for block validation. The blockchain
architecture consists of ﬁve diﬀerent blockchains. The results show that when
the traﬃc increases, the average number of retransmission is about 0.86 and the
mean throughput of the network also increases. However, the channel reliability
of the cellular network is ignored .
Kushch et al. proposed a rolling blockchain concept for IoT devices. The
IoT devices have less battery resources and computational power to carry out
Secure Service Provisioning Scheme for Lightweight Clients 85
Proof of Work (PoW). The results show that the blockchain remains stable with
an increasing number of attacks. The lost blocks depend on the density of the
sensors and the intensity of the attack. However, security issues and pollution
attacks are ignored in this work .
For security issues, Xu et al. proposed a novel blockchain approach for secure
service provisioning. Furthermore, the authors used consortium blockchain with
the PoA consensus algorithm. The authors also used SCs to validate the edge
servers and service codes. However, no reward is given to the SPs to motivate
Sharma et al. proposed a secure Vehicular Network (VN) architecture based
on blockchain for a smart city. The authors used the blockchain with SC. How-
ever, the SPs are not rewarded so they will not provide services eﬀectively .
In [18–20], the authors used blockchain for balancing electricity demand and
supply, analyzing and securing data and node recovery.
Zhang et al. proposed an IoT E-business model because the traditional E-
business model was not feasible for the IoT. The transactions of smart property
and paid data between IoT are carried out and stored in blockchain by using the
SC. The proposed IoT E-business model is used for a case study and observed
that it is working eﬀectively as compared to the traditional E-business model.
However, a platform for data exchange is missing .
Singh et al. used blockchain to build a secure and trusted environment
for Intelligent Vehicles (IVs) communication. The authors also proposed local
dynamic blockchain branching and unbranching algorithms to automate the
branching process of IV communication. Furthermore, they introduce an IV
Trust Point (IVTP), which is used as a cryptocurrency during communication.
However, by using the branching algorithm, the duplicates state changes are
The author in  proposed a data transmission scheme for block validation
in blockchain considering the node failure. The authors used a multilink con-
current communication tree model. The results show that the proposed scheme
works eﬀectively until the failed nodes reach to 15%. However, the average link
stress, the concurrent communication time and the average end to end delay
increased when the failed nodes reach about 30%. Furthermore, failed nodes are
only detected, not recovered.
Lin et al. used the blockchain and Byzantine consensus mechanism to propose
a framework. The proposed framework authenticates the Channel State Informa-
tion (CSI) for Device-to-Device (D2D) underlying cellular networks. The scheme
of user access control among the users is studied in a data-intensive service appli-
cation. The results show that our proposed framework beats the Q-learning algo-
rithm and random search algorithm in terms of spectrum eﬃciency. However,
users with non-cooperative behavior are not considered .
In , the authors proposed a novel secure service provisioning scheme for
LCs. In the proposed, the cloud server validates the services, the edge servers
and maintain the record of the services. The experimental analysis shows that
the proposed system is suitable for resource constrained devices.
86 I. Ali et al.
The authors in  proposed a decentralized system for data sharing to
share their private data in smart grids. A new PoA consensus mechanism is
also proposed in which the reputation assigned to participants is based on the
In , the authors proposed a trust model for Underwater Wireless Sensor
Network (UWSN) based on blockchain.
3 Problem Statement
The services provided by SPs are not always accurate. The authors in used
a block-stream code technique for service provisioning to IoT devices. However,
the SPs cannot be trusted that they provide the correct services. The authors in
 proposed a scheme in which service programs are validated before execution
by using techniques like local trusted ﬁrmware and trusted platform modules.
However, IoT devices have less space for spare ﬁrmware and no speciﬁc hardware
for trusted modules. After the invent of blockchain, researchers used blockchain
for service validation and veriﬁcation. In , the authors use SCs for the vali-
dation of the services before executing it. However, no rewards are given to the
SPs to motivate them. Moreover, the payment for the service provisioning is also
not considered in this work. In this work, a secure service provisioning scheme.
Payments are transferred in the form of cryptocurrency to eliminate the third
party. Furthermore, an incentive mechanism based on the reputation of the SPs
is proposed to motivate the SPs.
4 Proposed System Model
In this section, we elaborated the proposed system model. The proposed system
model is graphically presented in Fig. 1. Nevertheless, for this proposed model,
we have got the motivation from the system model of paper .
A consortium blockchain is used in the proposed model because it is managed
by diﬀerent authorized nodes. Furthermore, the PoA consensus mechanism is
used because it requires less computational power. Keccak256 hashing algorithm
is used because it requires low gas consumption. There are three main entities
of the proposed model.
SPs: SPs are the nodes that provide services to the LCs in the proposed system.
When LCs request for a speciﬁc service. The SP encrypts the service codes, ﬁnds
the hash of that service codes and publishes that hash on the blockchain. Then
the SP sends that encrypted service codes to the LCs in an oﬀ-chain method.
LCs: LCs are the IoT devices in the proposed system, which have less compu-
tational power, storage and battery resources. In the proposed system, LCs send
requests to SPs through blockchain for service codes. Then these service codes
are validated through SC before execution. LCs also pay to the SPs in the form
of cryptocurrency for speciﬁc service.
Secure Service Provisioning Scheme for Lightweight Clients 87
Fig. 1. Proposed system model
Maintainer Nodes (MNs): MNs are the validators in the blockchain. MNs
are responsible for evidence recording in the blockchain. MNs record transactions
in blockchain about the validity of the LCs, SPs, services and the reputation of
the SPs. The reputation of SPs is based on the number of validated transactions.
4.1 Steps of the Proposed System Model
There are ﬁve steps in our proposed system model as:
1. Firstly, the LC sends a request transaction through blockchain to the SP,
which contains the service name and the SP id.
2. Secondly, the SP ﬁnds the hash of the service codes using the keccak256
hashing algorithm. The hash is published on the blockchain with the service
3. In step three, the SP transmits the service codes to the LC in an oﬀ-chain
manner by using any transmission medium.
4. The LC calculates the hash of the received service codes from SP using the
keccak256 hashing algorithm. Then the LC sends a transaction containing
the service name and the hash of the service codes to the blockchain for
veriﬁcation. Using SC the hash sent by the LC is compared with the hash
88 I. Ali et al.
published by the SP in step 3. If the hashes match, then the output will be
valid service else invalid service.
5. The LC transfers cryptocurrency to the SP account after receiving the vali-
dated service codes.
4.2 Reputation Based Incentive Mechanism
We proposed an incentive mechanism, which is based on the number of valid
transactions and number of invalid transaction. The incentive mechanism is pro-
posed to motivate the SPs to actively take part in the service provisioning pro-
cess. Now, what is reputation, reputation in the proposed system is the number
of valid transactions. Valid transactions are the transactions in which valid ser-
vice codes are sent to the LCs by the SPs. When SP sends the service codes
to the LC and LC generates the hash of the service codes and sends this hash
for validation to SC. SC compares the hash sent by the LC with the hash pub-
lished by the SP and returns the result to the LC. The SC also updates the
reputation of the SP according to the result. When the service codes are valid
then the reputation is incremented by one and if invalid then one is decremented
from the reputation of the SP. When new LCs request for the services they will
ﬁrst look at the reputation of the SPs and then send requests. The SPs with a
high reputation in the network receive more requests and gain more proﬁt. The
scheme is validated through the participation rate of the SPs.
val are the validated transactions, Tx
total are the total transactions and
nonval are the non-validated transaction.
val/T xtotal)×100 (3)
Pr stands for the participation rate of the SPs.
5 Simulation and Results
For simulation, we used diﬀerent tools, which work in a combined manner. For
SC development we used Remix IDE online, which uses solidity language to
develop SC. Remix IDE also provides tools for debugging, deploying and statis-
tical analysis within that online environment.
Ganache is used because it provides a private Ethereum blockchain. On that pri-
vate Ethereum blockchain users perform any operation, which can be performed
on the main Ethereum blockchain without any cost. We used Ganache to test
our SC during development.
MetaMask is a Google Chrome extension that allows developers to run their
DApps on browser without running a full Ethereum node.
Secure Service Provisioning Scheme for Lightweight Clients 89
We used MetaMask to run our SC on the browser and perform all transactions.
MATLAB is used for plotting the results. The values of gas consumption are
recorded from remix IDE and then plotted by using MATLAB.
The results of the proposed scheme are discussed in this section. Furthermore,
a comparison with other algorithms is also performed to check the eﬃciency of
our used algorithms.
5.1 Gas Consumption
In Ethereum blockchain, gas consumption is a small amount of cryptocurrency.
The amount is deducted from the user’s account that is performing the trans-
action on the Ethereum blockchain. The cryptocurrency deducted from the user
account is given as a reward to the miner. Figure 2shows the gas consumption
of every event in the overall process of service provisioning, which is determined
as gas units. The gas consumption depends on the complexity of the code. The
event b and c in the Fig.2shows that the codes are complex in these events,
that is why they consume more gas as compare to a and c.
Fig. 2. Gas consumption of events
Figure 3depicts the total gas consumption of the overall process of service
provisioning. The results show that PoA outperforms PoW in terms of gas con-
sumption. Gas consumed by using the PoA consensus mechanism is 166550 gas
units, while gas units consumed by using PoW are 202668. PoW is computa-
tionally intensive that is why it consumes more gas units as compared to PoA.
90 I. Ali et al.
Fig. 3. Total gas consumption
The total gas consumption by using PoA is almost 17% reduced as compare to
Figure 4depicts the total gas consumption of the overall process of ser-
vice provisioning. The gas consumption is observed by using diﬀerent hashing
algorithms. Keccak256 consumes 30 gas units+6 gas units per word, SHA256
consumes 60 gas+12 gas units per word and RIPEMD160 consumes 160 gas
units+120 gas units per word. The results show that keccak256 outperforms the
SHA256 and RIPEMD160. The total gas consumption by using keccak256 is
166550 gas units, while SHA256 and RIPEMD160 consume 168735 and 169925
gas units respectively. Keccak256 reduces gas consumption by 1.9% and 1.3% as
compared to RIPEMD160 and SHA256, respectively.
5.2 Participation Rate
The participation rate is deﬁned as the participation of SPs in the service provi-
sioning process. The participation rate can be found with the help of the number
of valid and invalid transactions. When the number of valid transactions is more,
then the participation rate will increase and vice versa. Figure 5shows the par-
ticipation rate of the SPs with respect to the number of valid transactions. The
participation rate is directly proportional to the number of valid transactions.
When the number of valid transactions increases the participation rate of the
SP is increasing as shown in Fig. 5.
Secure Service Provisioning Scheme for Lightweight Clients 91
Fig. 4. Total gas consumption by comparing hashing algorithms
Fig. 5. Participation rate with respect to valid transactions
In this paper, a secure service provisioning scheme for LCs using blockchain is
proposed. Furthermore, an incentive mechanism based on the reputation of SPs
is proposed. A consortium blockchain is used because it has both the features of
the public and private blockchain. The maintenance of the blockchain is done by
permissioned users. Other public users only read from the blockchain and verify
the service codes received from the SPs. For consensus in the blockchain, we
used the PoA consensus mechanism in which a group of validators is selected for
consensus and adding new blocks to the blockchain. The validators are selected
92 I. Ali et al.
based on their reputation in the network. The keccak256 hashing algorithm is
used to convert the data of arbitrary size into ﬁxed-size hash. Keccak256 is used
because of its less gas consumption as compared to SHA256 and RIPEMD160.
We also used SC for the validation of the services provided by SPs to the LCs.
The simulation results show that using PoA the total gas consumption is reduced
by almost 17% as compared to the PoW. The results also depict that by using
keccak256 the total gas consumption is reduced by 1.9% and 1.3% as compared
to RIPEMD160 and SHA256, respectively. The results also show that as the
reputation of the SP increases its participation rate increases.
1. MacGillivray, C., Gorman, P.: Connecting the IoT: Te Road to Success. Interna-
tional Data Corporation (IDC) Report (2018)
2. Gartner (2017): Gartner says 8.4 billion connected ‘things’ will be in use in 2017,
Up 31 Percent From 2016. www.gartner.com/newsroom/id/3598917
3. Diaz, M., Martin, C., Rubio, B.: State-of-the-art, challenges, and open issues in the
integration of Internet of Things and cloud computing. J. Netw. Comput. Appl.
67, 99–117 (2016)
4. Peng, X., Ren, J., She, L., Zhang, D., Li, J., Zhang, Y.: BOAT: a block-streaming
app execution scheme for lightweight IoT devices. IEEE Internet Things J. 5(3),
5. Kuang, W., Zhang, Y., Zhou, Y., Yang, H.: RBIS: Security enhancement for MRBP
and MRBP2 using integrity check. Minimicro Syst.-Shenyang 28(2), 251 (2007)
6. Nakamoto, S.: Bitcoin: a peer-to-peer electronic cash system (2008). https://
bitcoin.org/bitcoin.pdf. Accessed 1 Feb 2018
7. Lin, J., Shen, Z., Miao, C., Liu, S.: Using blockchain to build trusted LoRaWAN
sharing server. Int. J. Crowd Sci. 1(3), 270–280 (2017)
8. Novo, O.: Scalable access management in IoT using blockchain: a performance
evaluation. IEEE Internet Things J. 6, 4694–4701 (2018)
9. Sharma, P.K., Park, J.H.: Blockchain based hybrid network architecture for the
smart city. Future Gener. Comput. Syst. 86, 650–655 (2018)
10. Naz, M., Javaid, N., Iqbal, S.: Research based data rights management using
blockchain over ethereum network. MS thesis. COMSATS University Islamabad
(CUI), Islamabad 44000, Pakistan, July 2019
11. Javaid, A., Javaid, N., Imran, M.: Ensuring analyzing and monetization of data
using data science and blockchain in loT devices. MS thesis. COMSATS University
Islamabad (CUI), Islamabad 44000, Pakistan, July 2019
12. Kazmi, H.S.Z., Javaid, N., Imran, M.: Towards energy eﬃciency and trustfulness
in complex networks using data science techniques and blockchain. MS thesis.
COMSATS University Islamabad (CUI), Islamabad 44000, Pakistan, July 2019
13. Sharma, P.K., Singh, S., Jeong, Y.-S., Park, J.H.: DistBlockNet: a distributed
blockchains-based secure SDN architecture for IoT networks. IEEE Commun. Mag.
55(9), 78–85 (2017)
14. Jiang, T., Fang, H., Wang, H.: Blockchain-based Internet of vehicles: distributed
network architecture and performance analysis. IEEE Internet Things J. https://
15. Kushch, S., Prieto-Castrillo, F.: A rolling blockchain for a dynamic WSNs in a
smart city. arXiv preprint arXiv:1806.11399 (2018)
Secure Service Provisioning Scheme for Lightweight Clients 93
16. Xu, Y., Wang, G., Yang, J., Ren, J., Zhang, Y., Zhang, C.: Towards secure network
computing services for lightweight clients using blockchain. Wirel. Commun. Mob.
Comput. 2018, 12 (2018)
17. Sharma, P.K., Moon, S.Y., Park, J.H.: Block-VN: a distributed blockchain based
vehicular network architecture in smart city. JIPS 13(1), 184–195 (2017)
18. Zahid, M., Javaid, N., Rasheed, M.B.: Balancing electricity demand and supply in
smart grids using blockchain. MS thesis. COMSATS University Islamabad (CUI),
Islamabad 44000, Pakistan, July 2019
19. Noshad, Z., Javaid, N., Imran, M.: Analyzing and securing data using data science
and blockchain in smart networks. MS thesis. COMSATS University Islamabad
(CUI), Islamabad 44000, Pakistan, July 2019
20. ul Hussen Khan, R.J., Javaid, N., Iqbal, S.: Blockchain based node recovery scheme
for wireless sensor networks. MS thesis. COMSATS University Islamabad (CUI),
Islamabad 44000, Pakistan, July 2019
21. Zhang, Y., Wen, J.: The IoT electric business model: using blockchain technology
for the Internet of Things. Peer-to-Peer Netw. Appl. 10(4), 983–994 (2017)
22. Singh, M., Kim, S.: Branch based blockchain technology in intelligent vehicle. Com-
put. Netw. 145, 219–231 (2018)
23. Li, J.: Data transmission scheme considering node failure for blockchain. Wirel.
Pers. Commun. 103(1), 179–194 (2018)
24. Lin, D., Tang, Y.: Blockchain consensus based user access strategies in D2D net-
works for data-intensive applications. IEEE Access 6, 72683–72690 (2018)
25. Rehman, M., Javaid, N., Awais, M., Imran, M., Naseer, N.: Cloud based secure
service providing for IoTs using blockchain. In: IEEE Global Communications Con-
ference (GLOBCOM 2019) (2019)
26. Samuel, O., Javaid, N., Awais, M., Ahmed, Z., Imran, M., Guizani, M.: A
blockchain model for fair data sharing in deregulated smart grids. In: IEEE Global
Communications Conference (GLOBCOM 2019) (2019)
27. Mateen, A., Javaid, N., Iqbal, S.: Towards energy eﬃcient routing in blockchain
based underwater WSNs via recovering the void holes. MS Thesis, COMSATS
University Islamabad (CUI), Islamabad 44000, Pakistan, July 2019