0% found this document useful (0 votes)
87 views10 pages

Paper 4-Modeling and Simulation of A Blockchain Consensus

This document discusses modeling and simulating a blockchain consensus mechanism for validating IoT node data. It begins with an introduction describing how blockchain provides a distributed ledger to authenticate data using consensus protocols. It then reviews related work on distributed consensus algorithms and different blockchain consensus approaches. The paper proposes a blockchain-based decentralized mechanism for authenticating IoT node data stored on a distributed ledger, using a colored Petri net to model and simulate the system based on a cyber-physical IoT architecture.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views10 pages

Paper 4-Modeling and Simulation of A Blockchain Consensus

This document discusses modeling and simulating a blockchain consensus mechanism for validating IoT node data. It begins with an introduction describing how blockchain provides a distributed ledger to authenticate data using consensus protocols. It then reviews related work on distributed consensus algorithms and different blockchain consensus approaches. The paper proposes a blockchain-based decentralized mechanism for authenticating IoT node data stored on a distributed ledger, using a colored Petri net to model and simulate the system based on a cyber-physical IoT architecture.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

(IJACSA) International Journal of Advanced Computer Science and Applications,

Vol. 13, No. 12, 2022

Modeling and Simulation of a Blockchain Consensus


for IoT Node Data Validation
Bismark Tei Asare1, Laurent Nana2, Kester Quist-Aphetsi3
Lab-STICC, CNRS UMR 6285, F-29200, Computer Science Dept, GCTU, Ghana
Cyber Security Division, CRITAC, Directorate of Info. Assurance & Intelligence Research, CRITAC, Ghana
Université de Bretagne Occidentale, UBO, Brest, France1
Lab-STICC, CNRS UMR 6285, F-29200, Université de Bretagne Occidentale, UBO, Brest, France2
Computer Science Dept, GCTU, Cyber Security Division, CRITAC, Ghana
Directorate of Info. Assurance & Intelligence Research, CRITAC, Ghana3

Abstract—The classical blockchain developed for the Bitcoin technologies in the hands of bad actors and hackers could
cryptocurrency has evolved since its introduction more than a render sophisticated cyber-attack exploitations to networks and
decade ago. Blockchain exists in different forms for different user accounts resulting in breaching data, corrupting data, and
purposes and operational contexts. There has been a significant compromising the security of such network systems [1].
growth in the business use cases of blockchain which is based on
the unique attributes of the distributed ledger technology. Reaching an agreement to validate messages as well as
Blockchain provides peer-to-peer distribution of data in a authenticate the state of a distributed ledger have been the
traceable and decentralized architecture that attains data requirement for networks whose major components are
authentication using consensus protocols. Blockchain as a resource constrained.
distributed ledger is the fusion of cryptography, peer-to-peer
networking technology, distributed system technology, and Distributed consensus research has become popular since
consensus mechanism to assure information security and digital the Nakamoto Satoshi introduced the Bitcoin blockchain
asset management. Consensus mechanisms are applied to the cryptocurrency more than a decade ago. Internet of things have
distributed ledger that operates in a peer-to-peer network where provided a platform for expanding the network resources to
message transmission between peers is validated and stored secure a new value proposition for scaling the scope of an
across all active peers. Reaching an agreement to validate enterprise‟s network. Available reports support that the
message transmission and maintaining the correctness of the technological and cybersecurity budgets for business and
state of data in a network for critical wireless sensor networks institutions have increased allocations and are making efforts to
have become a necessary requirement for networks that span include internet-of-things integration, expansion, and
several subsystems covering a large operational area. Due to the management [2].
resource constrained nature of the active actors of wireless sensor
networks, any cryptographic solution to be adopted must be Cybersecurity investments and the annual budgetary
lightweight and efficient as well. This paper proposes a allocations across most enterprises have increased largely due
blockchain-based decentralized mechanism for authentication of to the increasing number of cyber-attack incidences on
node data for storage onto a distributed ledger. The coloured enterprise systems which have resulted in data corruption, data
Petri net was used to model and simulate by detailing the critical theft and huge revenue losses in some cases [3].
attributes of the workings of the system that is based on cyber-
physical IoT architecture. During the COVID-19 lockdown period, most businesses
and institutions adopted telecommuting as a measure to
Keywords—Blockchain consensus; ripple consensus algorithm; regulate and manage people in observing physical distancing to
coloured petri net; cyber-physical system; IoT architecture; node avoid possible person-to-person infection. There were reported
data security cases of cyber-attacks during this period where personal and
enterprise data were breached as a result [4].
I. INTRODUCTION
Cascading effect of cyber-attacks on heterogeneous
Reaching agreements to validate the authenticity of node systems for wireless sensor networks like the internet of things
data and subsequent transmission and storage of such network has a wide and costly impact due to the critical messages that
resources for cyber-physical systems have been a challenging the resource-constrained devices in such networks transmit [5].
and interesting domain for academia and information security
industry players in recent times. Distributed ledgers use The effect of cyber-attacks on heterogeneous wireless
consensus algorithms to reach agreement among all connected sensor networks resulting in the compromise of critical data in
active nodes to validate message transmission in a peer-to-peer enterprise networks have taken an alarming trajectory due to
approach. Recent advancements in connectivity, artificial the complexity of the interconnectedness of the components of
intelligence, machine learning approaches although have the subsystems that make up the internet of things architecture
provided an advantage for the expansion of network coverage [6].
and prediction and visualization of network resource sharing
for enterprises and institutions, these available passive

