<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>WOA</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Improving Computational Eficiency of the TONS algorithm in Selecting Neighbor Agents in Blockchain Trust-based IoT Environments</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Giancarlo Fortino</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabrizio Messina</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Domenico Rosaci</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe M. L. Sarné</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>DIIES, university Mediterranea of Reggio Calabria</institution>
          ,
          <addr-line>Via Graziella snc, 89122 Reggio Calabria</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>DIMES, Univ. of Calabria</institution>
          ,
          <addr-line>Via P. Bucci, 87036 Rende (CS)</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Mathematics and Computer Science, University of Catania</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Department of Psychology, University of Milan Bicocca</institution>
          ,
          <addr-line>Piazza dell'Ateneo Nuovo, 1, 20126 Milan</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2024</year>
      </pub-date>
      <volume>25</volume>
      <fpage>8</fpage>
      <lpage>10</lpage>
      <abstract>
        <p>Blockchain (BC) is increasingly applied to the Internet of Things (IoT) domains to realize decentralized IoT environments where reliable and anonymous activities can be carried out. BCs exploit a distributed ledger, which requires to be continuously synchronized and to maintain a high level of consistency. To allow BCs applied to the IoT of maintaining high levels of reliability in the network and resilience against malicious or fraudulent nodes, in the recent past has been proposed a Trust-based Optimum Neighbor Selection (TONS) algorithm able to find the Minimum Spanning Tree of the agent network with the purpose of selecting those agents which optimize communication and trustworthiness. In this paper, a new version of TONS, named TONS2, has been conceived for agent-based IoT environments to improve the overall eficiency of the TONS algorithm. The results ot the test we performed have confirmed that in terms of consumed resources TONS2 is appreciably more eficient than TONS.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Agents</kwd>
        <kwd>Blockchain</kwd>
        <kwd>Internet of Things</kwd>
        <kwd>Optimum Neighbor Selection</kwd>
        <kwd>Trust</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The great interest generated by the Internet of Things (IoT) comes from its ability to interconnect
heterogeneous devices providing attractive functionality across a wide horizon of domains. [
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1,
2, 3</xref>
        ]. But the large data trafic that connected IoT devices can generate may compromise the
required the necessary levels of Quality of Service (QoS), due to bandwidth, storage capacity
and computation constraints [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ].
      </p>
      <p>
        Recently, several IoT applications have exploited the blockchain [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] (BC) to realize
decentralized environments in which performing trusted and anonymous activities by providing the
required robustness against malicious attacks. In the convergence between IoT and BC [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ] the
Distributed BC Ledgers (DLs) records transactions contemporary on more nodes without using
any central data repository or global administration nodes, since each DL node independently
processes, verifies and records each data item, creating a consensus on its validity. However,
several events can cause diferent readings and compromising the consistency of a DL [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], but
BCs adopt a mechanism able to warranty that data stored on the DL will remain synchronized
making it consistent.
      </p>
      <p>In various types of blockchains the concept of "neighbors" is relevant, particularly in
decentralized and distributed ones. Nodes connect with each other as neighbors to share information,
validate transactions, and maintain the security and integrity of the network. The specific
terminology and role of nodes and neighbors (i.e., miners, endorsers, validators, voters, notaries,
etc.) may vary depending on the type of technology and network structure.</p>
      <p>
        For example, the Bitcoin mining network is designed as a peer-to-peer overlay, in which
