ArticlePDF Available

Blockchain-based Secure Multi-Resource Trading Model for Smart Marketplace

Authors:

Abstract and Figures

Developments in sensors and communication technology lead to the emergence of smart communities where diverse collaborative applications can be enabled. One such application is the Smart Market Place (SMP), where participants of the smart community can trade resources, such as energy, internet bandwidth, water, etc., using a virtual currency (such as ether). However, most of the existing SMP trading models are proposed to trade a single resource and also restrict a participant to perform only a single transaction at a time. Restriction on multiple parallel transactions is imposed to protect the participants against the double-spending attack in the SMP. This work proposes a Secure Multi-Resource Trading (SMRT) model that is based on public Ethereum blockchain. SMRT allows participant of a SMP to trade multiple resources and initiate parallel transactions. Moreover, detailed security analysis and adversary model are presented to test the effectiveness and to assess the resilience of the proposed model against the double-spending attack. The adversary model is based on partial progress towards block production which is influenced by time advantage and average computing power. Furthermore, simulation based analysis and comparison of SMRT is also presented in terms of security, performance, cost and latency of transactions. It is observed that SMRT not only provides protection against the double spending attack, but it also reduces the computational overhead of the proposed model up to fifty percent as compared to existing trading models.
Content may be subject to copyright.
Blockchain-based Secure Multi-Resource Trading Model
for Smart Marketplace
Bello Musa Yakubua, Majid I. Khana,, Nadeem Javaida, Abid Khanb
aDepartment of Computer Science, COMSATS University Islamabad, Islamabad 44000,
Pakistan
bDepartment of Computer Science, Aberystwyth University, SY23 3DB, Aberystwyth,
Wales, United Kingdom
Abstract
Developments in sensors and communication technology lead to the emergence
of smart communities where diverse collaborative applications can be enabled.
One such application is the Smart Market Place (SMP), where participants of
the smart community can trade resources, such as energy, internet bandwidth,
water, etc., using a virtual currency (such as ether). However, most of the
existing SMP trading models are proposed to trade a single resource and also
restrict a participant to perform only a single transaction at a time. Restriction
on multiple parallel transactions is imposed to protect the participants against
the double-spending attack in the SMP. This work proposes a Secure Multi-
Resource Trading (SMRT) model that is based on public Ethereum blockchain.
SMRT allows participant of a SMP to trade multiple resources and initiate par-
allel transactions. Moreover, detailed security analysis and adversary model are
presented to test the effectiveness and to assess the resilience of the proposed
model against the double-spending attack. The adversary model is based on
partial progress towards block production which is influenced by time advan-
tage and average computing power. Furthermore, simulation based analysis and
comparison of SMRT is also presented in terms of security, performance, cost
Corresponding author
Email addresses: bellomyakubu.cui@gmail.com (Bello Musa Yakubu),
majid_iqbal@comsats.edu.pk (Majid I. Khan), nadeemjavaidqau@gmail.com (Nadeem
Javaid), abk15@aber.ac.uk (Abid Khan)
Preprint submitted to Journal of L
A
T
E
X Templates November 30, 2020
and latency of transactions. It is observed that SMRT not only provides protec-
tion against the double spending attack, but it also reduces the computational
overhead of the proposed model up to fifty percent as compared to existing
trading models.
Keywords: Blockchain technology, Smart marketplace, Multi-resource
trading, Double-spending attack
1. Introduction
Advancements in sensor integrated devices and network innovations has led
to the emergence of smart communities where resources, such as energy, wa-
ter, and internet bandwidth can be traded among the participating entities for
example local energy smart grid (LESM) system and community water supply
cooperation (CWSC), this type of trading platform is named as Smart Market
Place (SMP) [1, 2]. Depending on the architecture, existing SMP solutions can
be categorized into two types, centralized and decentralized. The centralized
approach is based on a traditional contemporary model, where the system pro-
vides a central control for processing, administering, and delivering resource
trades [12]. The approach has some benefits for example, ease of set-up and
flexible overall system control. However, it may face a range of privacy and
security problems, such as central point of failure, controller compromise, and
information leakage [6]. Alternatively, distributed approach enables resource
management and exchange among the participants with either fully or semi-
distributed mechanisms [13, 18]. Using the distributed approach, a participant
can obtain required resources from its neighborhood without or partially relying
on a central resource trading manager [14]. In distributed approach, household
owners with surplus resources achieve greater profits compared to the central-
ized scheme, because it enables participants to express and settle resource prices,
thus establishing a competitive resource trading market [18, 15]. Additionally,
the distributed approaches help to overcome the limitations of centralized ap-
proaches, such as central point of failure and high influence of central authorities
2
in terms of control and management [13].
Most of the existing SMP solutions are decentralized in nature (implemented
using blockchain technology, such as Ethereum) and allow only one type of re-
source to be traded (for example, energy or water) [4, 5]. Moreover, a participant
can trade with only one other participant at a given time, that is, it is not per-
mitted for a seller to trade with two or more buyers in parallel. For example,
[7, 8] introduce trading models to enable data/internet bandwidth trading, and
[6, 9] are solemnly presented to enable energy trading, only allowing one trading
transaction at a time. We refer to these types of trading platform as one-to-one
single resource type (OTOSRT) approaches. These type of approaches are es-
tablished to ensure transparency and to avoid double spending behaviours by
participants during the trading activities. As a result, existing SMP models are
not applicable in scenarios where a seller wants to divide a large quantity of
resources into small portions and publish it to multiple buyers to sell in paral-
lel. Moreover, a seller may desire to trade different types of resources, such as
energy, water, and internet bandwidth. We refer such a scenario as one-to-many
multiple resource type (OTMMRT) trading model that needs to be developed.
Moreover, the OTMMRT facility in SMP can be exploited by the adversary to
launch a double spending attack, that needs to be addressed. Two types of
double spending attacks for these scenarios are, token based double spending,
and ownership based double spending [6, 11]. In token based double spending,
the attacker is an authenticated requester node who wants to spend a single
digital token more than once in several trading transactions. While, in owner-
ship based double spending, the attacker is an authenticated provider node who
wants to sell ownership of a resource (e.g. Energy) to two or more buyers.
Considering the significance for achieving scalable and secured resource trad-
ing, the need for OTMMRT trading model is evident. In this paper, we present
a novel OTMMRT trading model with low overhead and latency that also pro-
vides protection from double-spending attacks.
Our Contributions: Following contributions are made in this paper:
3
a scalable OTMMRT trading scheme is proposed. It enables a participant
to perform multi-resource trading with one or more participants simulta-
neously,
a security feature to handle ownership based double spending attack to-
gether with a token based double spending attack in SMP had been pro-
posed,
the smart contract architecture was built, tested, and carefully evaluated
to ensure that there are adequate flexibility and defense against severe
security threats, such as re-entrancy vulnerability, timestamp dependency,
transaction dependency and parity multisig bug,
detailed security analysis was carried out to show that the SMRT scheme
is protected against specified adversary model. Experiments had been
performed to compare the effectiveness of the SMRT model compared to
existing schemes.
Organization of the Paper: The rest of the paper is organized as follows:
Section 2 provides an overview of the related work. In Section 3, we present the
system model, Section 4 describes SMRT trading scheme. Section 5 discusses
the security analysis, section 6 explains the testing and evaluation, and section
7 is the conclusion.
2. RELATED WORK
Most of the existing SMPs are designed for OTOSRT [7, 8]. This is to
curtails double spending attacks which may be inevitable [19]. However, there
are very few schemes such as [6] that allow trading a single resource with two or
more participants in parallel. Yet, these techniques face many challenges when
it comes to deployment in a real world scenario, such as identity and privacy
issues, and double spending attacks. Similarly, technique proposed in [20] is
developed for OTOSRT, but it can be used to trade various resource types (e.g.
energy, water etc.) during different trading periods.
4
The existing trading schemes can also be categorised based on their archi-
tectures that is centralized, semi-distributed, or fully distributed [19]. Initially,
some of the schemes uses centralized contemporary architecture [1, 12] when
determining how and when to charge a customer based on token payment ap-
proach. The resulting imprecision, may not be acceptable in the event of higher
and less regular payments. This may be as a result of the control center for pro-
cessing, managing and distributing resources and token payment transactions.
The approach has several benefits, e.g. easy set-up and efficient management;
yet, it still poses wide range of privacy and security issues similar to several
other centralized approaches [1, 6].
The token based payment system can be used not only in conventional
centralized client trading schemes, but also in semi-distributed P2P platforms
[21, 22]. The concept of private SMP P2P trading and payment was proposed
in [20, 22], the approach ensures that communications and transactions remain
private. This original concept demanded an on-line manager to confirm tokens
before vendors could provide their services to protect them from double spend-
ing. Technique [23, 24] uses digital tokens as a payment mechanism for P2P
transactions, taking advantage of the fact that peers are clients and traders at
the same time. Buyers will then pay with the (exchangeable) tokens they re-
ceive from selling their own goods, reducing the amount of contacts with the
central authority. Similarly, the scheme [25, 26] broadens the concept of [23]
and guarantees that tokens are anonymous as well as the responsibility of as-
signing authority to peers themselves. In addition, technique [25] proposes a
method for real-time double spending detection that uses the P2P network as
a semi-decentralized database for spent tokens and queries using a DHT rout-
ing layer such as [28]. Besides, techniques [1, 29, 30, 31] addresses the same
concept in more detail and tests various situations for the position of collected,
spent tokens. Yet, neither solution could provide tough assurances against dou-
ble spending, particularly when a portion of the P2P nodes are compromised
[27]. The semi-decentralized database cannot be completely trusted except if
the secure routing and integrity of peers is assured and can only accommodate
5
probabilistic assurances.
Notwithstanding, better solution for token-based payment resource trading
can be achieved using full decentralized/distributed P2P platforms, such as
blockchain technology [1, 19]. The approach [9] introduced a mechanism known
as the Commit to Pay (CTP) to tackle double spending based on blockchain
with the help of Merkle Tree [32]. It is a payment agreement that commits a
sum of tokens to the seller. Under this process, the buyer will not be able to
spend the money deposited, and the deposited money will not be transferred
to the producer’s account until the products are released else, the token will
be reversed back to the buyer after a given time frame. Another untraceable
blockchain token-based payment system was implemented in [6]. The technique
also explored the idea of Bitmessage technology [33]. Besides, the technique
prevents an attacker from spending more than one digital token or ownership of
generated commodities. Thus, approaches [6] and [9] demonstrate unique and
better techniques towards curtailing double spending attack in the SMP more
than other existing approaches mentioned above. Nevertheless, the approaches
[6] and [9] are only applicable in single resource trading and may not support
multiple transactions at a time in a multi-party SMP. Furthermore, they may be
prone to Blockchain analysis attack and the implementation of Merkle Tree in a
Blockchain-based network such as Ethereum network may be computationally
cost which can also lead to slow flow of transactions. This might make the pro-
cess to become less efficient and less user-friendly. However, based on contextual
and practical similarities, [6] and [9] are set as the benchmark techniques to our
proposed approach.
In conclusion, almost all the existing literature only focused on OTOSRT
resource trading. These approaches are not well-suited for simultaneous multi-
resource trading in a multi-user SMP environment due to the possibility of
double spending attack. Thus, there is a need to come up with more scal-
able lightweight cryptographic solutions that support multiple resource trading.
Table 1 provides the summary of the most current related approaches in the
literature.
6
Table 1: SUMMARY OF RELATED APPROACHES
Technique Objectives Attacks considered Achievements Limitations
ECC,
ECDSA
Blockchain
[6]
Token-based pay-
ment system.
Double spend-
ing, Identity and
data transaction
disclosure
Prevents an attacker
from spending more
than one digital to-
ken or ownership of
generated commodities.
Limited to a single com-
modity trading, Parallel
trading not possible.
Merkle
tree,
Blockchain
[9]
Payment agree-
ment that commits
a sum of tokens to
the seller
Double spend-
ing and Identity
disclosure
Prevents an attacker
from spending more
than one digital to-
ken or ownership of
generated commodities.
Parallel trading not
possible, Limited to
a single commodity
trading.
Blockchain
[20, 21,
22],
P2P trading and
payment.
Double spending,
51% attack.
on-line manager to
confirm tokens before
vendors could provide
their services to prevent
double-spend.
Central point of failure,
Parallel trading not
possible, Limited to a
single resource trading.
Blockchain
[23, 24]
Digital tokens as
a payment mecha-
nism for P2P trad-
ing.
Double spending Tokens are exchange-
able between peers.
Tokens are not anony-
mous, and peers de-
pends on central au-
thority.
Blockchain,
DHT
routing
layer
[25, 26]
Using digital to-
kens in P2P trad-
ing and achieving
peer anonymity.
Double spending Real-time double-
spending detection
using P2P network as a
centralized database.
Databases cannot be
completely trusted
especially when peers
are compromised.
Blockchain
[1, 12,
29, 30,
31]
Anonymous P2P
transactions using
digital tokens.
Double spending,
identity linking
attacks
Tokens are anonymous,
peers autonomous, and
real-time double spend-
ing detection.
Prone to double spend-
ing especially when
nodes are compromised.
3. SYSTEM MODEL
This section provides a detailed discussion on our system model, which in-
clude; (1) network model, (2) adversary model, (3) security and operational
requirements, and (4) requirements for security failure of our proposed frame-
work.
3.1. Network model
In this work, the SMP (inspired by [10]) comprises of smart homes, equipped
with smart gateway hardware (e.g. smart meters) that are connected to the in-
ternet, as shown in Figure 1. Legitimate smart homes in the SMP are identified
by their respective smart gateways and can take part in the P2P resource trading
either as a resource provider (Seller) or resource requester (Buyer). They ini-
7
tially purchase their individual resources from their respective resource provider
(RP) for example internet service provider, water supply company, and energy
grid. Later on, participants (Sellers) sell their excess resources to other partici-
pants (Buyers) who need extra resources in the community. It is presumed that
both the buyer and seller of a given resource must be subscribers of the same
RP.
The SMP network is based on semi-centralized private Ethereum blockchain
technology with a self-triggering program called smart contract [4, 5, 11]. Be-
sides, the SMP is a private digital trading environment were all participating
stakeholders perform trading activities based on proof-of-authority (PoA) con-
sensus algorithm [18]. In PoA consensus algorithm, a miner node is selected
based on its identity; and authority (power) is given to it to verify and allow
any transaction to be added to the block. The SMP as a whole, is equipped with
a temper-proofed virtual management point referred here as the Smart Market
Gateway (SmGW), as shown in Figure 1. Both the smart homes and SmGW
have access to smart contracts and use separate Ethereum Account (EA). The
SMP is presumed to have a set of registered and recognized RPs and smart
homes in the network is the subscriber of the RP. The RPs provide the needed
resources (such as water, electricity, and internet bandwidth) to all participat-
ing smart homes. The model is inspired and based on the Bitmessage method
of decentralized P2P message authentication and delivery.
3.2. Adversary model
We make the following preliminary assumptions about adversary:
an adversary may control the means of communication between partici-
pants in SMP and then launch double spending attack,
the SmGW and other smart gateways are temper proof and therefore
cannot be compromised.
Motivated by [11], the concept of an attack in this work, is justified on the
basis of the following parameters; (i) adversary’s likelihood of making a double
8
Figure 1: Proposed system model.
spending attack (DS), (ii) a potential progress function (P) and (iii) a catch-
up function (C). The parameter DS relies on P and C; and intuitively tests the
network’s susceptibility to a double spending attack. P describes the anticipated
adversary branch length after a valid branch has been sufficiently long. While
C describes a double-spending attack likelihood by considering the anticipated
length of the adversary’s branch. Following are the definitions of the parameters
that are used to describe the adversary model:
q[0,1]: is the probability that an adversary will be able to mine a block
faster than the trustworthy nodes once they start to mine simultaneously.
This implies that q is the ratio of the adversary’s computing strength
compared to total network computing capacity.
The minimum number of verified block confirmations and transactions
needed for acceptance set by each seller or buyer (as the case may be) is
9
given as: K.
The average amount of time in seconds required to mine a block for the
entire network (both for trustworthy and adversary nodes) is given as:
τIR>0
Main goal of the model is to analyze the output of parameter DS in relation
to other parameters as follows:
DS(q, K, n, t) is the likelihood that the adversary will effectively execute
a double-spending attack, provided that the adversary node dominates q
percent of the system, given an initial benefit of nblocks and tseconds
over trustworthy nodes, and only the Kth block has been mined.
P(q, m, n, t) is the likelihood that the adversary would precisely mine n
blocks after the mining of an mth block by trustworthy nodes. While, tis
the time at which an adversary node mines the nth block precisely.
C(q, t) is the probability that an adversary’s branch will be longer than
a trustworthy one, if trustworthy nodes were to mine their final blocks t
seconds earlier than adversary.
In our attack scheme, states are recognized via the size of legitimate and bogus
branches, that are presumed to have the same size, as well as the time gap
during which all trustworthy and adversary nodes have mined their last block.
In other words, a state comprises of two quantities tand nindicating the time
gap tduring which both the trustworthy and the adversary nodes mined their
nth blocks. Hence, the possibility of double spending attack occurrence in this
work is measured based on the ability of the adversary to mine a block of
transactions faster than the trustworthy nodes within a specified practical time
advantage as suggested in [11].
3.3. Security and operational requirements
The proposed framework is intended to satisfy the following security and
operational criteria:
10
Authentication : The proposed framework should allow only verified-
registered and authorized smart homes of the SMP to participate in the
resource trading.
Double spending : It should be able to provide protection from the two
identified double spending attacks. These include; Token based double
spending and Ownership based double spending.
Multi party S M P : The system should be able to allow a participant
to trade with other multiple participants in the SMP simultaneously.
Multi resource trading : The framework should allow a participant to
trade multiple resources concurrently.
4. SECURE MULTI-RESOURCE TRADING MODEL (SMRT)
This section presents the proposed SMRT trading model as presented in
Figure 2. Four main actors involved in this model are: the requester gateway
(ReqGW ), provider gateway (P roGW ), the smart market gateway (SmGW ),
and the RP. Others include the auction board, the blockchain handler and
the payment handler smart contract (PHSC). The scheme is proposed to be
implemented in three phases, namely: registration, initialization and message
transmission.
4.1. Registration of smart homes in the SMP
The SmGW registers all participating smart homes, and add them to the
SMP. In this respect, the joining smart home will need to send a joining request
transaction (containing its credentials) to the SmGW , which comprises of the
smart gateway’s public key, RPIDN (resource provider identification number)
and block Timestamp. The SmGW will verify if the RPIDN belongs to valid
RP in the SMP and then evaluate the freshness of the Timestamp as described
in equation (1). The Timestamp freshness verification is done by checking if the
current timestamp is greater than that of the received transaction message. If
11
Figure 2: Proposed trading model.
the results are true, then the smart home is added to the SMP and a reply with
a new shared key called Transaction session key (T S Key) encrypted with the
public key of the smart home is transmitted. After receiving this key, the smart
home gateway using its public and private keys creates new pairs of session IDs
called marketing session IDs (MSI Dpub, M SI Dprv ). All keys and IDs are for
one-time usage. Therefore, for subsequent trading cycles, new keys and IDs are
generated using public and private keys.
Each pair of Marketing session IDs are created using the Bitmessage tech-
nique, which allow every participating node (smart home) to create IDs and
broadcast encrypted transaction messages anonymously. However, the Bitmes-
12
sage technique encrypts each block of transactions independently instead of
using an encryption method which mostly makes the contents of the encrypted
blocks dependent on each other. With this Bitmessage feature, the attacker
can rearrange blocks of the encrypted transaction messages which the receiver
will see as a valid message, allowing blocks of the message to arrive in the
order chosen by the attacker [34]. To address the message arrival problem,
we adopt cryptographic proof-of-authority (PoA) and speedup RSA encryp-
tion/decryption [35] schemes in the system during implementation to ensure
security and privacy are maintained within the private network.
curr.T imestamp > T imestamp (1)
4.2. Initialization
The initialization steps required for a transaction among the trading part-
ners (P roGW and ReqGW ) are discussed in this section. Following the smart
homes registration in the SMP, the potential P roGW submit its tender of re-
sources T(R) and its MSI DP roGW P ub first to the respective RPs for resource
ownership key generation. The T(R) is given as {R1,R2,R3,. . . ,Rn}, where n
is the cardinality of the resource types, if the P roGW have subscriptions with
nRPs and willing to make trading of nresources in the SMP as described in
equation (2).
T(R1) = ap1, rR1, bp2, rR1, cp3, rR1, . . . , zpx, rR1
T(R2) = ap1, rR2, bp2, rR2, cp3, rR2, . . . , zpx, rR2
T(R3) = ap1, rR3, bp2, rR3, cp3, rR3, . . . , zpx, rR3
.
.
.
T(Rn) = ap1, rRn, bp2, rRn, cp3, rRn, . . . , zpx, rRn
(2)
13
Figure 3: Initializing the trading process.
Where a, b, c, and zare positive real numbers representing the volumes (amounts)
of resource type needed, pand rare the price and unit of the resource types
R1,R2,R3,. . . ,Rnrespectively.
Then each RP verify the request and the availability of the said resource.
Each RP then replies with a secrete ownership key (OKeyP roGw ), a nonce, and
the block timestamp to the P roGW . Besides, a lock is also activated by the
concerned RP on the said amount of the requested resource; this ensures that
the resource cannot be used by P roGW ’s smart home after the ownership key
is generated. The RP reply is described in equation (3) and line 10 and 19 of
Algorithm 1.
T x(P roGW )RP =
{(OKeyP roGw R1, NonceR1), ..., (OKeyP roGwRn, N onceRn)}
(3)
Secondly, on receiving the ownership key(s), the P roGW submit a selling
participation request to the SmGW which is made up of its M SIDP roGW P ub ,
T(R) and the block timestamp encrypted with its T SK ey. In return, the
14
SmGW receives and decrypt the message, evaluate it as described in equation
(1) and then updates the blockchain public ledger. Also, during this evaluation,
the SmGW also verifies the validity of the submitted T(R) from the concerned
RP. If the evaluation results turned to be true, the SmGW replies with a trade
granting permission (TGP) message as depicted in Figure 3. On receiving the
TGP message, the P roGW broadcast its bids anonymously on the blockchain
auction board as given in equation (4), which also includes the price of the re-
source to be sold. The broadcast processes are also depicted as an output of
Algorithm 1.
T xauctionboardP roGW =M S IDP roGwP ub kT ype k
V olume kP r ice kT imestamp kN once kU nit
(4)
The pair of ID, Nonce and OKeyP roGw together are used only for one-time
trading cycle. Similarly, the pair of IDs and OKeyP roGw are also used to prevent
double spending from the side of P roGW . While nonce is used to verify the
identity and ownership claim of P roGW on the said resources. In addition,
the OKeyP roGw is used to sell or transfer ownership of the resource locked by
this secret key to the buyer. Bids are broadcasted to all nodes in the private
blockchain network.
The ReqGW , being the potential resource buyer submits a buying partici-
pation request to the SmGW which is made up of its M SIDReqGwP ub , and the
block timestamp encrypted with its T SK ey as described in line 2 of Algorithm
2. In return, the SmGW receives and decrypt the message, evaluate it as de-
scribed in equation (1) and then updates the blockchain public ledger. If the
evaluation result turn out to be true, SmGW replies with a new trade granting
permission (TGP) message. This will enable the ReGW to receive broadcasted
bids from the auction board. The initialization processes are highlighted in
Figure 3.
4.3. Transactional Message Block (TMB) transmission
AReqGW obtains a given P roGW ’s M SID and other information about
15
Algorithm 1: : Provider Gateway (ProGW) resource submission and
initialization
Input: Read the value: M SIDpubP roGW hash(P ubKeyP r oGw, T imestamp2)
Output:
BroadcastB iddingM SI DP ubP roGW kT ypeikV olumeikP riceikT imestampi
kNonceikUniti
1Function SubmitTender(T(R)):
2nNumber of resources
3if (n= 1)then
4RType of resource;
5aAmount of resource;
6pPrice of resource;
7rUnit of resource;
8T(R)(a, p, r);
9T ender.Submit(T(R), M SIDP ubP r oGW , T imestamp);
10 RP.Reply (OK eyP roGw , N once).
11 else
12 for (i= 0;i <=n;i+ +)do
13 RiType of resourcei;
14 biAmount of resourcei;
15 piPrice of resourcei;
16 riUnit of resourcei;
17 T(Ri)(bi, pi, ri);
18 T ender.Submit(T(Ri), M SIDP ubP r oGW , T imestamp);
19 RP.Reply (OK eyP roGw , N once).
20 end
21 end
16
the bid from the auction board. Since there may be several suppliers, therefore
the ReqGW filters result by activating a matching process according to price
and amount. To do so, the auction handler searches the blockchain for recent
transactions aimed at a given public key by verifying the freshness of the Times-
tamp as described in equation (1) and line 5-13 of Algorithm 2. The ReqGW
then obtain the records of active bids and messaging stream Marketing Session
IDs of supplier relevant to its query.
If the ReqGW selects the P roGW as a potential supplier, it sends a private
message to SmGW asking to verify the P roGW ’s claim of ownership. This
is to re-ensure that authenticity and legitimacy are maintained at this level.
From Figure 4, The SmGW scans blockchain public ledger and responds if the
argument is true or false (Line 4 to 13, Algorithm 2). If the claim is true, then
the auction panel is utilized for bid selection and private messages are sent to
negotiate with a potential supplier (P roGW ) by encrypting the T M B using the
MSI DP roGW P ub as:
MSI DP roGW P ub (MSIDReqGW P ub , ωi, Ti) = φi(5)
Where ωiis the request message and Tiis the block timestamp. The ReqGW
identity remains anonymous behind a pseudonym MSI DReqGW P ub .
A validating authority validates the T MB and adds it to the blockchain
based on PoA consensus algorithm. With this, the encrypted TMB is published
in the blockchain network where all participant nodes will receive a copy of the
package. Only P roGW which has the right secret key will be able to decrypt
the T M B using a M SIDP roGwP rv , as follows:
MSI DP roGw Pr v φi=ωi, Ti, M SI DReqGwP ub (6)
and then P roGW verifies the freshness of Tiusing equation (1). If it verifies
to be true, then some response should be returned to the ReqGW by encrypting
another T M B:
MSI DReq GwP ub ω, Tj=ωj(7)
17
Algorithm 2: : Requester gateway buying transactions and negotia-
tions
Input: Read the value: M SIDpubReqGW hash(P ubK eyReqGW , T imestamp4)
Output: OKeyP roGW ,P ay ment
1Function BuyingTransact(BT ):
2buyingRequest hash(MSIDpubReqGW , T imestamp)
3ReqGW.LocalRepository BroadcastBidding
4Function Auction Check(AC ):
5if (curr.T imestamp > T imestamp)then
6if Noncei,IDi,OK eyiP roGWithen
7Return : Send for Negotiation
8else
9Return : Claim not Valid!
10 end
11 else
12 Return : Auction freshness not confirmed!
13 end
14 Function Negotiations(NG):
15 if (P ricei=Accept)then
16 Return : Negotiation successful!
17 Trigger PH SC
18 P HS C ReqGW.P ayment
19 P roGW P HS C.CommitP ay
20 P HS C P roGW.OK eyPr oGW
21 P roGW P ayment
22 ReqGW OK eyP roGW
23 ...................
24 P roGW SmGW.Cr editConf irm
25 ReqGW SmGW.Certif icate
26 else
27 Return : Auction negotiation discarded!
28 end
18
Figure 4: Trading process conclusion.
Similar checks will be performed by ReqGW to verify the message sent
by P roGW . As depicted in Figure 4 and line 15-21 of Algorithm 2, after all
sides agreed on the negotiation, then ReqGW trigger a payment handler smart
contract (PHSC) and then submit the payment via the PHSC in the form of en-
crypted anonymous message stream transaction as demonstrated in the equation
(8). A commit to pay notification transaction will be broadcasted by PHSC to
inform the nodes about the commitment of the ReqGW as depicted in equation
(9).
T xP roGW ReqGW =
MSI DP roGw Pub (M SIDReqGwP ub , T ype, V olume, U nit, T oken, Ti)
(8)
T x(P roGW )P HS C =
TID kT imestamp kt0kP rice kContractHash kMSI DReqGw Pub
(9)
Where TID is the transaction ID, t0is the maximum waiting time, P rice
is the agreed price of the commodity, ContractHash is the hash of the smart
19
contract, MSI DReqGwP ub is the public pair of the R eqGW ’s marketing session
ID and T imestamp is the block timestamp.
This will enable the P roGW to re-confirm its willingness to sell its OKey
of the said resource before the PHSC could allow the payment to reach the
respective P roGW . As per our PHSC rule, payment can only be released when
the PHSC confirms the receipt of the appropriate OKey. The same rule applies
before OK ey could be allowed to reach the respective ReqGW .
After seeing the commit payment notification from the PHSC, the P roGW
then encrypts its OKeyP roGw and submit it to the ReqGW anonymously via
the PHSC within the waiting time t:
T x =M SIDReqGwP ub (OKeyP r oGw) (10)
The PHSC credits the P roGW ’s account with the said Tokens and then
prompts the SmGW to sends two messages. The first message is a certifica-
tion message submitted to ReqGW . The message includes the OKeyP r oGW
and ContractHash encrypted with the ReqGW ’s shared T S Key. The second
message is credit confirmation message which includes the amount of the To-
ken credited, and the ContractHash. The message is submitted to P r oGW
encrypted with P roGW ’s shared T S Key.
However, the P roGW can simply ignore the commit payment notification
without replying with its OKey if the seller no longer intends to sell the owner-
ship key. Thus, after the period tt0is achieved, then the PHSC will refund the
ReqGW and then prompt the SmGW to send a transaction cancellation notifi-
cation to the P roGW . The SmGW also sends another message to P roGW to
confirm if it wants to withdraw its bids from the SMP. If the P roGW confirm
yes, then all its bids will be dismissed from the auction board and a trading
withdrawal notification will be submitted to the P roGW . Else, the bids will
remain available to the buyers.
20
5. Security analysis
The goal of this section is to demonstrate that the proposed model is pro-
tected under the given adversary model. Theorems 1 and 3 are for ownership
based double-spending, while theorem 2 is applied to token based double spend-
ing. Similarly, the security analysis is proven to be effective under practical time
advantage and average computing power. This is to say that, the solution is
effective within the assumed time benefit given to an adversary that has aver-
age processing power over the trustworthy nodes. Below are the main security
assessments.
Theorem 1. The system is immune to a malicious P roGW who intend to
use-up or not to deliver resource(s) to the ReqGW after receiving payment.
Proof. After resource OKey request submission to the concerned RP, the RP
verifies and activates a lock on the said resource amount. This will make the
P roGW to temporary lost control of the resource as soon as he receives the
OKey of the said resource. Besides, the payment will be confirmed after the
P roGW released its OK ey within a given waiting time t. This is to prevent
the malicious P roGW from intending to use or not to release the purchased
resource after receiving his payment. Furthermore, the P roGW loses complete
control of the resources as soon as he releases his OKey within the given waiting
time tand the payment will be confirmed after. The payment is given as:
P roGWpayment =P H SC (OKeyP roGW ).t t0(11)
The payment is reversed to the payer and the transaction void if tt0,
where t0is the maximum waiting time. This is ensured by the PHSC. P roGW
may withdraw from the market and gain full custodial control of his remaining
resources (if applicable) after the system confirms and balances all pending
transactions.
Theorem 2. A malicious consumer (ReqGW ) cannot receive any resources
locked by relevant OKey without paying the respective producer (P r oGW ) nor
21
can he spend digital token more than one time in the system.
Proof. Even if the malicious ReqGW intend to compromise the agreed deal
by not paying the requested fee, the PHSC will not allow the passage of the
P roGW ’s OK ey until it confirms the release of the agreed fund from the con-
cerned ReqGW . The ownership key release is given as:
ReqGWrelease =P H SC (T okenReqGW ).t t0(12)
The order is reversed to the seller and the transaction void if tt0. In
addition, the proposed model imposes a principle that only previously unused
transaction outputs can be used as inputs for new transactions. A validat-
ing authority node verifies this principle while disseminating transactions by
traversing and tracking the whole of their local blockchain copy.
Theorem 3. The system can prevent attacker to spend ownership over submit-
ted tender of resources more than one time within practical time advantage and
average computing power.
Proof. To prevent double spending on resource tender T(R) ownership, the RP
”locks” T(R) with a unique ownership secret key OKeyP roGw , and reply with a
copy of the key to the P roGW . These processes are carried out after the tender
is received by the RP. However, when the P roGW submit a selling request,
the SmGW contact the concerned RP for verification of the P roGW ’s claimed
T(R). The RP verifies the claim and replies to SmGW with verification results
accordingly.
If the T(R) is legitimate and not being used, the SmGW replies with a TGP
message to the potential P roGW and it will be allowed to submit its bids in
the auction board. Otherwise, it will be denied access and the T(R) will be
discarded. These processes are used to prove P roGWj’s identity and ownership
over T(Rj). Unique values (Okey and N once) also prevents adversaries from
spoofing P r oGWj’s identity.
22
6. TESTING AND EVALUATION
This section presents an experimental analysis of our model. The resilience
of the proposed model is tested and assessed against double spending attacks
on the basis of partial progress towards block production, which is driven
by time advantage and average computing power. In addition, a simulation-
based analysis and comparison of the proposed model was carried out to de-
termine the level of performance of our smart contract based on its computa-
tional overhead and latency of transactions compared to other existing mod-
els. The smart contract of our proposed scheme was deployed on the virtual
blockchain. The contract deployment transaction details is also available in
Etherscan: https://rinkeby.etherscan.io, and the deployment results/details is
provided in Figure 5 which include the gas consumption and transaction cost of
the contract deployment.
The proposed model was implemented using Solidity Language. Experiments
were conducted using the Metamask [38] Ethereum wallet and chrome plugin.
The proposed model is design on the basis of PoA consensus algorithm, as
a result PoA based Rinkeby testnet [39] was used to alternatively mimic the
blockchains ledger and the testing network. Using this testnet, the real-world
situation can be replicated efficiently. Performance comparison of the proposed
solution is provided against Aitzhan et al [6] and Dorri et al [9], and they were
implemented using the same setup scenario to have better observations and
readings of the experiment.
During the implementation of the smart contract, the smart gateways are
represented as mappings from the Ethereum address of the nodes to objects
containing information about the participating entities. The Ethereum address
of the contract owner (manager) was initialized during smart contract deploy-
ment. The owner holds the highest authority (private network administration)
and has access to all features of the framework. Furthermore, we registered and
mapped thirty (30) different Ethereum addresses to characterize smart home
gateways (P roGW and Req GW ) in the system, which are later allowed to
23
Figure 5: Smart contract deployment results.
interact with each other in the SM P . MetaMask is switched to the appro-
priate Ethereum account each time P roGW wants to make tender submission
or ReqGW wants to perform trading. Events with enough information were
conducted to observe the performance of each process. Several scenarios had
been checked to verify the logic of the smart contract code. The proposed smart
contract was analyzed using the Oyente smart contract security analysis tool
[36]. Results show that the smart contract is free from established security vul-
nerabilities [37] such Reentrancy, Timestamp dependence, Transaction depen-
dency, and Parity multisig bug with 53% EVM Code Coverage. The codes of
this work is available in GitHub repository (https://github.com/sysbel07/Multi-
Commodity-Trading-scheme-with-many-smart-marketplace-SMP-participants) for
public usage.
The following subsections provide performance evaluation of the proposed
model in terms of resilience against double spending attack, computational over-
head and transaction latency. The double spending attack evaluation process
involves testing the system’s likelihood towards the attack. The evaluation was
based on partial progress towards block production in the blockchain [11]. The
computational overhead evaluation is based on execution gas and transaction
gas consumed by the system during function call operations. The execution gas
is defined as the metric for measuring the cost for smart contract implementa-
tion. Whereas the transaction gas includes the cost of implementing and adding
the contract to the blockchain. The transaction latency is another parameter
24
used in the evaluation, it is usually described as the measure of how long trans-
action messages take. The parameters are based on the average or percentile of
the latency over a sample number of transaction messages [40].
6.1. Double spending attack mitigation evaluation
This section outlines experimental findings obtained following the launch
of token and ownership based double spending attacks on the proposed SMP
network. The experiment was implemented using Python 3 programming lan-
guage. The experimental results presented in this section are compared against
the benchmark techniques. The recorded number of blocks during our SM P
implementations and their generation times where used as our inputs to this
experiment.
Similar arbitrary time advantages (from 0 to 100 seconds) were used for all
the test subjects. Our results show that the likelihood of a double-spending at-
tack increases with an increase in the time benefit or the power of the adversary.
Also, it can be observed from Figure 6(a to e) that double-spending attacks are
very rare if there is a limited time advantage to the adversary. The above situ-
ations might be as a result of representing the possibility of a double spending
attack as the likelihood of a time disadvantage of tseconds before a K+ 1 blo ck
is mined multiply by the likelihood of keeping up with that disadvantage.
However, from Figure 6(d and e), our proposed model proves to be promis-
ing even with 40 - 50 percent of the computing power belongs to the adversary.
This is due to the various non-repeated sessional IDs used based on Bitmessage
techniques and the ability of our PHSC to track every single token spent during
each transaction. Moreover, to provide a detailed understanding of how the
double spending behaves, the graphs are presented under five separate scenar-
ios, namely q = 10%, 20%, 30%, 40% and 50% as shown in Figure 6(a to e)
respectively.
The experiment revealed that both [6] and [9] are not completely successful
in addressing double spending attacks (Figure 6(a to e)). The major advantage
of the proposed SMRT model is that it provides a OTMMRT facility and also
25
(a) blockchain-based double spending probability
based on the time benefit, given q=10%.
(b) blockchain-based double spending probability
based on the time benefit, given q=20%.
(c) blockchain-based double spending probability
based on the time benefit, given q=30%.
(d) blockchain-based double spending probability
based on the time benefit, given q=40%.
(e) blockchain-based double spending probability
based on the time benefit, given q=50%.
Figure 6: Double spending attack mitigation evaluation
26
manage to reduce the risk of double spending attacks.
(a) Average transaction cost of the
frameworks.
(b) Average execution cost of the
frameworks.
(c) Average transaction latency of
the frameworks.
Figure 7: Computational overhead and transaction latency.
6.2. Computational overhead and transaction latency
Practically, once an Ethereum blockchain transaction is made, Ethers are
charged as gas. In Ethereum, the computational overhead is measured based
on the amount of gas consumption by a system [40]. In this model, we simu-
lated several potential OT M M RT scenarios, and compared the results of the
proposed SMRT model with the benchmark models [6] and [9]. The transaction
27
and execution gas consumption are shown in Figure 7(a and b) for the overall
system operations, respectively. These results show that gas consumption in
SMRT is least effected by the increase in the number of participants in SMP
compared to existing schemes. It is because we avoid the use of clustering algo-
rithm that involves more computations in the development of smart contracts;
since using these practice creates more and unnecessary gas consumption in the
system [40].
Additionally, the transaction latency of our proposed system is recorded,
measured, and compared to that of benchmark works. Transaction latency in
our approach was measured using a background timer application that runs
during transaction execution. Time is measured based on the system proces-
sor clock and depends on the current processor schedule. It is observed from
Figure 7c that our proposed model shows less transaction latency as the num-
ber of participants increases in the SM P as compared to [6] and [9]. This is
consistent with the fact that the overall block time for validation is less than 8
seconds in our framework according to Etherscan. While validation of a mes-
sage block in both [6] and [9] takes approximately up to 15 seconds. In addition,
techniques [6] and [9] appear to be more pronounced than our approach. This
was because the techniques drive their prevalence by depending on a central or
semi-centric controller using PoW consensus mechanism, reuse of keys/IDs and
broad encryption/decryption processes. While in our proposed approach, the
PoA chains are maintained by trusted parties, keys/IDs are sessional and the
process uses a speed-up encryption/decryption mechanism.
7. Conclusion
The study proposed a blockchain-based semi-decentralized multi-resource
trading model named SMRT. Multiple scenarios were created to gauge the fea-
sibility of multiple parallel trading interactions. An adversary model was devel-
oped to quantify the effect of double spending attack on the proposed model.
Our findings indicate that double spending attack becomes a significant risk once
28
an adversary has ample time advantage towards bogus block production with
adequate computing power. Besides, SMRT demonstrates to be more promising
in OTMMRT trading scenarios and at the same time deals with double spend-
ing attack at a low computational cost and has minimal transaction latency as
compared to the benchmark techniques. Compared to the existing trading mod-
els, it has been noted that SMRT not only provides protection against double
spending attacks, but also offers a reduction of up to 50% in its computational
overhead.
Due to the transparency of blockchain, participants may be subject to the
disclosure of confidential information, such as the identity of the participant and
details of transactions carried out during trading process. As a result, ensuring
the privacy of participants becomes a challenging task in most blockchain-based
trading models. In the future, we intend to propose a model to address issues
related to privacy of the participant in a blockchain-based trading model.
References
[1] K. Gai, Y. Wu, L. Zhu, M. Qiu, and M. Shen, ”Privacy-preserving energy
trading using consortium blockchain in smart grid,” IEEE Trans. Ind. In-
formatics, 2019
[2] B. Krishnamachari, J. Power, S. H. Kim, and C. Shahabi, ”I3: An IoT
Marketplace for Smart Communities,” pp. 9–10, 2018.
[3] Y. Wu, X. Tan, L. Qian, D. H. K. Tsang, W. Z. Song, and L. Yu, ”Optimal
pricing and energy scheduling for hybrid energy trading market in future
smart grid,” IEEE Trans. Ind. Informatics, vol. 11, no. 6, pp. 1585–1596,
2015.
[4] A. Reyna, C. Mart´ın, J. Chen, E. Soler, and M. D´ıaz, ”On blockchain and its
integration with IoT. Challenges and opportunities,” Futur. Gener. Comput.
Syst., vol. 88, no. 2018, pp. 173–190, 2018.
29
[5] M. Banerjee, J. Lee, and K. K. R. Choo, ”A blockchain future for internet
of things security: a position paper,” Digit. Commun. Networks, vol. 4, no.
3, pp. 149–160, 2018.
[6] N. Z. Aitzhan and D. Svetinovic, ”Security and Privacy in Decentralized En-
ergy Trading Through Multi-Signatures, Blockchain and Anonymous Mes-
saging Streams,” IEEE Trans. Dependable Secur. Comput., vol. 15, no. 5,
pp. 840–852, 2018.
[7] S. Paris, F. Martisnon, I. Filippini, and L. Clien, ”A bandwidth trading
marketplace for mobile data offloading,” in Proceedings - IEEE INFOCOM,
2013, pp. 430–434.
[8] R. Bhatia, J. Chuzhoy, A. Freund, and J. (Seffi) Naor, ”Algorithmic aspects
of bandwidth trading,” ACM Trans. Algorithms, vol. 3, no. 1, p. 10, 2007.
[9] A. Dorri, F. Luo, S. S. Kanhere, R. Jurdak, and Z. Y. Dong, ”SPB: A se-
cure private blockchain-based solution for distributed energy trading,” IEEE
Commun. Mag., vol. 57, no. 7, pp. 120–126, 2019.
[10] X. Li, R. Lu, X. Liang, X. Shen, J. Chen, and X. Lin, ”Smart community:
An internet of things application,” IEEE Communications Magazine, vol.
49, no. 11, pp. 68–75, 2011.
[11] C. Pinz´on and C. Rocha, ”Double-spend Attack Models with Time Ad-
vantange for Bitcoin,” Electron. Notes Theor. Comput. Sci., vol. 329, pp.
79–103, 2016.
[12] C. C. Lin, D. J. Deng, C. C. Kuo, and Y. L. Liang, ”Optimal Charging
Control of Energy Storage and Electric Vehicle of an Individual in the In-
ternet of Energy With Energy Trading,” IEEE Trans. Ind. Informatics, vol.
14, no. 6, pp. 2570–2578, 2018.
[13] W. Tushar et al., ”A motivational game-theoretic approach for peer-to-peer
energy trading in the smart grid,” Appl. Energy, vol. 243, no. November
2018, pp. 10–20, 2019.
30
[14] W. Tushar et al., ”Three-Party Energy Management with Distributed En-
ergy Resources in Smart Grid,” IEEE Trans. Ind. Electron., vol. 62, no. 4,
pp. 2487–2498, 2015.
[15] W. Tushar, C. Yuen, H. Mohsenian-Rad, T. Saha, H. V. Poor, and K. L.
Wood, ”Transforming energy networks via peer-to-peer energy trading: The
potential of game-theoretic approaches,” IEEE Signal Process. Mag., vol.
35, no. 4, pp. 90–111, 2018.
[16] V. Buterin, ”Ethereum White Paper,” Etherum, 2014.[Online Available]:
http://buyxpr.com/build/pdfs/EthereumWhitePaper.pdf.
[17] S. Aggarwal, R. Chaudhary, G. S. Aujla, N. Kumar, K. K. R. Choo, and
A. Y. Zomaya, ”Blockchain for smart communities: Applications, challenges
and opportunities,” Journal of Network and Computer Applications, vol.
144. pp. 13–48, 2019.
[18] M. R. Alam, M. St-Hilaire, and T. Kunz, ”Peer-to-peer energy trading
among smart homes,” Appl. Energy, vol. 238, no. January, pp. 1434–1443,
2019.
[19] T. Sousa, T. Soares, P. Pinson, F. Moret, T. Baroche, and E. Sorin, ”Peer-
to-peer and community-based markets: A comprehensive review,” Renew-
able and Sustainable Energy Reviews. pp. 367–378, 2019.
[20] D. M. and M.- ´
A. M.-C. Ramon Alcarria, Borja Bordel, Tom´as Robles, ”A
Blockchain-Based Authorization System for Trustworthy Resource Monitor-
ing and Trading in Smart Communities,” Sensors (Switzerland), no. Octo-
ber, pp. 1–30, 2018.
[21] C. RUSSO, ”DENT: A Blockchain Marketplace for Unused Mo-
bile Data,” 2018. [Online Available]: https://sludgefeed.com/
dent-tokenizing-the-mobile-data-industry/. [Accessed: 29-Apr-
2019].
31
[22] I. Makhdoom, I. Zhou, M. Abolhasan, J. Lipman, and W. Ni, ”PrivyShar-
ing: A blockchain-based framework for privacy-preserving and secure data
sharing in smart cities,” Comput. Secur., vol. 88, p. 101653, 2020.
[23] B. Yang and H. Garcia-Molina, ”PPay: Micropayments for peer-to-peer
systems,” in Proceedings of the ACM Conference on Computer and Com-
munications Security, 2003, no. Section 3, pp. 300–310.
[24] R. Xu, Y. Chen, E. Blasch, and G. Chen, ”BlendCAC: A BLockchain-
ENabled Decentralized Capability-based Access Control for IoTs,” pp. 1–27,
2018.
[25] K. Wei, Y. F. R. Chen, A. J. Smith, and B. Vo, ”WhoPay: A scalable and
anonymous payment system for peer-to-peer environments,” in Proceedings
- International Conference on Distributed Computing Systems, 2006.
[26] L. Zhang, L. Zhao, S. Yin, C. H. Chi, R. Liu, and Y. Zhang, ”A lightweight
authentication scheme with privacy protection for smart grid communica-
tions,” Futur. Gener. Comput. Syst., vol. 100, pp. 770–778, 2019.
[27] I. Osipkov, E. Y. Vasserman, N. Hopper, and K. Yongdae, ”Combating
double-spending using cooperative P2P systems,” in Proceedings - Interna-
tional Conference on Distributed Computing Systems, 2007.
[28] I. Stoica, R. Morris, D. Karger, M. F. Kaashoek, and H. Balakrishnan,
”Chord,” Proc. ACM SIGCOMM ’01 Conf., pp. 149–160, 2001.
[29] J. H. Hoepman, ”Distributed double spending prevention,” in Lecture
Notes in Computer Science (including subseries Lecture Notes in Artificial
Intelligence and Lecture Notes in Bioinformatics), 2010, vol. 5964 LNCS,
pp. 152–165. Hoepman,Niu,SAggarwal
[30] C. Niu, Z. Zheng, F. Wu, X. Gao, and G. Chen, ”Achieving Data Truthful-
ness and Privacy Preservation in Data Markets,” IEEE Trans. Knowl. Data
Eng., vol. 31, no. 1, pp. 105–119, 2019.
32
[31] S. Aggarwal, R. Chaudhary, G. S. Aujla, A. Jindal, A. Dua, and N. Kumar,
”EnergyChain,” in SmartCitiesSecurity’18, June 25, 2018, Los Angeles, CA,
USA, 2018, no. June, pp. 1–6.
[32] C. Blockchain, ”Merkle tree — necessity or atavism?,”
Medium. [Online Available]: https://medium.com/@credits/
merkle-tree-necessity-or-atavism-d8ff3e263131.
[33] J. Warren, ”Bitmessage: A Peer-to-Peer Message Authentication and
Delivery System,” white Pap. (27 Novemb. 2012), https//bitmessage.
org/bitmessage. pdf, 2012.
[34] A. Agrawal, ”Bitmessage: Communication from scratch,” Finextra, 2013.
[Online Available]: https://www.finextra.com/blogs/fullblog.aspx?
blogid=7920. [Accessed: 06-Oct-2010].
[35] C. Paar and J. Pelzl, Understanding cryptography a textbook for students
and practitioners. 2013.
[36] L. Luu, D. H. Chu, H. Olickel, P. Saxena, and A. Hobor, ”Making smart
contracts smarter,” in Proceedings of the ACM Conference on Computer
and Communications Security, 2016, vol. 24-28-October-2016, pp. 254–269.
[37] P. Praitheeshan, L. Pan, J. Yu, J. Liu, and R. Doss, ”Security Analysis
Methods on Ethereum Smart Contract Vulnerabilities: A Survey,” pp. 1–21,
2019.
[38] Metamask, ”Brings Ethereum to your browser,” Metamask Chrome exten-
tion, 2019. [Online Available]: https://metamask.io/.
[39] Rinkeby, ”Transaction Details,” 2019. [Online
Available]: https://rinkeby.etherscan.io/tx/
0xe685f0ea29afce5d5a86265e87416be613dd36878570ddd71e49cd9d6444f263.
[Accessed: 15-May-2019].
[40] G. Wood, ”Ethereum: a secure decentralised generalised transaction ledger
(yellow paper) 2017,” Ethereum Proj. Yellow Pap., 2014.
33
... The evolution of sensor-enabled smart gateways in smart homes has led to creative collaboration practices among participants of smart communities [1]. Such collaborations involve the exchange of resources (such as water, internet bandwidth, energy) in the form of trading, where a participant may request resources from other participants in exchange of a digital currency, such as ether [1,2]. ...
... The evolution of sensor-enabled smart gateways in smart homes has led to creative collaboration practices among participants of smart communities [1]. Such collaborations involve the exchange of resources (such as water, internet bandwidth, energy) in the form of trading, where a participant may request resources from other participants in exchange of a digital currency, such as ether [1,2]. This type of trading platform is also known as a smart marketplace (SMP) [1,3]. ...
... Such collaborations involve the exchange of resources (such as water, internet bandwidth, energy) in the form of trading, where a participant may request resources from other participants in exchange of a digital currency, such as ether [1,2]. This type of trading platform is also known as a smart marketplace (SMP) [1,3]. SMP, as a resource trading platform, faces a range of privacy-and security-related challenges, such as vulnerability and controller compromise, which are addressed through authentication-and cryptography-based solutions in the literature [4][5][6]. ...
Article
Full-text available
With the innovation of embedded devices, the concept of smart marketplace came into existence. A smart marketplace is a platform on which participants can trade multiple resources, such as water, energy, bandwidth. Trust is an important factor in the trading platform, as the participants would prefer to trade with those peers who have a high trust rating. Most of the existing trust management models for smart marketplace only provide a single aggregated trust score for a participant. However, they lack the mechanism to gauge the level of commitment shown by a participant while trading a particular resource. This work aims to provide a fine-grained trust score for a participant with respect to each resource that it trades. Several parameters, such as resource availability, success rate, and turnaround time are used to gauge the participant’s level of commitment, specific to the resource being traded. Moreover, the effectiveness of the proposed model is validated through security analysis against ballot-stuffing and bad-mouthing attacks, along with simulationbased analysis and a comparison in terms of accuracy, false positive, false negative, computational cost and latency. The results indicate that the proposed trust model has 7% better accuracy, 30.13% lower computational cost and 31.74% less latency compared to the existing benchmark model.
... New technical advances in the usage of blockchain technologies would offer a realistic and workable process to achieve agricultural goods traceability and remove the need for a reliable centralized controller (Fernández-Caramés & Fraga-Lamas, 2018). Blockchain technology has increased in prominence, which is why it strengthens trust between stakeholders through transparency and immutability of transactions within the supply chain and the logistics ecosystem (Waleed et al., 2021;Yakubu et al., 2021b). As it is trustworthy, secure, traceable, and tamper-proof, blockchain can be used satisfactorily in management of the agricultural and food supply chain (Leng et al., 2018;Lin et al., 2020). ...
Article
Full-text available
The increasing number of rice product safety issues and the potential for contamination have established an enormous need for an effective strategy for the traceability of the rice supply chain. Tracing the origins of a rice product from raw materials to end customers is very complex and costly. Existing food supply chain methods (for example, rice) do not provide a scalable and cost-effective means of agricultural food supply. Besides, consumers lack the capability and resources required to check or report on the quality of agricultural goods in terms of defects or contamination. Consequently, customers are forced to decide whether to utilize or discard the goods. However, blockchain is an innovative framework capable of offering a transformative solution for the traceability of agricultural products and food supply chains. The aim of this paper is to propose a framework capable of tracking and monitoring all interactions and transactions between all stakeholders in the rice chain ecosystem through smart contracts. The model incorporates a system for customer satisfaction feedback, which enables all stakeholders to get up-to-date information on product quality, enabling them to make more informed supply chain decisions. Each transaction is documented and stored in the public ledger of the blockchain. The proposed framework provides a safe, efficient, reliable, and effective way to monitor and track rice products safety and quality especially during product purchasing. The security and performance analysis results shows that the proposed framework outperform the benchmark techniques in terms of cost-effectiveness, security and scalability with low computational overhead.
... New technical advances in the usage of blockchain technologies would offer a realistic and workable process to achieve agricultural goods traceability and remove the need for a reliable centralized controller (Fernández-Caramés & Fraga-Lamas, 2018). Blockchain technology has increased in prominence, which is why it strengthens trust between stakeholders through transparency and immutability of transactions within the supply chain and the logistics ecosystem (Waleed et al., 2021;Yakubu et al., 2021b). As it is trustworthy, secure, traceable, and tamper-proof, blockchain can be used satisfactorily in management of the agricultural and food supply chain (Leng et al., 2018;Lin et al., 2020). ...
Article
Full-text available
The increasing number of rice product safety issues and the potential for contamination have established an enormous need for an effective strategy for the traceability of the rice supply chain. Tracing the origins of a rice product from raw materials to end customers is very complex and costly. Existing food supply chain methods (for example, rice) do not provide a scalable and cost-effective means of agricultural food supply. Besides, consumers lack the capability and resources required to check or report on the quality of agricultural goods in terms of defects or contamination. Consequently, customers are forced to decide whether to utilize or discard the goods. However, blockchain is an innovative framework capable of offering a transformative solution for the traceability of agricultural products and food supply chains. The aim of this paper is to propose a framework capable of tracking and monitoring all interactions and transactions between all stakeholders in the rice chain ecosystem through smart contracts. The model incorporates a system for customer satisfaction feedback, which enables all stakeholders to get up-to-date information on product quality, enabling them to make more informed supply chain decisions. Each transaction is documented and stored in the public ledger of the blockchain. The proposed framework provides a safe, efficient, reliable, and effective way to monitor and track rice products safety and quality especially during product purchasing. The security and performance analysis results shows that the proposed framework outperform the benchmark techniques in terms of cost-effectiveness, security and scalability with low computational overhead.
... The sensor nodes are resource constrained and have no computational power to send data over a large area. In [47,48], IoST uses WSNs for storing the data. However, WSNs are resource constrained. ...
Article
Full-text available
In this paper, a blockchain based secure routing model is proposed for the Internet of Sensor Things (IoSTs). The blockchain is used to register the nodes and store the data packets' transactions. Moreover, the Proof of Authority (PoA) consensus mechanism is used in the model to avoid the extra overhead incurred due to the use of Proof of Work (PoW) consensus mechanism. Furthermore, during routing of data packets, malicious nodes can exist in the IoSTs network, which eavesdrop the communication. Therefore, the Genetic Algorithm based Support Vector Machine (GA-SVM) and Genetic Algorithm based Decision Tree (GA-DT) models are proposed for malicious node detection. After the malicious node detection, Dijkstra algorithm is used to find the optimal routing path in the network. The simulation results show the effectiveness of the proposed model. PoA is compared with PoW in terms of the transaction cost in which PoA has consumed 30% less cost than PoW. Furthermore, without Man In The Middle (MITM) attack, GA-SVM consumes 10% less energy than with MITM attack. Moreover, without any attack, GA-SVM consumes 30% less than grayhole attack and 60% less energy than mistreatment. The results of Decision Tree (DT), Support Vector Machine (SVM), GA-DT and GA-SVM are compared in terms of accuracy and precision. The accuracy of DT, SVM, GA-DT and GA-SVM is 88%, 93%, 96% and 98%, respectively. The precision of DT, SVM, GA-DT and GA-SVM is 100%, 92%, 94% and 96%, respectively. In addition, the Dijkstra algorithm is compared with Bellman Ford algorithm. The shortest distances calculated by Dijkstra and Bellman are 8 and 11 hops long, respectively. Also, security analysis is performed to check the smart contract's effectiveness against attacks. Moreover, we induced three attacks: grayhole attack, mistreatment attack and MITM attack to check the resilience of our proposed system model.
... Furthermore, SMG verifies the potential seller's claim of bandwidth ownership from the respective Telcom SP before allowing it to participate in the SMP. Similarly, the SMG notifies the respective Telcom SP whenever a payment is made in order to remove the seller's complete ownership of the said amount of bandwidth [17]. ...
Conference Paper
Full-text available
Internet broadband usage is increasing dramatically as the number of Internet of Things (IoT) devices in smart homes that rely on Internet connectivity for effective communication between them grows. As a result, many network and Internet communication issues arise, including network traffic congestion, insecurity, high connection rates, and excess bandwidth waste. This work aims to create a secure and decentralized smart marketplace (SMP) for a fair, transparent, robust, and less expensive way of trading excess or idle traffic from a smart home by directly paying the owner of the bandwidth. The internet bandwidths may initially come from a direct Tel-com product or from other users (smart homeowners) who decide to sell their excess Internet bandwidth. The research was carried out by integrating a given smart marketplace scenario with blockchain technology using proof-of-authority (PoA) consensus mechanism. The simulation results show that the model is more reliable and appears to be an efficient solution to dealing with excess bandwidth waste and offering safe excess bandwidth trading within a smart city. Besides, the excess bandwidth wastage is controlled at least by 75% by making it available in the SMP for buyers.
Article
Blockchain technology is at the peak of hype and contemporary research area across the world. It is a distributed ledger that keeps records of transactions with verifiable and immutable structures and continuously grows with the new block of transactions. Blockchain provides better transparency, enhanced security and privacy, and true traceability over the traditional approaches. Due to its advanced and secure features, it is being used in various fields such as trade finance, digital transactions, the Internet of Things (IoT), the healthcare industry, and energy sector. Blockchain technology has a great impact in all its applied fields with the prominent features of privacy and reliability of data and transactions. This survey intends to present the architecture of blockchain, its potential applications, and practices in different domains other than cryptocurrency along with the platform of blockchain. This paper will explore some potential benefits of blockchain and some future directions and open challenges that are expected to come in future research.
Article
Full-text available
The ubiquitous use of Internet of Things (IoT) ranges from industrial control systems to e-Health, e-commerce, smart cities, agriculture, supply chain management, smart cars, cyber-physical systems and a lot more. However, the data collected and processed by IoT systems especially the ones with central- ized control are vulnerable to availability, integrity, and privacy threats. Hence, we present “PrivyShar- ing,” a blockchain-based innovative framework for privacy-preserving and secure IoT data sharing in a smart city environment. The proposed scheme is distinct from existing strategies on many aspects. The data privacy is preserved by dividing the blockchain network into various channels, where every chan- nel comprises a finite number of authorized organizations and processes a specific type of data such as health, smart car, smart energy or financial details. Moreover, access to users’ data within a channel is controlled by embedding access control rules in the smart contracts. In addition, data within a channel is further isolated and secured by using private data collection and encryption respectively. Likewise, the REST API that enables clients to interact with the blockchain network has dual security in the form of an API Key and OAuth 2.0. The proposed solution conforms to some of the significant requirements outlined in the European Union General Data Protection Regulation. We also present a system of reward in the form of a digital token named “PrivyCoin” for users sharing their data with stakeholders/third parties. Lastly, the experimental outcomes advocate that a multi-channel blockchain scales well as compared to a single-channel blockchain system.
Article
Full-text available
Peer-to-peer trading in energy networks is expected to be exclusively conducted by the prosumers of the network with negligible influence from the grid. This raises the critical question: how can enough prosumers be encouraged to participate in peer-to-peer trading so as to make its operation sustainable and beneficial to the overall electricity network? To this end, this paper proposes how a motivational psychology framework can be used effectively to design peer-to-peer energy trading to increase user participation. To do so, first, the state-of-the-art of peer-to-peer energy trading literature is discussed by following a systematic classification, and gaps in existing studies are identified. Second, a motivation psychology framework is introduced, which consists of a number of motivational models that a prosumer needs to satisfy before being convinced to participate in energy trading. Third, a game-theoretic peer-to-peer energy trading scheme is developed, its relevant properties are studied, and it is shown that the coalition among different prosumers is a stable coalition. Fourth, through numerical case studies, it is shown that the proposed model can reduce carbon emissions by 18.38% and 9.82% in a single day in Summer and Winter respectively compared to a feed-in-tariff scheme. The proposed scheme is also shown to reduce the cost of energy up to 118 ¢ and 87 ¢ per day in Summer and Winter respectively. Finally, how the outcomes of the scheme satisfy all the motivational psychology models is discussed, which subsequently shows its potential to attract users to participate in energy trading.
Article
Full-text available
Resource consumption in residential areas requires novel contributions in the field of consumer information management and collaborative mechanisms for the exchange of resources, in order to optimize the overall consumption of the community. We propose an authorization system to facilitate access to consumer information and resource trading, based on blockchain technology. Our proposal is oriented to the Smart communities, an evolution of Community Energy Management Systems, in which communities are involved in the monitoring and coordination of resource consumption. The proposed environment allows a more reliable management of monitoring and authorization functions, with secure data access and storage and delegation of controller functions among householders. We provide the definition of virtual assets for energy and water resource sharing as an auction, which encourages the optimization of global consumption and saves resources. The proposed solution is implemented and validated in application scenarios that demonstrate the suitability of the defined consensus mechanism, trustworthiness in the level of provided security for resource monitoring and delegation and reduction on resource consumption by the resource trading contribution.
Article
Blockchain is increasingly being used to provide a distributed, secure, trusted, and private framework for energy trading in smart grids. However, existing solutions suffer from a lack of privacy, processing and packet overheads, and reliance on trusted third party (TTP) to secure the trade. To address these challenges, we propose a secure private blockchain (SPB) framework. SPB enables energy producers and consumers to directly negotiate the energy price. To reduce the associated overheads, we propose a routing method which routes packets based on the destination public key (PK). SPB eliminates the reliance on TTP to ensure both energy producer and consumer commit to their obligations by introducing atomic meta-transactions. The latter consists of two transactions: first the consumer generates a CTP transaction, committing to pay the energy price to the producer. On receipt of the energy, the smart meter of the consumer generates an energy receipt confirmation (ERC) which triggers a smart contract to transfer the committed price in CTP to the energy producer. To verify that the ERC is generated by a genuine smart meter, SPB supports authentication of anonymous smart meters to prevent malicious nodes from linking ERC transactions and thus enhance the user privacy. Qualitative security analysis shows the resilience of SPB against a range of attacks. Implementation results demonstrate that SPB reduces monetary cost and delay compared to existing solutions.
Article
Since the success of Bitcoin, there have been increased focus of studying the application of blockchain in a broad range of applications, such as in solutions facilitating identity privacy and transaction security using a decentralized architecture via different consensus mechanisms (e.g. proof-of-work) between different geo-located IoT devices / nodes in our increasingly digitalized society (e.g. smart city). In this paper, we survey the usage of blockchain technology for smart communities, focusing on key components of the blockchain applications. We also study the various process models used in the execution of secure transactions. Specifically, we present a detailed taxonomy on the applications, process models used, and communication infrastructure support needed to execute various applications.
Article
In smart grid, the “smartness” usually comes from the two-way communication between the utility and its users as well as the sensing along the transmission lines. As a result, securing grid data that are transmitted over public network has always been one big challenge. Different authentication schemes have been proposed to address this security problem. However, most of them still suffer from privacy and/or performance issues. In this paper, we propose a lightweight anonymous authentication and key agreement scheme for smart grid, which allows the smart meter and the service provider to authenticate each other and establish a shared session key between them. Compared with existing authentication solutions for smart grid, it achieves fast mutual authentication between the smart meter and the service provider while ensuring the smart meter anonymity and untraceability. We evaluate the proposed scheme using Real-or-Random Oracle Model as well as the actual hardware prototype implementation. The results show that our proposed scheme can outperform the state-of-the art schemes in terms of the performance overhead while ensuring privacy protection.
Article
The advent of more proactive consumers, the so-called “prosumers”, with production and storage capabilities, is empowering the consumers and bringing new opportunities and challenges to the operation of power systems in a market environment. Recently, a novel proposal for the design and operation of electricity markets has emerged: these so-called peer-to-peer (P2P) electricity markets conceptually allow the prosumers to directly share their electrical energy and investment. Such P2P markets rely on a consumer-centric and bottom-up perspective by giving the opportunity to consumers to freely choose the way they buy their electric energy. A community can also be formed by prosumers who want to collaborate, or in terms of operational energy management. This paper contributes with an overview of these new P2P markets that starts with the motivation, challenges, market designs moving to the potential future developments in this field, providing recommendations while considering a test-case.
Article
This paper evaluates the impact of Peer-to-Peer (P2P) energy trading among the smart homes in a microgrid. Recent trends show that the households are gradually adopting renewables (e.g., photovoltaics) and energy storage (e.g., electric vehicles) in their premises. This research addresses the energy cost optimization problem in the smart homes which are connected together for energy sharing. The contributions of this paper is threefold. First, we propose a near-optimal algorithm, named Energy Cost Optimization via Trade (ECO-Trade), which coordinates P2P energy trading among the smart homes with a Demand Side Management (DSM) system. Our results show that, for real datasets, 99% of the solutions generated by the ECO-Trade algorithm are optimal solutions. Second, P2P energy trading in the microgrid potentially results in an unfair cost distribution among the participating households. We address this unfair cost distribution problem by enforcing Pareto optimality, ensuring that no households will be worse off to improve the cost of others. Finally, we evaluate the impact of renewables and storage penetration rate in the microgrid. Our results show that cost savings do not always increase linearly with an increase in the renewables and storage penetration rate. Rather they decrease gradually after a saturation point.
Article
Implementing blockchain techniques has enabled secure smart trading in many realms, e.g. neighboring energy trading. However, trading information recorded on the blockchain also brings privacy concerns. Attackers can utilize data mining algorithms to obtain users' privacy, specially, when the user group is located in nearby geographic positions. In this paper, we present a consortium blockchain-oriented approach to solve the problem of privacy leakage without restricting trading functions. The proposed approach mainly addresses energy trading users' privacy in smart grid and screens the distribution of energy sale of sellers deriving from the fact that various energy trading volumes can be mined to detect its relationships with other information, such as physical location and energy usage. Experiment evaluations have demonstrated the effectiveness of the proposed approach.
Preprint
As a significant business paradigm, many online information platforms have emerged to satisfy society's needs for person-specific data, where a service provider collects raw data from data contributors, and then offers value-added data services to data consumers. However, in the data trading layer, the data consumers face a pressing problem, i.e., how to verify whether the service provider has truthfully collected and processed data? Furthermore, the data contributors are usually unwilling to reveal their sensitive personal data and real identities to the data consumers. In this paper, we propose TPDM, which efficiently integrates data Truthfulness and Privacy preservation in Data Markets. TPDM is structured internally in an Encrypt-then-Sign fashion, using partially homomorphic encryption and identity-based signature. It simultaneously facilitates batch verification, data processing, and outcome verification, while maintaining identity preservation and data confidentiality. We also instantiate TPDM with a profile matching service and a distribution fitting service, and extensively evaluate their performances on Yahoo! Music ratings dataset and 2009 RECS dataset, respectively. Our analysis and evaluation results reveal that TPDM achieves several desirable properties, while incurring low computation and communication overheads when supporting large-scale data markets.