22 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

Availability of pervasive applications and their integration In [10] a decentralized multi-agent system achieved
in enterprise networks that have most of its component relying consensus using consensus problem to control these multi-
on internet of things architecture could make the security agents. More than half of all the multi-agents and processes
management of such wireless sensor systems a complex agreed by voting on the state and integrity of a process.
challenge to undertake.
B. Blockchain Consensus Algorithm
A consensus algorithm for decentralized authentication and Blockchain as a cryptocurrency framework for Bitcoin has
distributed ledgers for an IoT with heterogeneous system evolved since its introduction. Blockchains are uniquely
architecture requires a blockchain-based agreement mechanism categorized based on the type of consensus algorithm in use. In
that operates with relatively less energy, fully scalable and a Proof-of-Work (PoW) consensus, agreement on the validity
most importantly byzantine fault-tolerant [7]. of a process was achieved using the computing power
Wireless sensor networks achieve privacy and integrity for challenge. The node that had more computing power achieved
message transmissions using either third-party trust consensus through a completely decentralized approach. There
enforcement systems that adopt a centralized entity to is Proof-of-Stake (PoS) consensus that is based on financial
authenticate devices and validate messages or a decentralized power competition where the node that controls more than a
mechanism for authentication of devices and validating third of all the resources within the network gets to validate
messages. The centralized authentication mechanism is prone processes within the blockchain. PoS operates by selecting
to several attacks including single point of failure attacks. In a validators to authenticate transactions within the blockchain
distributed system that rely on decentralized authentication based on the quantity of the cryptocurrency holdings forming a
mechanism, agreement is reached by all active nodes on the stake by a node. The more stake a node possesses the higher
network using consensus. Since the introduction of Bitcoin the chance of being selected to validate transactions. In a PoS,
cryptocurrency, several consensus algorithms have been less computational power is involved since it takes shorter time
developed. The Bitcoin cryptocurrency uses a distributed to reach consensus than in PoW. In Delegated Proof-of-Stake
consensus mechanism that is based on proof of work [8]. (DPoS), consensus is reached based on election and voting
process to guard malicious usage and centralization of
The Coloured Petri Net (CPN) is a modeling and blockchain. In DPoS, less computing power and time are
simulation tool for modeling and simulating systems, and involved in achieving consensus [11].
verifying their properties (real-time, behavioral, security
properties …). A consensus mechanism must provide a trade-off between
performance, fairness, and security. There is Proof-of-Activity
The CPN modeling, simulation, and validation of critical (PoA) that is a fusion of PoW and PoS. The PoA operated on
security properties of an efficient blockchain-based consensus an economic phenomenon with the assumption of “Tragedy of
mechanism that does not compromise the security requirements the Commons” which described a situation where a limited
of a cryptographic solution and offers low latency with resource for several agents could be ruined in situations where
improved resistance to the Byzantine fault tolerance is there is uncontrolled use [12].
presented by this paper.
C. Ripple Consensus Algorithm
The rest of the paper is structured in sections and
represented as follows. In Section II, related work describing The Ripple consensus algorithm is a permissioned
the state of the art for CPN in modeling and simulating security blockchain consensus algorithm that requires access
protocols for networks, node data security and critical security permission for nodes in the network because it is not publicly
challenges in cyber-physical systems is presented. In Section accessible, and operates in rounds using active nodes as
III, the Ripple consensus algorithm is described. Section IV servers. It adopts an approach of closing an active ledger
outlines the implementation of the consensus algorithm in updating session once a consensus is reached to store and
establishing agreements for storing messages on the distributed maintain an identical state of the ledger on all active nodes. For
ledger. Section V concludes the paper. each round within the ripple protocol consensus algorithm
(RPCA) [13];
II. RELATED WORK  End users of the server forwards all new transactions to
A. Consensus Algorithm each server. These valid transactions are compiled and
made public in the form of a list to constitute the
In a stand-alone system, validating transmitted message or
“candidate set”.
any transaction is vested in a dedicated centralized node.
Consensus algorithms are useful in networks that do not have a  All the candidate sets from several servers are merged
dedicated node to singularly authenticate users, processes and on every server‟s unique node list (UNL), to
transmitted messages or transactions. A consensus algorithm authenticate these transactions.
was employed by the system to agree on a single data among
multiple processes and agents. To ensure that situations of  The transactions that do not pass the authentication
some multi-agents failing to agree or be unreliable by not being minimal percentage of “Yes” votes are either discarded
available for consensus to actively reach agreement, a or included in the candidate set at the commencement
consensus protocol must adopt mechanisms to make them of the consensus process for the next ledger.
flexible and fault-tolerant [9]. Conversely, transactions that obtain the minimal