nodes, called miners, are randomly connected. Blocks are transmitted over this network using a
multi-hop transmission scheme. In other words, a block creator broadcasts its newly mined
block to all its neighbors [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Ethereum nodes randomly selecting some neighbor nodes to
forward messages to ensure that transactions and status updates are propagated through the
network [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In permissioned blockchains, where network access is restricted to pre-approved
participants, the concepts of neighbors can be even more specific. In Hyperledger Fabric, nodes
(peers) connect to each other within a communication channel. Validator nodes (endorsers) and
commit nodes consider themselves neighbors within their channel, sharing transactions and
status updates with each other [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Corda uses a network model where nodes interact directly
with each other to execute transactions, and nodes can consider themselves neighbors if they
are participating in the same transaction or contract [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. Transactions are shared directly
among the relevant participants.
      </p>
      <p>
        In such a scenario, it is known from the literature that a high level of consistency of a BC DL
will require a small number of neighbors per nodes and a low rate of delivery time between
neighbors [
        <xref ref-type="bibr" rid="ref14 ref15">14, 15</xref>
        ] and, depending from the specific BC, also from the absence of unreliable
malicious actors in the system. In this context, the Optimum Neighbor Selection (ONS) for a
connected network can be exploited to search its Minimum Spanning Tree (MST) but, to the best
of our knowledge, only [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] considered the presence of unreliable actors in an IoT environment.
To this purpose, in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] a specific algorithm, called Trust-based ONS (TONS), enables nodes to
communicate with a globally optimized selection of the most reliable neighboring as possible,
recognizes the presence of misbehaving nodes and optimizes the neighbor selection of the
network based on their delivery time rates and reputation scores. TONS has been proposed
and validated on networks generated on the basis of both the models Barabási–Albert (BA) and
Erdős–Rényi (ER) [
        <xref ref-type="bibr" rid="ref17">17, 18</xref>
        ] and compared with the classical approach Random Neighbor Selection
(RNS) [19], often used to compute ONS in blockchain networks, outperforming both in eficiency
(time and number of exchanged messages to build ONS) and in efectiveness (percentage of
misbehaving nodes included in the ONS).
      </p>
      <p>
        Given this premise, the contribution of this paper consists of proposing TONS2, an improved
version of the algorithm TONS described in [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], designed for agent-based IoT environments.
In detail, TONS consumes significant, precious computational, storage and power resources to
calculate the best set of neighbors in BC scenarios. To improve the overall eficiency of this
algorithm, TONS2 has been modified in the sense that it is not always necessary to select a new
set of neighbor agents for each new BC block to validate. We tested TONS2 through a session of
simulations, and the results revealed that TONS2 is more eficient than TONS, saving resources
without significant performance downgrading in terms of the quality of selected neighbors.
      </p>
      <p>The rest of the paper is organized as follows. Section 2 presents some related work, the
Section 3 introduces the native algorithm TONS, while its evolution TONS2 is described in
Section 4. The experiments we have performed to evaluate the efectiveness and the eficiency
of TONS2 are presented and discussed in Section 4.1. Finally, some conclusions are drown in
Section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>Our study rely on three main elements, namely:
• A BC implements a DL, on a peer-to-peer (P2P) architecture, structured in a chain of
data blocks [20], where a distributed consensus protocol enables the BC without trusted
third parties and in presence of unreliable actors. BCs properties are transparency,
immutability, capabilities of ensuring privacy and maintaining a complete and public
transaction history [21] However, BCs are considered resilient to attacks and threats,
although BCs have been tampered in the past [22].
• IoT devices have generally limited computational, storage and power capabilities,
conversely IoT applications need of high level of connectivity and power to manage the large
volumes of data they could generate [23, 24].
• Trust and reputation systems enable qualified parties to interact and cooperate on the
basis of the history about their past behaviors [25, 26].</p>
      <p>Synergistically, BCs can support trust (i.e., reputation) systems in managing IoT networks [27]
to provide them with resilience against a large variety of attacks made easier by device
characteristics. For example, TrustChain [28] provides resistance against sibyl-attacks in an online IoT
community by adopting a consensus mechanism that can determine the validity and integrity
of transactions instead of the more usual Proof-of-Work.</p>
      <p>In dynamic federated social IoT environments, where IoT devices can migrate into diferent
environments populated by potential untrusted actors, the consequences of a bad partner
choice can result to be particularly risky. To mitigate this problem, in [29] multi-agent and BC
technologies exploit reputation scores (witnessed by a BC) to form groups of trusted agent-based
IoT devices in each federated environment. The authors of [30] designed a BC-based trust model
for IoT that dynamically aggregates information sources to compute certified reputation scores
for each entity in a decentralized manner by using a multilevel approach. In [31] a distributed
trust model for IoT, supported by a BC, based on connected trust domains to form end-to-end
trust relationships between devices is described.</p>
      <p>With respect to the computation of the Minimum Spanning Tree (MST) search1, a number of
1A MST is a minimum-weight tree that in a graph, connected, and with undirected arcs, has only the subset of
arcs required to connect all vertices with each other by one and only one path.
centralized, semi-distributed or distributed MST algorithm have been proposed [32, 33, 34, 35],
also in scenarios including the presence of IoT devices and BCs. For instance, DONS [30]
(Dynamic and Optimized Neighboring Search) implements a hybrid architecture where the
network topology is managed by an elected peer (i.e., leader) exploiting the neighbor lists to
select the best neighbors for each peer by solving a MST based on the message propagation
delays. Delays of the broadcast messages can make critical the synchronization of miners
to add transaction blocks. In [36] an adaptive broadcasting approach is designed for BC’s
accounting services, authorization, and authentication combining transmission and data-check
times. In [37] the time gap between the propagation of a winning block and the next mining
competition is minimized; in particular a message propagation mechanism exploiting the closest
neighbors by using the message latency.</p>
      <p>Finally, in IoT scenarios, in [38] edge computing is used to mitigate system latency and
bandwidth limitation, while edge computing security is provided by a BC that adopts a
threetier network model, named BMEC, exploiting a solution utilizing neural networks. In this case,
the MST search is carried out on a weighted indirect graph consisting of edge-based blocks to
enhance the BC transaction speed, built based on predetermined priority rules, application type,
and past behaviors of edge devices.</p>
    </sec>
    <sec id="sec-3">
      <title>3. The TONS algorithm</title>
      <p>In this Section the original TONS algorithm will be summarized; however, a complete description
of this algorithm can be found in [29].</p>
      <sec id="sec-3-1">
        <title>3.1. The BC Network</title>
        <p>Let   = ⟨, ,  ⟩ be a BC network (an undirected, weighted and connected graph),
where:
(i)  is a set of agent nodes in   ;
(ii)  is a set of arcs , , with ,  ∈  representing bidirectional communication between
the agents, and associated with a weight , ;
(iii)  is a set of weights, where , = ⟨, ,  , ⟩ ∈  is a tupla consisting of , &gt; 0,
named time-weight, that is the transmission time required to transmit 1 byte of data
from the agents  and , and  , , named trust-weight, that is the mutual trustworthiness
between the agents  and .</p>
        <p>Besides, let the positive value , = , ·  , (i.e., the product of the pair of weights above
described) be the overall weight of the arc , and, similarly, let  be the global overall weight
(i.e., the sum of the weights of the arcs of the whole network   ).</p>
        <p>Furthermore, it is supposed that each agent  ∈   knows its neighbors   = ( ,1, ..,  ,)
and their associated weights. Therefore, in the adjacency matrix  of size | ×  | each its
element will be set to , if the arc , ∈   , while a sub-network of   is an undirect
graph   * ( * , * ,  * ), such that  * ⊆  , * ⊆ , and   * (where   * will inherit
the weights of  for the graph   ).</p>
        <p>Finally, let a Spanning Tree  of   be a connected acyclic sub-graph of   , with
 * =  and | * |=|  | − 1, and let a Minimum Spanning Tree   of   be the unique
Spanning Tree having the minimum  of   among all the Spanning Trees of   .</p>
        <p>
          TONS has been developed to realize the Optimum Neighbor Selection ( ) finding the subset
ℎ = (ℎ1, ..ℎ) ∈  , ∀ ∈  underlying the BC network, such that ,ℎ ∈   , ∀ℎ ∈ ℎ.
It is executed periodically to maintain updated the list of the agents in   by exploiting the
MST computations by one of agents (i.e., the leader, which is chosen by adopting approaches
like [
          <xref ref-type="bibr" rid="ref15">15, 39</xref>
          ]) on the behalf of other agents. Specifically, TONS adopts the same approach
described in [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ], in which the leader collects all the agents’ local public views, solves both the
network graph MST and the network MST problems, and anonymously shares this information
into the network.
        </p>
        <p>To implement our approach, we assume that each interaction occurring between agents (i.e.,
nodes) can be described from a short report, called proof. Moreover, in the BC construction we
assume also that in   the agent  can require to the agent  data for this purpose. In such
a scenario,  can either ask to a third node  for a “recommendation”  about  (based on the
proofs about the past interactions of  with ) or it can directly require from  itself a statement
about its competence (both are expressed in the real domain [0, .., 1]).</p>
        <p>Let  be the “Assurance”, a real value ranging in [0, .., 1], evaluating the proofs that  can
show to  for assuring the reliability level of the  provided. To represent the trust measure of
 sent by  to the requester  about , the real value [0, .., 1] −  is computed. The maximum
level of assurance (i.e., 1) will be reached when all the proofs produced by  to generate its
recommendations about  are traced through authentic and non-repudiable messages recorded
on the BC itself. Conversely, the minimum value of  will be obtained when all transactions
will be without proof.</p>
        <p>Finally, a “feedback” will by assigned from  to  if if  will require data to .</p>
        <sec id="sec-3-1-1">
          <title>3.1.1. The Trust Model</title>
          <p>Let , ,  , and  be four mappings associated with each agent  ∈  in the BC network
  = ⟨, ,  ⟩. Each mapping has an agent  as input and a diferent trust measure
ranging in [0, .., 1] (with 0/1 the minimum/maximum trust value), as output assigned by  to .</p>
          <p>In detail:
• () is the overall trust assigned by  to its interactions with .
• () is the measure of the reputation assigned by  to  on basis of recommendations
coming from the BC agents.
• () is the trust weight, i.e. the weight assigned by  to the reliability of the reputation
communicated from  to . In other words,  computes the overall trust score of  by
considering both the trust () and the reputation (). The percentage of relevance
assigned to trust versus reputation is given by (), autonomously computed by  based
on the level of assurance  and the recommendations provided by the contacted agents.
• () is the overall “score” (preference) assigned to  by  based on its perceived reliability
and reputation of .</p>
          <p>Moreover, a further mapping  has been defined to represent the recommendations received
by the agent . Specifically, a recommendation is assumed to be a pair  = ⟨, ⟩, with  (called
recommendation value) and  (called recommendation level of assurance) ranging in the real
domain [0, .., 1] (where 0/1 is the minimum/maximum value). Formally, (, ) is a mapping
that in input receives two agents  and  and in output returns the recommendation (, )
that  provides to  about , together with a measure of the level of assurance associated with
this recommendation.</p>
        </sec>
        <sec id="sec-3-1-2">
          <title>3.1.2. The ONS Computation</title>
          <p>
            Each node will update its mappings by means of the steps:
• Step 1: Reception of the Recommendations. The agent  receives recommendations
(encoded in the  mapping) from the other agents in response to previous
recommendation requests. Each recommendation provided by  about the agent  is stored in a
recommendation message  consisting of a tuple ⟨, ⟩, whose elements are stored by  in
its mapping (, ). and (, )., respectively.
• Step 2: Computing the T mapping.  updates the mapping T for any agent  with
which  has interacted and, as a result,  has issued one or more feedback for contributions
provided by . These feedback, stored in the mapping  (), represent the quality
of the collaboration that  provided to  during the -th by real values ranging in [
            <xref ref-type="bibr" rid="ref1">0, 1</xref>
            ]
(where 0/1 means the minimum/maximum “Quality of Service”). Based on these feedback,
 updates its mapping  and calculates the current reliability shown by  by averaging
all the feedback concerning it. By denoting with  the number of recent interactions
between  and , the current trust () is computed as:
          </p>
          <p>() = 1 ∑︁  ()</p>
          <p>=1
At each step,  is updated by averaging the value of  at the previous step  − 1 and
that computed at the new step , denoted by , as:</p>
          <p>
            () =  · (− 1)() + (1 −  ) · ()
where  is a real value ranging in [
            <xref ref-type="bibr" rid="ref1">0, 1</xref>
            ] and meaning the relevance assigned by  to the
past evaluations of  with respect to the current one.
• Step 3: Computation of Rep and  . The recommendations in the mapping 
are used by the agent  to compute the reputations of the other agents. In detail, the
reputation of an agent  is computed by  as a weighted mean of all the recommendations
received from the other nodes referred to  (let  be this set), where the weight of each
recommendation value is the corresponding level of assurance. Thus () is given
from:
() =
∑︀∈,̸= (, ). · (, ).
∑︀∈,̸= (, ).
(1)
(2)
(3)
where (, ). (resp., (, ).) is the value (resp., the level of assurance) of the
recommendation that the agent  returned to  about the agent , and  is the coeficient
associated with  in the mapping  . The computation of the average level of assurance
of the recommendations related to , denoted by  (), is obtained by averaging the level
of assurance associated with all the recommendations related to . Thus:
 () =
∑︀∈,̸= (, ).
          </p>
          <p>|| − 1
• Step 4: Computation of S. The agent  computes the overall score () in the agent 
by considering both the trust () and the reputation (), while the value of the
mapping  () weights the relevance of the service reliability with respect to reputation:
() =  () · () + (1 −  ()) · ()
• Step 5: Sending the mapping S to the leader. Each agent  sends its mapping  to the
leader  of   .
• Step 6: Computation of ONS. The leader L exploits Prim’s approach [40] to find
the   by computing both the time-weight , and the trust-weight  , of the arc
, ∈ , as the arithmetic mean between the () and  (). Finally, from the MST then
 computes its   and sends it to the agents belonging to the ONS that, in turn, will
forward it to their neighbors.</p>
          <p>At each step, the agent  exploits the mapping  to select the most suitable candidates to
require for collaboration. We highlight that the usage of TONS introduces the time cost required
from the computation of the trust measures, that is generated realized during the transactions
performed in the network.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. The TONS2 algorithm</title>
      <p>The TONS algorithm has been designed to compute the ONS from the MST, but it is an expensive
procedure in terms of computational, storage and power resources, which is an aspect relevant
in presence of IoT devices and, particularly, when they are light, and poorly equipped.</p>
      <p>From the experiments carried out to test TONS, we observed that the set of best neighbor
agents was not subject to sudden changes in its composition. Consequently, an updated version
of this algorithm, called TONS2, was developed to reduce the computational, storage and power
costs required by TONS to the IoT devices, but without significantly impacting on the quality
of the neighbor selection process. To this purpose, in TONS2 an heuristic strategy has been
introduced to compute a new ONS only:
(i) after each  consecutive blocks validated in the DL, with  &gt; 1, (we call “batch” this
sequence of blocks to validate);
(4)
(5)
(ii) when the overall score of each agent belonging to the agent set decreases more than a
ifxed percentage;
(iii) when the communication time occurring between two agents increases more than a fixed
percentage;
(iv) when a time threshold, meaning the maximum time allowed to complete a batch, is
elapsed.</p>
      <p>Therefore, let ∆  and ∆  be the thresholds defining the percentages of maximum loss of
score and communication quality respectively, and let  be the maximum time imposed to
complete a batch.</p>
      <p>It is evident as TONS2 could save IoT resources by confirming the agent set without modifying
the trust-based ONS search algorithm of TONS. In detail, for each batch the leader will execute
the algorithm of TONS with the first block to validate. Then for each subsequent block in the
batch to be validated, the leader will preemptively check whether the overall score and the
weight-time parameter (both referred to the previous process of block validation) will respect
the constraints imposed by ∆  and ∆ , and the time  is not elapsed. If the constraints are
met then the leader will initiate a new block validation process, otherwise it will proceed to
update all mappings (see below) and will perform the selection of a new set of agents.</p>
      <p>Unfortunately, this procedure may cause a side efect on agent trust values due to the fact that
the same set of agents will validate multiple consecutive blocks in the DL. In fact, by choosing
the same set of agents several times, they will gain an important advantage over the rest of the
agent community, having more opportunities to increase their trustworthiness. This implies
more chances to be chosen for new block validation processes than the other agents.</p>
      <p>Summarizing, the TONS2 strategy will be the following:
• Let  be the loop counter of the batch ranging in [1, .., ]. For  = 1 the mappings  ,  ,
, ,   and  are copied in  * ,  * , * , * ,  * and * .
• After each other validation block process in the batch only  * ,  * , * , * ,  *
and * will be updated as described in Section 3.1.2 and for each pair of agents  and ,
belonging to the exploited agent set, then:
– If ()* &gt;= (1 − ∆ ) · () &amp;&amp;  is not elapsed &amp;&amp;  &lt; , then a new interaction
in the batch will be performed and  will be set to  + 1;
– If ()* &lt; (1 − ∆ ) · () | |  is elapsed | |  = , then the batch will end (i.e.,
will be completed) and a new ONS computation will be executed by the leader;
• When in the batch there are not new blocks to validate then the mapping  ,  and 
will be updated as follows:  =  + ( −  * )/;  =  + ( − * )/;  =  * .</p>
      <p>In terms of computational complexity, the batch procedure of TONS2 and TONS, for each
new iteration in the batch after the first block, have complexities of (| |2) and (| |3),
respectively. Therefore, each time that in a batch the ONS computation is not performed
because the agent set is confirmed, a significant amount of resources is saved.</p>
      <p>The batch procedure above describes is formally presented as a pseudo-algorithm in
Algorithm 1.</p>
      <sec id="sec-4-1">
        <title>4.1. Experiments</title>
        <p>
          This Section describes the experiments we performed to evaluate the advantages given by
TONS2 with respect to TONS. The interested reader can found a more detailed analysis of the
efectiveness and eficiency of TONS in [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
        </p>
        <p>
          To carry out these experiments we adopted the same computational configuration, i.e. an
ASUS PC equipped with an Intel i7 CPU (8-Cores, 7GHz), 32 GB DDR4-SDRAM, 1 TB of SSD
and Windows-11 OS. Several experiments by using random network models belonging to
the Barabási–Albert (BA) and Erdős–Rényi (ER) network models [
          <xref ref-type="bibr" rid="ref17">17, 18</xref>
          ] have been realized.
Moreover, as in [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ] we varied the number of nodes to analyze, the percentage of misbehaving
nodes randomly generated, but also adding the dimension of the batch. ∆  and ∆ , have
been set to 5,  has been set to 600 seconds that is a value suitable for the adopted simulated
DL, and the batch size varied from 3 to 5.
        </p>
        <p>The results obtained bv the performed comparison between the TONS and TONS 2 algorithms
are presented in the Tables 1 and 2 and graphically depicted in Figures 1 and 2 for the BA and
RE network models and diferent batch dimensions. To permit a proper evaluation of the results,
the average times (in seconds) have been reported for only those simulations that completed
all the blocks assigned to them. Such results show that the advantage in time introduced by
number of nodes
average neighbors
TONS (3 blocks)
TONS2 (k=3)
TONS (4 blocks)
TONS2 (k=4)
TONS (5 blocks)
TONS2 (k=5)</p>
        <p>TONS2 with respect to TONS increases with both the network size and the batch dimensions.
This confirmed our expectations.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>The consistency of a DL is a fundamental aspect of BC systems where the propagation of shared
data in the shortest way and the optimization for the neighbor selection for each agent play a
relevant role, particularly in IoT scenarios.</p>
      <p>
        In our previous work [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] we presented TONS (Trust-based ONS) an optimized BC network
algorithm that allows agents to communicate with an optimized selection of neighboring agents,
ensuring that these are the most trustworthy agent nodes in the BC. Therefore, the TONS
algorithm identifies the optimal neighbor selection based on both the delivery time rates and
the trustworthiness of the agent nodes in the network.
      </p>
      <p>To improve the computational complexity of TONS, we added in TONS an heuristic strategy
to avoid of computing a new set of agents for each new block to validate. To test the benefits
provided from this new version of TONS, called TONS2, we compared these two algorithms by
executing some simulations on BA and ER network models for diferent dimensions of the batch
of validating blocks. The obtained results have shown that TONS2 is capable to save important
amount of computational, storage and power resources (a desired feature in an IoT context)
with a minimal performance detriment, particularly important in presence of IoT devices poorly
equipped.
physics 74 (2002) 47.
[18] S. Chatterjee, P. Diaconis, Estimating and understanding exponential random graph
models, The Annals of Statistics 41 (2013) 2428–2461.
[19] J. F. Mikalsen, Firechain: An eficient blockchain protocol using secure gossip, Master’s
thesis, UiT Norges arktiske universitet, 2018.
[20] S. Nakamoto, Bitcoin: A peer-to-peer electronic cash system, Decentralized Business</p>
      <p>Review (2008) 21260.
[21] Q. Zhou, H. Huang, Z. Zheng, J. Bian, Solutions to scalability of blockchain: A survey,</p>
      <p>Ieee Access 8 (2020) 16440–16455.
[22] X. Li, P. Jiang, T. Chen, X. Luo, Q. Wen, A survey on the security of blockchain systems,</p>
      <p>Future Generation Computer Systems 107 (2020) 841–853.
[23] A. Reyna, C. Martín, J. Chen, E. Soler, M. Díaz, On blockchain and its integration with iot.</p>
      <p>challenges and opportunities, Future generation computer systems 88 (2018) 173–190.
[24] X. Zhou, W. Liang, I. Kevin, K. Wang, L. T. Yang, Deep correlation mining based on
hierarchical hybrid networks for heterogeneous big data recommendations, IEEE Transactions
on Computational Social Systems 8 (2020) 171–178.
[25] Z. Yan, P. Zhang, A. V. Vasilakos, A survey on trust management for internet of things,</p>
      <p>Journal of network and computer applications 42 (2014) 120–134.
[26] G. Fortino, L. Fotia, F. Messina, D. Rosaci, G. M. L. Sarné, Trust and reputation in the internet
of things: State-of-the-art and research challenges, IEEE Access 8 (2020) 60117–60125.
[27] R. Kumar, R. Sharma, Leveraging blockchain for ensuring trust in iot: A survey, Journal of</p>
      <p>King Saud University-Computer and Information Sciences (2021).
[28] Z. Huang, X. Su, Y. Zhang, C. Shi, H. Zhang, L. Xie, A decentralized solution for iot data
trusted exchange based-on blockchain, in: 2017 3rd IEEE International Conference on
Computer and Communications (ICCC), IEEE, 2017, pp. 1180–1184.
[29] G. Fortino, F. Messina, D. Rosaci, G. M. L. Sarné, Using blockchain in a reputation-based
model for grouping agents in the internet of things, IEEE Transactions on Engineering
Management 67 (2019) 1231–1243.
[30] B. Shala, U. Trick, A. Lehmann, B. Ghita, S. Shiaeles, Blockchain and trust for secure,
enduser-based and decentralized iot service provision, IEEE Access 8 (2020) 119961–119979.
[31] R. Di Pietro, X. Salleras, M. Signorini, E. Waisbard, A blockchain-based trust system for
the internet of things, in: Proceedings of the 23nd ACM on symposium on access control
models and technologies, 2018, pp. 77–83.
[32] C. F. Bazlamaçcı, K. S. Hindi, Minimum-weight spanning tree algorithms a survey and
empirical study, Computers &amp; Operations Research 28 (2001) 767–785.
[33] S. Ruzika, H. W. Hamacher, A survey on multiple objective minimum spanning tree
problems, in: Algorithmics of Large and Complex Networks, Springer, 2009, pp. 104–116.
[34] G. Pandurangan, P. Robinson, M. Scquizzato, et al., The distributed minimum spanning
tree problem, Bulletin of EATCS 2 (2018).
[35] P. C. Pop, The generalized minimum spanning tree problem: An overview of formulations,
solution procedures and latest advances, European Journal of Operational Research 283
(2020) 1–15.
[36] F. Y.-S. Lin, C.-H. Hsiao, Y.-F. Wen, Y.-C. Su, Adaptive broadcast routing assignment
algorithm for blockchain synchronization services, in: 2018 Tenth International Conference
on Ubiquitous and Future Networks (ICUFN), IEEE, 2018, pp. 487–492.
[37] W. Bi, H. Yang, M. Zheng, An accelerated method for message propagation in blockchain
networks, arXiv preprint arXiv:1809.00455 (2018).
[38] G. Li, X. Ren, J. Wu, W. Ji, H. Yu, J. Cao, R. Wang, Blockchain-based mobile edge computing
system, Information Sciences 561 (2021) 70–80.
[39] R. Antwi, J. D. Gadze, E. T. Tchao, A. Sikora, H. Nunoo-Mensah, A. S. Agbemenu, K. O.-B.</p>
      <p>Obour Agyekum, J. O. Agyemang, D. Welte, E. Keelson, A survey on network optimization
techniques for blockchain systems, Algorithms 15 (2022) 193.
[40] R. C. Prim, Shortest connection networks and some generalizations, The Bell System
Technical Journal 36 (1957) 1389–1401. doi:10.1002/j.1538-7305.1957.tb01515.x.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P.</given-names>
            <surname>Asghari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Rahmani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. H. S.</given-names>
            <surname>Javadi</surname>
          </string-name>
          ,
          <article-title>Internet of things applications: A systematic review</article-title>
          ,
          <source>Computer Networks</source>
          <volume>148</volume>
          (
          <year>2019</year>
          )
          <fpage>241</fpage>
          -
          <lpage>261</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. D.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <article-title>The internet of things: a survey</article-title>
          ,
          <source>Information systems frontiers 17</source>
          (
          <year>2015</year>
          )
          <fpage>243</fpage>
          -
          <lpage>259</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J. E.</given-names>
            <surname>Ibarra-Esquer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. F.</given-names>
            <surname>González-Navarro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. L.</given-names>
            <surname>Flores-Rios</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Burtseva</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>A. AstorgaVargas, Tracking the evolution of the internet of things concept across diferent application domains</article-title>
          ,
          <source>Sensors</source>
          <volume>17</volume>
          (
          <year>2017</year>
          )
          <fpage>1379</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Y.-K.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <article-title>Challenges and opportunities of internet of things, in: 17th Asia and South Pacific design automation conference</article-title>
          , IEEE,
          <year>2012</year>
          , pp.
          <fpage>383</fpage>
          -
          <lpage>388</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Migabo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K. D.</given-names>
            <surname>Djouani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Kurien</surname>
          </string-name>
          ,
          <article-title>The narrowband internet of things (nb-iot) resources management performance state of art, challenges, and opportunities</article-title>
          ,
          <source>IEEE Access 8</source>
          (
          <year>2020</year>
          )
          <fpage>97658</fpage>
          -
          <lpage>97675</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Zheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Xie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.-N.</given-names>
            <surname>Dai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Blockchain challenges and opportunities: A survey</article-title>
          ,
          <source>International journal of web and grid services 14</source>
          (
          <year>2018</year>
          )
          <fpage>352</fpage>
          -
          <lpage>375</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Ferrag</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Derdour</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mukherjee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Derhab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Maglaras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Janicke</surname>
          </string-name>
          ,
          <article-title>Blockchain technologies for the internet of things: Research issues and challenges</article-title>
          ,
          <source>IEEE Internet of Things Journal</source>
          <volume>6</volume>
          (
          <year>2018</year>
          )
          <fpage>2188</fpage>
          -
          <lpage>2204</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>X.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Ni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. P.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y. J.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Niu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Zheng</surname>
          </string-name>
          ,
          <article-title>Survey on blockchain for internet of things</article-title>
          ,
          <source>Computer Communications</source>
          <volume>136</volume>
          (
          <year>2019</year>
          )
          <fpage>10</fpage>
          -
          <lpage>29</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>L.</given-names>
            <surname>Kifer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Rajaraman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Shelat</surname>
          </string-name>
          ,
          <article-title>A better method to analyze blockchain consistency</article-title>
          ,
          <source>in: Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>729</fpage>
          -
          <lpage>744</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Jiang</surname>
          </string-name>
          , J. Wu,
          <article-title>Approaching an optimal bitcoin mining overlay</article-title>
          , IEEE/ACM Transactions on Networking (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>T.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , S. C.
          <article-title>Liew, Ethna: Analyzing the underlying peerto-peer network of ethereum blockchain</article-title>
          ,
          <source>IEEE Transactions on Network Science and Engineering</source>
          <volume>8</volume>
          (
          <year>2021</year>
          )
          <fpage>2131</fpage>
          -
          <lpage>2146</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>E.</given-names>
            <surname>Androulaki</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Barger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Bortnikov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Cachin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Christidis</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. De Caro</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Enyeart</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Ferris</surname>
            , G. Laventman,
            <given-names>Y.</given-names>
          </string-name>
          <string-name>
            <surname>Manevich</surname>
          </string-name>
          , et al.,
          <article-title>Hyperledger fabric: a distributed operating system for permissioned blockchains</article-title>
          ,
          <source>in: Proceedings of the thirteenth EuroSys conference</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>15</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>R. G.</given-names>
            <surname>Brown</surname>
          </string-name>
          , J. Carlyle, I. Grigg,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hearn</surname>
          </string-name>
          ,
          <article-title>Corda: an introduction</article-title>
          ,
          <source>R3 CEV, August</source>
          <volume>1</volume>
          (
          <year>2016</year>
          )
          <fpage>14</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kertesz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Baniata</surname>
          </string-name>
          ,
          <article-title>Consistency analysis of distributed ledgers in fog-enhanced blockchains</article-title>
          ,
          <source>in: International European Conference on Parallel and Distributed Computing (Euro-Par</source>
          <year>2021</year>
          ), volume
          <volume>27</volume>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>H.</given-names>
            <surname>Baniata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Anaqreh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kertesz</surname>
          </string-name>
          , Dons:
          <article-title>Dynamic optimized neighbor selection for smart blockchain networks</article-title>
          ,
          <source>Future Generation Computer Systems</source>
          <volume>130</volume>
          (
          <year>2022</year>
          )
          <fpage>75</fpage>
          -
          <lpage>90</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>G.</given-names>
            <surname>Fortino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Messina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Rosaci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. M. L.</given-names>
            <surname>Sarnè</surname>
          </string-name>
          ,
          <article-title>Using trust measures to optimize neighbor selection for smart blockchain networks in the iot</article-title>
          ,
          <source>IEEE Internet of Things Journal</source>
          <volume>10</volume>
          (
          <year>2023</year>
          )
          <fpage>21168</fpage>
          -
          <lpage>21175</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>R.</given-names>
            <surname>Albert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.-L.</given-names>
            <surname>Barabási</surname>
          </string-name>
          ,
          <article-title>Statistical mechanics of complex networks</article-title>
          ,
          <source>Reviews of modern</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>