23 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

percentage of “yes” votes are passed onto the next


round of consensus.
The minimum percentage of 80% of a server‟s UNL is a
requirement for agreeing on a transaction and that constitutes
the final round of consensus. The final round of transaction
closes the ledger after appending the authenticated transactions
onto the ledger.
1) Composition of the ripple consensus protocol: The
Ripple Consensus Protocol consists of several components:
Server, Ledger, Last-closed ledger, Open-ledger, Unique node
list (UNL), Proposer.
The server is an entity that runs the Ripple server software. Fig. 1. Ripple consensus data flow diagram
Ledger is an append only record of the amount of currency
in each user‟s account and represents the ground truth of the
network. The ledger grows with updating transactions using the
consensus protocol.
The last-closed ledger describes the most recent state of the
ledger after the consensus protocol has validated transactions
and appended the validated transaction onto the ledger.
The Open ledger is used to represent the current operating
status of a ledger on a node.
2) Correctness of the consensus: There is the likelihood of
a validating node being compromised to form a cartel of
corrupt validating nodes to comprise the byzantine-fault-
tolerance integrity of the consensus. The ripple consensus
protocol maintains correctness for agreements and resistive to
Byzantine failures by adopting a mechanism where a
Fig. 2. Smart contract dataflow diagram
transaction is approved only when 80% of the validating
nodes agree using the consensus algorithm. Dishonest In Fig. 2, the smart contract data flow is presented. The
agreement to validate a message transmission is possible only smart contract operates between the sink node and the cloud
after the number of faulty validating nodes exceed 80% of the network. The IoT gateway runs the blockchain smart contract.
unique node list. The consensus protocol with honest nodes in The smart contract ensures that users, devices, and data are
the UNL will maintain correctness if the unique node list UNL verified and validated for data storage operations on the
of nodes in the network meets this condition: distributed ledger. Data from the sink node get stored onto the
( ) distributed ledger through the IoT gateway. The sink node
registers itself on the blockchain in step 3a. The IoT gateway
Where is the number of Byzantine failures. In situations always verifies the state of the blockchain using the internal
of ( ) Byzantine failures, the correctness of the storage distributed ledger as input to validate the integrity of
consensus is maintained. The consensus will only confirm a the blockchain using the cloud or remote. Connected sink
fraudulent transaction when there are ( ) failures or nodes constitute the consensus nodes for performing user,
more. The probability of occurrence hereafter, points to the device and data integrity checking before either writing onto
likelihood of growing the size of the nefarious cartel below the the blockchain or access data from the blockchain. Data
maximal threshold of Byzantine failures. writing operations on the blockchain are done by the sink
nodes, to append data onto the blockchain. They are referred to
⌈( )⌉
as data write operations in step 2a. The hash and encrypted
∑ ( ) ( ) data from the sink node are used in the next phase. The
writedata function in the smart contract is used to append the
hash of the sink node data onto the blockchain. The encrypted
Where denotes the probability of any node colluding data is then written to the gateway internal memory in steps 4a-
with other nefarious cartel. 8a. The Ecall/Ocall wrapper communicates with the gateway
In Fig. 1, the process for the Ripple consensus is outlined. internal memory as illustrated in the step 5a. The hash of the
data from the sink node is verified by recalculating the hash-
The validation nodes are IoT sink nodes from several local based message authentication code (HMAC) based on the
IoT networks. encrypted and comparing the given hash with the derived hash.
The Integrity Checker verifies and validates IoT data by
ensuring that the given hash and the derived hash are the same,

24 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

the encrypted data is sealed and written to disk in step 7a. If the TABLE I. SMART CONTRACT PSEUDOCODE
report from the Integrity Checker shows a difference in the Algorithm: Smart Contract Pseudo-code
string structure of the derived hash from the given hash, that
will result in discarding the data including the hash from the 1: HashMap deviceRegistry(key:ownerAddress, value:List[deviceIDs])
sink node. Step 7a and Step 8a are used in validating the hash 2: HashMap deviceData(key:(ownerAddress, deviceID),
and proceeding to either write the encrypted data to disk or value:List[DataHash])
3: HashMap DataAccessRegistry(key:(ownerAddress, thirdpartyAddress,
disproving the hash and discarding the data from the sink node. deviceID), value: bool isAllowed)
Data accessing activities from the blockchain is done using 4: function REGISTERDEVICE(ownerAddress, deviceID)
the data read module. A user module first registers third-party 5: InsertToHashMap(key:ownerAddress, value:List[deviceIDs])
users using the allowAccess method with the smart contract.
The user calls the revokeAccess function to revoke access for a 6: end function
user. Step 1b outlines the interaction of the third-party user 7: function WRITEDATA(ownerAddress, deviceID, Data)
with the smart contract in obtaining the hash of the data
generated by the sink node after providing the device ID of the 8: if owner == ownerAddress
sink node. The smart contract checks if the third-party user 9: deviceData([owner, deviceID], List.InsertData(hash(Data)))
device ID and the address have the validation necessary to
10: end function
access the data after doing integrity checking for the third-party
user ID and address. The hash of the sink node data is only 11: function READDATA(ownerAddress, thirdPartyAddress, deviceID)
returned from the cloud storage after the integrity checker
12: if DataAccessRegistry(thirdPartyAddress) == true
grants the access permission to the third-party user to enable it
to access the data from the IoT gateway persistent storage (IoT 13: return deviceData[hash(ownerAddress, deviceID])
gateway internal memory) that represents local storage of the 14: end function
data. The smart contract uses the READDATA API as
15: function GRANTACCESS(ownerAddress, thirdPartyAddress,
illustrated in step 4b, to confirm if the third-party user has the deviceID)
access permission to read the data hash identifier supplied by
16: if owner == ownerAddress
the third-party request. In step 5b, it illustrates how data is
retrieved from the secured internal gateway storage once data 17: DataAccessRegistry[hash(ownerAddress, thirdPartyAddress,
deviceID)] = true
access permission is granted. The data is unsealed in step 6b,
and the integrity of the data is checked in step 7b, after 18: end function
recalculating and verifying the digital signature by comparing 19: function REVOKEACCESS(ownerAddress, thirdPartyAddress,
the given and the derived digital signatures. The sensor data deviceID)
stored in the gateway internal memory is read and returned by 20: if owner == owner Address
the user only after the digital signature verification is 21: DataAccessRegistry[hash(ownerAddress, thirdPartyAddress,
completed. Steps 9 and 10 illustrate the data flow for this deviceID)] = false
operation [14]. 22: end function

In Table I, the pseudo-code for the smart contract is D. Modeling Languages for Verification Systems
presented.
Modeling systems exist to provide opportunity for
Where: designing, developing, and implementing critical systems.
Although there are several kinds of tools and platforms for
OwnerAddress: Sink node identity (SNId)
modeling, simulation, and verification of systems, the coloured
Device: Sensor petri nets (CPN) is distinguishable in the following aspects:
CPN offers several functions and provides a flexible
DeviceID: SensorID (SsId) manipulation of the functions in developing a model. The CPN
In [15] five main blockchain consensus protocols were tool has been improved and tested to support the modeling of
examined using the unique properties of type (probabilistic or complex systems [17].
absolute finality), level of fault-tolerance, power consumption, Study [18] surveyed several modeling tools for checking,
scalability, and application. The five consensus protocols are: validating, and some cases improving the design requirements
Proof-of-Work (PoW), Proof-of-Stake (PoS), Delegated Proof- of systems. Notable modeling systems mentioned included the
of-Stake (DPoS), Practical Byzantine Fault Tolerance (PBFT) Practical Robust Implementation and Sustainability Model
and Ripple. (PRISM), Numeric Symbolic Model Verifier (NuSMV),
The ripple consensus proved to have a good scalability, UPPAAL, Symbolic Analysis Laboratory (SAL), SPIN, Beryl,
involved negligible power consumption, low fault tolerance D-Finder.
and operated using permissioned application. In ripple The related works showed available research on IoT
consensus, the entire network will continue to function to solutions that is based on blockchain. It however confirmed the
support correct consensus even if 20% of the nodes are absence of an implementation for a blockchain-based solution
attacked by Byzantine generals problem [16]. to authenticate and protect IoT data transmitted between
actively connected network elements of the IoT gateway and
the cloud.

25 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

Additionally, there is an implementation gap for a formal transmit them through an IoT gateway to be stored on the
model for IoT systems that directly involved the sensor, sink distributed ledger [19].
node, IoT gateway, and the cloud elements in a blockchain-
based IoT architecture. The local IoT sub model is composed of elements that
consist of security management, devices and sensors, internet
In the next section, the methodology for the paper is connectivity things, Application Programming Interface (API)
presented. libraries, System Development Kits - SDK. Distributed
systems that operate based on a decentralized authentication
III. METHODOLOGY mechanism is prone to attacks such as the double spending
The target and design principles that formed the basis for instances where validated messages that represent independent
the chosen methodology to support a blockchain-based transactions have the possibility of getting used in
consensus mechanism for authentication of node data for IoT simultaneous transfers without considering the output of each
systems are hinged on a security solution appropriate for an transfer in the simultaneous transactions [20].
environment where the devices are resource-constrained. B. Coloured Petri Net
The design principles for the methodology are the usage of The coloured Petri Net (CPN) is a graphical mathematical
decentralized authentication, smart contract for consensus modeling language. It is used to describe and check system
among sink nodes, lightweight cryptographic solution, digital properties, security requirements and synchronization
signature, smart contract with lightweight cryptographic characteristics for real-time distributed systems, and more
function, a formal modeling tool that allows for dynamic generally event-driven systems. CPN comprises essential tools
behavior modeling, and the provision of a visual simulation for analyzing boundedness, reachability, resource conflicts,
tool. deadlock as well as the structural properties of a real-time
The design goals on the other hand involved the system [21].
elimination of a single point of failure, stronger security, The formalization of CPN is composed of nine tuples.
extending data protection with a lightweight cryptographic
solution, enforcing authentication with smart contract, the ( )
proposal of a formal model for a generic blockchain-based IoT Where:
solution, and the validation of a blockchain-based IoT solution P = {P1, P2, …, Pm} represents a finite set of places.
through simulation.
T = {T1, T2, …, Tn} denotes a finite set of transitions.
A. Heterogeneous IoT Architecture
An architecture consisting of several subsystems was A: Directed arc set
adopted for the implementation of the blockchain-based ∑: A finite set of colour set types
authentication mechanism.
V: Denotes a finite set of variables whose type .
C: It represents the colour set function from P to ∑.
G: Denotes the set of guard functions of transitions.
E: It represents a function that associates an arc expression
to each transition.
I: denotes the function that gives the initial marking of each
place.
The graphical representation of Petri net comprises of rings
representing Places, rectangles denoting Transitions, arrows
symbolizing Arcs.
A coloured Petri net is composed of variables, values, and
expressions. CPN objects are described using colour domain
that comprises variables, data values, operators, a syntax for
expressions, and typing rules. An abstract colour domain
Fig. 3. An IoT architecture consists of : Data values Variables and Expressions ( )
[22].
In Fig. 3, an IoT architecture with components for a
heterogeneous cyber-physical network is displayed. The  These data values
architecture has three components involving a local IoT include integer values, Boolean values (True and
network which consisted of sensor end devices and sink nodes, False), and special undefined value ;
an overlay network that employs blockchain-based distributed  that are represented using
ledger, and a cloud network (remote storage) to receive and
single letters or as subscribed letters
store the hash values of the sensor data. The local IoT networks
amalgamate validated sink nodes with their validated data and

26 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

 that are composed of


values, variables, and suitable operators.
a marking
Variables or values may form a basic expression. Thus, ( ) ( ) ( ( )) (( ))
. For example, let the expression ( ) , ⟩
denotes the set of variables from involved in .
The marking graph
A is a restricted function . Let
and be a binding. ( ) represents the evaluation of under
if the domain of does not include ( ) then ( ) . such that:

Both sets and multisets of expressions are subjected to 


binding evaluations.  , ⟩
For example, if * + we have (
) With * 2+ according to the colour
domain, we may have ( ) (no coercion), or ( )
( ) (coercion of integer 1 to string “1”), or The definition of marking graphs allows the addition of
( ) (coercion of string “2” to integer 2), or even infinitely many arcs between two markings. If , ⟩ there
other values as defined by the concrete colour domain. might exist infinitely many other enabling bindings that differ
Two expressions are said to be equivalent which from only on variables not involved in Finally only firings
is represented as if for all possible binding , the , ⟩ such that the domain of ( ) ( ( ))
binding for both expressions are the same ( ) ( ). For ⋃ ( ( ( )) ( ( )) ) is considered.
example, are pairwaise equivalent
expressions for the usual integer arithmetic. In the next section, the results and discussion for the
proposed methodology is presented.
Definition 1 (Petri nets). A Petri net is a tuple with several
elements such as ( ) where: IV. RESULTS AND DISCUSSION
The use of the mathematical and visualization features of
 S is also represented as
CPN provided the set of mathematical foundations necessary
P
for representing and describing the elements and security
 properties of the proposed solution that is based on the IoT
architecture.

In this section, the simulation results for the blockchain
( ) consensus using CPN tools are presented and discussed.
is allowed
to carry,
( ) a
condition for its execution,
( )
( ) ( ) ( ) and defines
the from .
Definition 2 (Markings and Sequential Semantics) Let
( )
A marking M and N is a
to a

( )
is enabled at
Fig. 4. CPN modeling of the blockchain consensus protocol
, ⟩
 In Fig. 4, the CPN modeling of the blockchain consensus
(( )) mechanism with validators is presented. The validators are an
amalgamation of the current sink node which presents the data
 ( ( )) True to be validated as well as other external sink nodes within the
hierarchical IoT network. The external sink nodes form the
 external validators. The sink node whose data is to be validated
(( )) ( ). through the consensus assumes the local validator status. The

27 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

validators (local and external) reach agreement to validate data In Fig. 6, a feedback decision of „1‟ on the data under
if and only if the number of the positive feedbacks are more validation is presented. The feedback from the local validator
than half of all the total decisions from the validation voting by confirms that the “start validation transition” has been fired.
all the validators. Once a message does not get at least more The update on the number of proposals “nbprop” of 1`(1, 1)
than half of the total decisions to be positive feedbacks, that shows that voting has started on the decision feedback on the
message is discarded. A session for the consensus by the data under validation. That only 1 validator has voted on the
validators is considered closed once the decision on a message decision feedback. That decision is a positive decision (1 –
has been made in accordance with the consensus correctness „Number of decisions‟,1-„number of positive decisions‟).
criterion of the adopted blockchain consensus. The correctness
criterion of the consensus is critical to make the algorithm
byzantine fault tolerant.

Fig. 7. External validator1 feedback decision

Fig. 5. Local validator feedback decision In Fig. 7, the feedback decision from external validator1 on
the data under validation is illustrated.
In Fig. 5, the consensus commencement for validators is
illustrated. The blockchain consensus starting with the local The update on the nbprop place 1`(2,2) shows that there
validator to decide by voting by on the feedback of the data have been two voting decisions and all the decision are positive
under validation is presented. There are two feedback options decisions.
(0, 1) to be selected by a validator. Option 1 symbolizes
positive feedback whereas option 0 denotes non-positive
feedback. The “start validation transition” has not been fired
yet. Selecting a choice for the feedback will fire the transition.
The token (1`1) on the local validator symbolizes a single node
data and the specific data to be validated is 1. The update on
the number of proposals “nbprop” of 1`(0, 0) shows that voting
on the decision feedback on the data under validation has not
started (0, 0).

Fig. 8. External validator2 feedback decision proposal update

In Fig. 8, the feedback decision from external validator2 on


the data under validation is shown.
Fig. 6. Local validator feedback decision proposal update The decision feedback voting update on the number of
proposals “nbprop” – 1`(3,3) shows that there have been three

28 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

feedback decisions with all three being positive feedback


decisions.

Fig. 11. Decision result after the proposals

In Fig. 11, the data flow CPN simulation on the decision


Fig. 9. External validator3 feedback decision proposal update
feedback results at the end of the decision voting process is
represented. The token value on the nbprop 1`(5,3) and the
In Fig. 9, the feedback decision from external validator3 on
summary information on the transition confirm that there was
the data under validation is illustrated. The local validator,
one data identity that represented 1 data element to be validated
external validators 1, 2, 3 have all voted on the decision and
and that there were 3 positive decision feedbacks.
have the feedback updated and stored on the nbprop place. The
token value has been updated to 1`(4,3) to show that there have
been four votes (local validator, external validators 1,2,3). And
that three out of the four votes are positive feedback decisions.

Fig. 12. Consensus decision

In Fig. 12, the decision on the data at the end of the


Fig. 10. External validator4 feedback decision proposal update
consensus process is shown. The initial token element 1`1 on
the local validator place has been moved to the place for the
In Fig. 10, the feedback decision from external validator4 ValidatedData. Additionally, the consensus session is closed
on the data under validation is depicted. Additionally, it and the nbprop token element is reset to 1`(0,0).
provides the update as illustrated in the place for the number of The firing of the EndValProcess transition ends and session
proposals “nbprop” for a total of five decisions, with three for the consensus activity. The data is then validated and the
positive feedback decisions. The EndValProcess transition is colour token 1`1 on the ValidatedData place finalizes the
highlighted to show that it is the next action or step to be taken consensus.
for the simulation.

29 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

Abbreviation Description CPN


TABLE II. DESCRIPTION OF CPN MODELING FEATURES FOR THE
BLOCKCHAIN CONSENSUS MECHANISM Component
nbprop as input. The
Abbreviation Description CPN output of this transition is
Component the ValidatedData.
LocalValidator It represents an internal cpt A token for describing the
sink node. The container identity of data under
for keeping a sink node validation. The data under
data prior to a validation validation is submitted by
operation the local validator to the
ExValidators It denotes external sink validators where the
nodes that form the consensus mechanism is
external validators. These applied on the data using
are all the other sink nodes other established rules in
within the hierarchical IoT the consensus to vote on
network. They join the the data in validating it.
internal validator to reach EVi (i = 1 .. 4) The token identifying the
an agreement on a message external validator i.
through a blockchain data A data element
consensus. representing the data under
nbprop A container for keeping all validation by the external
the decisions resulting validator.
from validators using the nboffeedbacks It is a counter that records
consensus rule to vote on a the decisions of voting
Places
data under validation. activities by providing an
ValidatedData It represents the results update on the total number
after the voting decisions of feedback decisions
Variables
undertaken by all the nbofposfeedbacks It is a counter that records
validators have ended. the total number of
When the number of positive feedback
positive feedbacks where decisions. Both the number
at least 60% of the total of feedbacks and the
decisions by the validators, number of positive
the data will be moved to a feedback decisions are
new state of stored as a token in the
ValidatedData. “nbprop” place and are
DataUnderValidation It denotes a place that updated each time an
specifies the current data external validator decision
being validated is kept. It is taken.
is represented by the
identity of the data which In Table II, the CPN simulation components for the
is captured as (`cpt) on the consensus mechanism for the system are presented. The
arc inscription. components for the simulation consisted of CPN places,
StartValProcess It is an event that signifies transitions, arc expressions, and initial marking of places using
the start of the consensus
session. The local validator
coloured tokens. The various components used in the
is an input to this event. It simulation of the consensus mechanism were described in the
fires the data from the table.
local validator to the
external validators as well The use of the proposed IoT architecture is an improvement
as updates the on a related work that used blockchain mechanisms for IoT
DataUnderValidation and data security. In [19] the blockchain solution did not indicate
the “nbprop” places. how the node data from the sensor was protected as well as an
EVDecision It is a transition label for approach to maintain the integrity of the data communicated
the CPN event that fires
the decision of each between the sensor and the sink node. The proposed
external validator as blockchain-based IoT architecture used a centralized approach
Transitions
feedback on a data. The with a lightweight-cryptographic mechanism to protect the
input of the transition is content of data between the sensor and the sink node.
the external validator and Additionally, the use of a non-monetary-based blockchain
the data to be validated
based on the consensus
consensus mechanism where only the IoT gateway and other
rules. The output for this sink node clusters formed the consensus nodes is used to
transition is the number of implement a smart contract with a lightweight cryptographic
decision feedbacks and the function for decentralized authentication of node data.
number of positive
decision feedbacks. The use of the decentralized consensus ensured the
EndValProcess It is a transition to signify elimination of a single point of failure situation for the IoT
the close of a consensus network and supported a distributed ledger that guaranteed the
session. It has
DataUnderValidation, and
availability of validated node data on the IoT internal storage
and the cloud for authorized users in the IoT system.

30 | P a g e
www.ijacsa.thesai.org
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 13, No. 12, 2022

In the next section, the general conclusion of the work is [6] B. T. Asare, K. Quist-Aphetsi, L. Nana, and G. Simpson, “A nodal
presented. Authentication IoT Data Model for Heterogeneous Connected Sensor
Nodes Within a Blockchain Network,” in 2021 International Conference
on Cyber Security and Internet of Things (ICSIoT), 2021, pp. 65–71.
V. CONCLUSION
[7] S. Zhang and J.-H. Lee, “Analysis of the main consensus protocols of
Distributed systems that rely on decentralized processing blockchain,” ICT express, vol. 6, no. 2, pp. 93–97, 2020.
for authentication and validation of processes like the [8] E. Zaghloul, T. Li, M. W. Mutka, and J. Ren, “Bitcoin and blockchain:
blockchain system use agreements through consensus Security and privacy,” IEEE Internet of Things Journal, vol. 7, no. 10,
mechanisms to assure and maintain the correctness of pp. 10288–10313, 2020.
decisions, and to guarantee stable systems. For a blockchain [9] X. Wang, H. Su, X. Wang, and G. Chen, “Fully distributed event-
triggered semiglobal consensus of multi-agent systems with input
mechanism to be deployed in an IoT network where the saturation,” IEEE Transactions on Industrial Electronics, vol. 64, no. 6,
devices are resource-constrained, an architecture was designed pp. 5055–5064, 2016.
that factored in the challenges regarding memory, [10] X. Wang, G.-P. Jiang, H. Su, and Z. Zeng, “Consensus-based distributed
computational processing, and energy limitations of sensors reduced-order observer design for LTI systems,” IEEE Transactions on
and sink nodes. The distinctive security features in the Cybernetics, 2020.
proposed consensus mechanism enabled the core elements of [11] J. Zhang and M. Wu, “Blockchain-Based Authentication with Optional
the IoT architecture to reach an agreement among the sparsely Privacy Preservation for Internet of Vehicles,” Mathematical Problems
fragmented network elements in the IoT architecture. The use in Engineering, vol. 2021, 2021.
of the IoT gateway, PKI, and cloud network in the architecture [12] D. Wang, C. Jin, H. Li, and M. Perkowski, “Proof of Activity Consensus
Algorithm Based on Credit Reward Mechanism,” in Web Information
supported a security solution that provided a trade-off between Systems and Applications: 17th International Conference, WISA 2020,
performance, fairness in load balance, and security. Guangzhou, China, September 23–25, 2020, Proceedings, Berlin,
Heidelberg, 2020, pp. 618–628. doi: 10.1007/978-3-030-60029-7_55.
Additionally, the ripple consensus mechanism provided a
[13] D. Schwartz, N. Youngs, and A. Britto, The ripple protocol consensus
byzantine fault-tolerant approach with good scalability to algorithm. Ripple Labs Inc.(2014). 2021.
support a large network consisting of several subsystems. [14] G. Ayoade, V. Karande, L. Khan, and K. Hamlen, “Decentralized IoT
The modeling and simulation of the blockchain-based data management using blockchain and trusted execution environment,”
in 2018 IEEE International Conference on Information Reuse and
authentication mechanism provided the possibility of Integration (IRI), 2018, pp. 15–22.
validating the security properties of an IoT security solution [15] S. Zhang and J.-H. Lee, “Analysis of the main consensus protocols of
that is based on a decentralized authentication approach. The blockchain,” ICT Express, vol. 6, no. 2, pp. 93–97, Jun. 2020, doi:
CPN features including places, transitions, arcs, expressions, 10.1016/j.icte.2019.08.001.
and initial markings of places with tokens were used to [16] B. Chase and E. MacBrough, “Analysis of the XRP Ledger Consensus
represent the entities or physical attributes of the system as Protocol.” arXiv, Feb. 20, 2018. Accessed: Jun. 02, 2022. [Online].
well as the design decisions of the system. The design Available: http://arxiv.org/abs/1802.07242
decisions and the dynamic nature expectations of the [17] H. Kaid, A. Al-Ahmari, Z. Li, and R. Davidrajuh, “Single controller-
based colored Petri nets for deadlock control in automated
distributed ledger system were represented using places, manufacturing systems,” Processes, vol. 8, no. 1, p. 21, 2019.
transitions, arc expressions, and tokens.
[18] M. Luckcuck, M. Farrell, L. A. Dennis, C. Dixon, and M. Fisher,
REFERENCES “Formal specification and verification of autonomous robotic systems: A
[1] M. Keerthika and D. Shanmugapriya, “Wireless Sensor Networks: survey,” ACM Computing Surveys (CSUR), vol. 52, no. 5, pp. 1–41,
Active and Passive attacks-Vulnerabilities and Countermeasures,” 2019.
Global Transitions Proceedings, vol. 2, no. 2, pp. 362–367, 2021. [19] G. Wang, Z. Shi, M. Nixon, and S. Han, “ChainSplitter: Towards
[2] W. Fu, X. Wei, and S. Tong, “An improved blockchain consensus Blockchain-Based Industrial IoT Architecture for Supporting
algorithm based on raft,” Arabian Journal for Science and Engineering, Hierarchical Storage,” 2019 IEEE International Conference on
vol. 46, no. 9, pp. 8137–8149, 2021. Blockchain (Blockchain), pp. 166–175, 2020, doi:
10.1109/blockchain.2019.00030.
[3] I. Lee, “Cybersecurity: Risk management framework and investment
cost analysis,” Business Horizons, vol. 64, no. 5, pp. 659–671, 2021. [20] U. W. Chohan, “The double spending problem and cryptocurrencies,”
Available at SSRN 3090174, 2021.
[4] H. S. Lallie et al., “Cyber security in the age of COVID-19: A timeline
and analysis of cyber-crime and cyber-attacks during the pandemic,” [21] W. Duo, H. Xin, and M. Xiaofeng, “Formal Analysis of Smart Contract
Computers & Security, vol. 105, p. 102248, 2021. Based on Colored Petri Nets,” IEEE Intell. Syst., vol. 35, no. 3, pp. 19–
30, May 2020, doi: 10.1109/MIS.2020.2977594.
[5] L. Dong, H. Xu, X. Wei, and X. Hu, “Security correction control of
stochastic cyber–physical systems subject to false data injection attacks [22] C. Gaucherel, C. Carpentier, I. R. Geijzendorffer, C. Noûs, and F.
with heterogeneous effects,” ISA transactions, vol. 123, pp. 1–13, 2022. Pommereau, “Discrete-event models for conservation assessment of
integrated ecosystems,” Ecological Informatics, vol. 61, p. 101205,
2021.

31 | P a g e
www.ijacsa.thesai.org

You might also like