IoT Blockchain
IoT Blockchain
Using Blockchain
LUIS MIGUEL GARCÍA-SÁEZ, University of Castilla-La Mancha, Albacete, Spain
SERGIO RUIZ-VILLAFRANCA, University of Castilla-La Mancha, Albacete, Spain
JOSÉ ROLDÁN-GÓMEZ, University of Zaragoza, Zaragoza, Spain
JAVIER CARRILLO-MONDÉJAR, University of Zaragoza, Zaragoza, Spain
JOSÉ LUIS MARTÍNEZ, University of Castilla-La Mancha, Albacete, Spain
The rise of distributed architectures in Internet of Things (IoT) environments has signiicantly advanced both data processing
and artiicial intelligence. Notably, Multi-access Edge Computing (MEC) represents a distributed form of the Edge Computing
paradigm, focussing on heterogeneous protocol management. In contrast, Federated Learning (FL) is an application-level
framework designed to enable decentralised Machine Learning (ML) across devices without centralising data. Nevertheless,
the combination of both technologies enables the creation of more eicient, scalable, and responsive systems. However, their
integration into IoT brings substantial security challenges, including data poisoning, model manipulation, and the insertion of
false nodes, all of which threaten the reliability of FL systems. Blockchain technology emerges as a promising solution to these
challenges. It ofers a decentralised, transparent, and immutable framework that ensures the authenticity and veriication of
data across the network. Through blockchain, node interactions are automated and secured, enhancing the integrity and trust
in the learning process. This paper proposes a blockchain-based architecture for FL within MEC-IoT systems, designed to
mitigate security threats. The architecture emphasises data integrity, secure node interactions, and transparent audit trails
while maintaining optimal model performance and accuracy, even under attack. It highlights the low resource consumption
and minimal time overhead of blockchain integration, ensuring eiciency is not compromised. This integrated approach
improves data security, supports secure collaborative learning, and fosters a more resilient and trustworthy IoT ecosystem.
CCS Concepts: · Security and privacy → Distributed systems security; Network security; · Computing methodologies
→ Machine learning algorithms.
Additional Key Words and Phrases: Cybersecurity, Internet of Things, Multi-access Edge Computing, Blockchain, Smart
Contract, Federated Learning, Data Poisoning
1 Introduction
In recent years, the number of Internet of Things (IoT) devices has increased ivefold, rising from approximately 3.6
billion devices in 2015 to over 18 billion connected devices today [2]. The emergence of new network paradigms,
such as Multi-access Edge Computing (MEC), has brought numerous advantages to IoT devices. This is achieved
by bringing computational capabilities closer to the end user, thereby reducing latency for applications and
Authors’ Contact Information: Luis Miguel García-Sáez, University of Castilla-La Mancha, Albacete, Castilla-La Mancha, Spain; e-mail: luism.
garcia@uclm.es; Sergio Ruiz-Villafranca, University of Castilla-La Mancha, Albacete, Castilla-La Mancha, Spain; e-mail: sergio.rvillafranca@
uclm.es; José Roldán-Gómez, University of Zaragoza, Zaragoza, Aragon, Spain; e-mail: jroldan@unizar.es; Javier Carrillo-Mondéjar, University
of Zaragoza, Zaragoza, Aragon, Spain; e-mail: jcarrillo@unizar.es; José Luis Martínez, University of Castilla-La Mancha, Albacete, Castilla-La
Mancha, Spain; e-mail: joseluis.martinez@uclm.es.
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that
copies are not made or distributed for proit or commercial advantage and that copies bear this notice and the full citation on the irst page.
Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy
otherwise, or republish, to post on servers or to redistribute to lists, requires prior speciic permission and/or a fee. Request permissions from
permissions@acm.org.
© 2025 Copyright held by the owner/author(s). Publication rights licensed to ACM.
ACM 1557-6051/2025/9-ART
https://doi.org/10.1145/3767740
services compared to traditional Cloud Computing. These advances have facilitated the adoption of Federated
Learning (FL) techniques [47]. This approach has had a signiicant impact on various applications, including
hospitals and medical device communication networks [77], the Internet of Vehicles (IoV) [78], and the Industrial
Internet of Things (IIoT) [15].
This convergence of technologies represents an emerging paradigm in the development of network infras-
tructure and distributed models of Machine Learning (ML) and FL [52]. This interconnected environment brings
signiicant advancements in how data is processed and analysed by shifting processing and decision-making
closer to the MEC layer of the infrastructure. However, it also presents unique challenges in terms of data security
and privacy. In this context, IoT devices, which are often the source of data used in FL [81], may be vulnerable
to attacks that compromise the integrity of the learning process. Additionally, MEC architecture is designed to
process data close to its source and reduce communication latency with the edge server. However, it also adds
another layer of complexity to security management. This complexity is further enhanced by the distribution of
data processing across multiple MEC stations, where each edge server can process data sent by IoT devices. The
decentralised nature of these edge servers introduces additional security considerations as data is distributed and
processed across various nodes in the network [58].
In this environment, FL emerges as an innovative solution that enables IoT nodes to collaborate in the training
of Artiicial Intelligence (AI) models without centralising data. Each node uses its local data to train its version
of the model, preserving data privacy. However, despite the data remaining on the devices [44], the number of
attack vectors increases [16], posing signiicant security risks [18].
As MEC and IoT adoption expands, so do the associated security challenges. IoT nodes, often dispersed and
operating in potentially unsecured environments, become easy targets for attackers. The messages exchanged
by these devices often lack encryption due to their limited computational power, creating vulnerabilities that
attackers can exploit to compromise the FL process [27]. In response to these security challenges, the research
community has begun to focus on analysing these vulnerabilities and their impact on FL processes. However, few
studies ofer solutions to prevent the new attacks that are emerging in this ield [22].
Attacks aimed at compromising FL models, particularly through Byzantine attacks, are an increasingly signii-
cant threat [65]. Byzantine attacks aim to degrade the performance of the model through fake or malicious updates.
Among these attacks are data poisoning attacks, which are a research problem for the scientiic community and
whose impact is growing [64]. Data poisoning involves inserting false or misleading information into the training
data to degrade the accuracy and efectiveness of the model [9].
Real-world applications of MEC-IoT are particularly vulnerable to poisoning attacks. This vulnerability stems
from their distributed and resource-constrained nature. For instance, smart city deployments rely on edge-
based AI to process real-time sensor data [66]. In these systems, adversaries have successfully launched online
data poisoning attacks. These attacks manipulate urban service recommendations and predictions, even under
constrained computational conditions [84]. Similarly, MEC environments use location data for location-aware
analytics. Attackers can poison this location data to distort statistical outcomes. This manipulation severely
afects both service utility and user privacy [83].
Additionally, poisoning attacks have targeted IIoT systems. These attacks disrupt ML models used in predictive
maintenance and fault detection. Such disruptions can lead to unsafe operating conditions [12].
The distributed nature of FL, while beneicial for privacy and eiciency, complicates the detection and mitigation
of these attacks due to the lack of a central point for data integrity veriication. Furthermore, the inclusion of
malicious nodes in the network, which can manipulate and harm data or inal results, poses additional risks
[30]. These attacks range from the injection of false data to the subtle manipulation of model updates, critically
threatening the integrity and reliability of FL systems in MEC-IoT environments [26].
To address these security challenges, blockchain technology ofers a promising solution. The immutable and
transparent ledger of the blockchain, supported by a decentralised consensus mechanism, improves the integrity
and security of data transactions [14]. Integrating FL with an external blockchain not only strengthens resistance
to malicious attacks but also fosters trust among nodes, ensuring that model updates and shared data are veriiable
and non-repudiable.
In this work, we propose an enhanced security architecture based on the integration of blockchain and the
use of Smart Contracts (SCs). The main objective is to prevent attacks involving the inclusion of malicious
nodes in the MEC network or Byzantine attacks that degrade the model’s performance. We have designed a
node registration and authentication mechanism based on digital signatures and unique identiiers to ensure the
legitimacy of nodes. In addition, our system protects the parameters used during training, as well as the hashes
of the data used by each node, allowing the detection and mitigation of poisoning attacks. Given these aspects,
this work makes the following key contributions:
• Novel blockchain-based security architecture for FL in MEC-IoT: We propose a security framework
for FL in MEC-IoT environments, integrating a permissioned blockchain under Proof-of-Authority con-
sensus mechanism. This design combines eicient block validation, predictable latency, and decentralised
auditability throughout the learning process.
• Automated mitigation of poisoning attacks: The system employs dedicated SCs for the detection
and mitigation of both data and model poisoning attempts, enabling early identiication of compromised
updates in each learning round.
• Robust node registration and authentication for Sybil attack prevention: We introduce a dual-factor
registration and authentication mechanism, based on digital signatures and on-chain unique identiiers.
This mechanism is designed to efectively prevent Sybil attacks by ensuring that only legitimate clients
participate in the federation.
• Architecture validated in realistic and scalable scenarios: The validity of the proposal is established
through experimental validation with up to 200 clients in scalability and bandwidth consumption tests. In
addition, model performance is assessed under a wide range of conigurations, including diferent numbers
of clients, datasets, poisoning attack types, and system settings.
• Demonstrated scalability with low overhead: The results show that the integration of the blockchain
layer increases bandwidth consumption by only 6% with up to 200 clients, and the execution time overhead
remains below 7% for 20 clients. Even for federations with up to 500 clients, the projected temporal overhead
does not exceed 25%, conirming that the approach remains practical and eicient for large heterogeneous
MEC-IoT deployments seeking enhanced security.
The rest of the paper is structured as follows: Section 2 presents the key technologies involved in the proposal,
such as MEC, FL and blockchain, as well as the main attacks covered in our work. Section 3 discusses related
work in the area, pointing out some of the limitations of current solutions that are addressed in our proposal.
Section 4 details the environment deployed with the main proposal, whose results and viability are evaluated in
Section 5. Finally, Section 6 presents the most relevant conclusions of the proposal with possible improvements
and future work.
2 Technical Background
This section presents a review of the technologies utilised in our proposal. First, in Section 2.1, we introduce the
key characteristics of a MEC environment combined with IoT. Next, in Section 2.2, we review the fundamental
principles of FL processes, followed by an examination of the main Byzantine and poisoning attacks in Section
2.3. Finally, Section 2.4 analyses the main features of blockchain technology and justiies its viability as a solution
to enhance security and prevent certain attacks during FL process in MEC-IoT environments.
Local model
2
update
Client side
data poisoning and parameter poisoning [62]. Data poisoning typically involves injecting or manipulating the
training data to degrade the global model’s performance [69]. By contrast, parameter poisoning, also known as
model poisoning, targets the model updates themselves, either during transmission or aggregation. The goal
is to manipulate the training results without raising immediate suspicion. Poisoning attacks can be carried out
by attackers in multiple ways, most often employing Man-in-the-Middle (MitM) attacks together with network
traic interception and manipulation techniques and tools.
Despite the emergence of various defensive strategies in response [45], these attacks can be extremely efective.
Even a single malicious client can signiicantly reduce the performance of the overall model, potentially making it
completely useless. Within these two broad categories, multiple speciic poisoning methods have been identiied.
They may exploit diferent parts of the FL pipeline, ranging from targeted data manipulations to subtle distortion
of parameter updates. Among them, we can highlight the following speciic attacks [72]:
• Label Flipping Attack: The attacker alters the labels of a subset of training data to confuse the model
during training, degrading its accuracy by causing incorrect classiications. This attack is relatively easy to
carry out and requires only access to the dataset [31].
• Targeted Dropping Attack: This attack focusses on selectively removing critical or important data from
the training set, reducing the overall efectiveness of the model. Instead of targeting labels, it directly
impacts the data itself.
• Clean-Label Attack: Minimal but efective perturbations are introduced to the input data without changing
the original labels. Unlike label lipping, these poisoned data points appear as normal instances in the
dataset, making this attack particularly diicult to detect, as the altered data show no obvious diferences
in labels compared to their content [76].
• Parameter Tampering (Poisoning) Attack: This attack targets the parameters sent by the server to
the clients, aiming to compromise the learning process from the server’s side. If an attacker manages to
manipulate these parameters, they can signiicantly inluence the model’s behaviour, biasing the learning
process, or reducing its accuracy.
hash previous
Merkle Tree
timestamp
block
hash root
Block 7
Hash0 Transact0
Hash01
hash previous Hash1 Transact1
timestamp
block
Hash2 Transact2
hash root Hash23
Block 8 Hash3 Transact3
Hash4 Transact4
hash previous Hash45
timestamp
block Hash5 Transact5
hash root
Block 9
In our work, we focus on defending against both data poisoning and parameter poisoning attacks. The present
work is also designed to defend against the speciic attacks mentioned above, as they are all diferent types of
data or parameter poisoning attacks.
which can be immediately detected by comparing it to the agreed-upon root hash within the network. Thus,
Merkle Tree is essential for ensuring data integrity in the blockchain, as it makes altering transactions without
detection extremely diicult. This design is crucial for the scalability and security of blockchain systems.
An additional crucial element in both the design and functionality of a blockchain network is the consensus
mechanism. The consensus mechanism establishes trust among the network participants. The most widely
adopted mechanisms include Proof-of-Work (PoW), Proof-of-Stake (PoS), Practical Byzantine Fault Tolerance
(PBFT), and Proof-of-Authority (PoA) [35]. PoW is the foundational mechanism used by Bitcoin, relying on
computationally intensive tasks to validate transactions and secure the network [25]. Despite its strong security
guarantees, PoW is resource-intensive, limiting its scalability and eiciency, particularly in MEC-IoT scenarios.
In contrast, PoS, PBFT, and PoA provide more energy-eicient alternatives [55]. PoS, employed by Ethereum
2.0, selects validators based on the amount of cryptocurrency they stake as collateral, drastically reducing energy
consumption. PBFT, on the other hand, achieves consensus through a voting mechanism among designated
validator nodes, ofering high transaction throughput and fast inality. Nevertheless, while PBFT is well-suited
for permissioned networks with known participants, its scalability diminishes in large-scale decentralised
scenarios. PoA improves on scalability and eiciency by assigning transaction validation responsibilities to
pre-approved, trusted nodes (authorities). It ofers high performance, minimal computational overhead, and
predictable transaction throughput, making it especially suitable for private and consortium blockchain networks.
In addition, SCs are another fundamental element in most current blockchain networks [39]. They were
introduced with the advent of the Ethereum network [10]. Now, SCs are key in the development of applications
and programs within blockchain networks. An SC is a computer program embedded in the blockchain that
automatically executes when certain conditions or requirements are met, or can be triggered to perform speciic
actions. It allows processes such as veriication, execution, and fulilment of the contract’s terms to be carried
out automatically. Since the execution occurs within the blockchain, the SC remains immutable and distributed,
providing a high level of security.
3 Related Work
This section examines some existing studies and proposals that use blockchain to enhance security in FL
environments [29].
In recent years, signiicant eforts have been made to integrate blockchain technology with Edge Computing
and FL in IoT environments, focussing on enhancing data security, reliability, and authentication mechanisms.
Begum et al. [13] introduced an eicient compression and encryption technique for data protection based
on the Burrows-Wheeler Transform (BWT), Move-to-Front Transform (MTF), and Run-Length Encoding (RLE).
Their method achieves high compression rates and robust encryption through secret keys, with the aim of
optimising storage and transmission. Babu et al. [11] proposed “Sec-edgež, a trusted blockchain system designed
to strengthen identiication and authentication in edge-based 5G networks. Their solution leverages blockchain
decentralisation to manage edge devices securely, focusing primarily on authentication mechanisms. Aguru et
al. [6] presented “Reliable-RPLž, a reliability-aware Routing Protocol for Low-power and Lossy Networks (RPL)
enhanced with blockchain. This approach signiicantly improves routing reliability through trust-based metrics,
facilitating the detection and mitigation of malicious nodes.
Despite these valuable contributions, the discussed methods exhibit several limitations. Begum et al.’s approach
is susceptible to plaintext-based attacks and does not explicitly consider malicious node scenarios. The scalability
and adaptability of Babu et al.’s Sec-edge framework beyond speciic 5G contexts remain limited, and Aguru et al.’s
Reliable-RPL introduces substantial overhead unsuitable for lightweight IoT devices. These gaps underscore the
need for more specialised proposals that address speciic threats within FL environments, such as data poisoning
and model manipulation. The following works discuss targeted solutions explicitly designed to mitigate these
sophisticated threats in FL contexts.
Xu et al. [75] proposed BESIFL, a blockchain-based FL framework that identiies and removes malicious nodes
by analysing their detrimental efects on model accuracy. This approach leverages blockchain technology to
enhance security and trust in FL environments. However, the system is primarily based on random node selection
and lacks mechanisms for proactive mitigation of sophisticated attacks. In a similar vein, Fang et al. [20] proposed
BCFL, which focusses on enhancing trust and eiciency in FL processes. Despite its strengths, BCFL provides
limited protection against advanced threats, such as targeted poisoning attacks. Furthermore, it does not include
continuous dataset integrity veriication or a robust authentication scheme capable of preventing Sybil attacks.
Additionally, both frameworks ofer minimal insight into performance scalability and the computational impact
of blockchain integration.
Besides, several innovative proposals use blockchain as a system to detect and monitor the entire FL process.
Many of these approaches involve storing and analysing local updates of network nodes on the blockchain to
dynamically detect potential poisoning attacks, as seen in the work by Preuveneers et al. [56]. However, a major
drawback of this proposal is the signiicant increase in total latency due to communication with the blockchain.
Similarly, Al Mallah et al. [7] propose blockchain-based monitoring to identify malicious activities, but their
solution lacks clarity regarding the speciic iltering mechanisms used for legitimate miners, and does not provide
comprehensive performance metrics such as latency or execution overhead, critical for evaluating real-world
feasibility.
Other proposals rely on a scoring or reputation system for nodes [33]. Lei Feng et al. [21] suggest the use of a
blockchain system combined with node scores, calculated based on an entropy value. This entropy is used to
evaluate and weigh the importance and reliability of local models trained by the nodes during learning. The
blockchain records these weights along with local model updates and the global model. This mechanism helps
identify and mitigate malicious updates by detecting and excluding malicious nodes from the network. While
robust and efective, this approach introduces complexity through entropy calculations, which must be carefully
balanced to ensure equitable contributions from nodes and the quality of the global model.
Some authors, such as Adi Paramartha Putra et al. propose comprehensive FL frameworks [5] supported
by blockchain to guarantee the traceability and immutability of actions taken, using SCs, and implementing a
system of incentives and penalties for nodes participating in the learning process. Kalapaaking et al. [32], propose
another FL framework combined with blockchain, where blockchain is used as a monitoring system that records
the necessary information during the training process for auditing purposes. However, most of these frameworks
address vulnerabilities and potential attack vectors in FL environments in a very general way, without focussing
on speciic attacks or their impact.
In addition, Kasyap and Tripathy propose PrivateFL [34], a FL framework that integrates a permissioned
blockchain (Hyperledger Fabric) to enhance privacy and security against Byzantine attacks. They introduce the
Vertically Partitioned Secure Aggregation (VPSA) algorithm, which vertically partitions local model updates
across diferent peers in the blockchain network, ensuring that no single peer has access to the full update. This
partitioning not only helps in securing the data, but also enables Byzantine robustness by allowing for a more
controlled and secure aggregation process.
Thus, some recent studies aim for greater decentralisation by replacing the central server that coordinates FL
with a blockchain network [43, 80]. This blockchain is used to store the global model and send local updates from
the nodes. Many of these studies incorporate the design of speciic consensus algorithms for FL processes [17].
These studies often focus on rewarding honest devices 1 more frequently, ensuring that only legitimate updates
are used to update the global model. This approach seeks to minimise the risk of malicious nodes inserting false
1 Honest devices are those that send correct updates of their local model
updates into the blockchain. However, this is not a direct solution to poisoning attacks and does not prevent an
attacker with full control over a node from continuing to send incorrect updates of its local model.
Finally, Table 1 presents a comparison of the works mentioned above. Key features of them are analysed, such
as the blockchain solution taken, the authentication method used, attacks covered, and the type of blockchain
employed for the implementation. Broadly, the literature leverages blockchain in FL through two complementary
yet distinct paradigms. In the irst, the ledger operates as an active component of the training loop. SCs logic
triggers every round, local model updates are persistently recorded on-chain. In several cases, the parameter-
aggregation step is executed directly within the blockchain itself or the chain is polled continuously as a live
monitoring oracle. While this design maximises transparency and tamper-resistance, it imposes a substantial
computational and bandwidth burden on resource-constrained edge devices. The second paradigm is lighter and
more economical. The blockchain is consulted only at strategically important checkpoints. It acts as an immutable
repository for concise cryptographic digests or other key artefacts. These are veriied by the nodes during critical
stages of the FL worklow. By avoiding constant interaction, this approach preserves most security guarantees
whilst minimising latency and energy consumption. This design principle underpins the architecture proposed in
this work. Based on these diferences, we distinguish between Active/Passive blockchain approaches in the table.
Despite the diversity of approaches presented in the literature, some existing proposals do not incorporate
robust authentication mechanisms at the node level. This is a crucial aspect when trying to prevent Sybil attacks
and the insertion of malicious participants into FL environments. Many solutions depend on reputation or scoring
systems, typically using heuristic evaluations or entropy values. This can help identify and kick malicious nodes.
It can also detect when legitimate participants are being poisoned. However, these methods add complexity and
computational overhead while ofering no attack guarantees. That’s due to the fact that accurate calibration
of the voting system is required and does not prevent nodes from sending poisoned updates in the initial
rounds of poisoning. Other approaches monitor model updates actively or store complete learning histories on
blockchain. This leads to high communication latency and resource demands, key concerns for IoT and MEC
systems with limited resources. In addition, few studies quantify the scalability and computational costs of
blockchain integration. Without these metrics, assessing the feasibility of large-scale deployments in the real
world remains a challenge.
To overcome these limitations, our work introduces a modular and lightweight blockchain architecture. Our
architecture is built upon permissioned Ethereum with PoA consensus algorithm. This design leverages the
lexibility of SCs to deliver precise security enforcement without incurring unnecessary overhead. The system
implements a dual-factor authentication scheme based on digital signatures and unique blockchain-issued
identiiers. This approach ensures the legitimacy of the participating nodes and efectively prevents unauthorised
access [42]. Instead of storing entire model updates, our solution focusses on validating the parameters and
datasets used in each training round. This strategy enables early detection and mitigation of both data and
parameter poisoning attacks. The blockchain is used passively, only during key stages of the FL process. This
selective utilisation helps minimise latency and preserve system responsiveness. Through this design, we provide
a generalisable and scalable security layer. It explicitly targets the most pressing threats in FL environments. This
approach is supported by comprehensive experimental evaluation. The system has been tested with up to three
widely adopted ML and FL datasets: Fashion-MNIST, Iris-Flower, and MNIST [46]. Our tests demonstrate the
system’s efectiveness in protecting against sophisticated poisoning attempts while maintaining low computational
and temporal impact.
Blockchain +
[56] 2018 autoencoders for None Passive Parameter poisoning CICIDS2017 N/A +5 to 15% Not speciied
anomaly detection
Blockchain + Permissioned
[21] 2022 SC Active Parameter poisoning MNIST N/A N/A
reputation system (Hyperledger Fabric)
CIFAR-10,
SCs + multisignature Not speciied (suggests
[32] 2024 Multisignature + SC Passive N/A Fashion-MNIST, N/A +5 to 20%
scheme permissioned)
MedMNIST
CIFAR-10,
Custom aggregation Parameter & Data Permissioned
[34] 2024 Double signature Active Fashion-MNIST, N/A +24.5%
+ double signature poisoning (Hyperledger Fabric)
MNIST
SCs + secure
Digital Signatures + Parameter & Data Fashion-MNIST, Permissioned
Our proposal 2025 authentication Passive +1 to 6% +5 to 20%
Node ID (SC) poisoning + Sybil Iris-Flower, MNIST (Ethereum PoA)
system
mitigate the deiciencies in the learning process and ensure the validity of the data. Key features include the
immutability of data stored in the ledger, the public nature of the ledger, which provides transparency and
traceability to transactions, and the ability to execute SCs.
SCs are the primary tool used to combat poisoning attacks and ensure the legitimacy of nodes participating in
the FL process. They allow for the deinition of customised and speciic rules that determine their functionality,
execution conditions, and access policies. This control ensures that access to the SCs and their internal functional-
ities is restricted to authorised network nodes. Using these features and their automation capabilities, we created
a combined communication architecture that enables automatic management and queries within the blockchain
during the FL process. This real-time integration helps mitigate the efects of previously described attacks.
without the need for intermediaries. Additionally, Ethereum boasts a comprehensive ecosystem of development
tools that further enhances its usability for developers. Moreover, its inherent lexibility allows for operation
within public and permissioned network conigurations. These attributes collectively position Ethereum as a
highly suitable framework for the implementation of scalable and adaptable security solutions, thereby enabling
efective responses to the various threats encountered in MEC-IoT environments.
Under the PoA consensus protocol, a network of 5 blockchain nodes has been deployed. PoA difers from
other consensus algorithms (such as PoW or PBFT) in that it requires a small number of designated validators to
authenticate and add new blocks [36]. Validators are often referred to as “authoritiesž.
Unlike PoW, PoA does not require computationally intensive mining. This lower resource usage helps maintain
tight latency budgets and reliability, especially given the limited capabilities of many edge devices. In the proposed
design, consensus is managed by a total of 5 validator nodes, all of which are deemed to meet the requisite
trust requirements. This simpliied structure serves to eliminate the overhead associated with large-scale or
untrusted participants [49]. Using 5 validator nodes balances fault tolerance and overhead for PoA efectively.
This coniguration compares favourably with other consensus algorithms that typically require larger validation
groups. Byzantine Fault Tolerance (BFT)-based protocols often require at least 3� + 1 nodes to tolerate � malicious
or crashed participants, rapidly increasing communication overhead. Similarly, public PoS networks face their
own challenges. They tend to rely on large pools of randomised stakers to ensure robust decentralisation. This
approach introduces greater complexity and latency to the system. By contrast, PoA ofers a more eicient
alternative. Its reliance on a carefully vetted set of authorities enables strong resilience with only ive nodes. Even
if one fails or acts maliciously, the remaining four can override its decisions.
This proposal uses an Ethereum permissioned network platform, which has been speciically conigured to meet
the requirements of the intended research. This setup enables stringent control over the testing environment, thus
eliminating the inancial burdens associated with gas fees and the high latencies typically encountered in public
networks. However, our work maintains the concept of gas as a metric to evaluate the relative computational
cost of operations performed within the network.
In the context of Ethereum, gas is a unit of measurement that is employed to calculate the computational
cost of operations that are performed on the blockchain network. Such operations may include the execution of
SCs or the transfer of data. The computational cost of operations performed on the Ethereum Virtual Machine
(EVM) is determined by the amount of gas required, with the cost being ixed for each operation [1]. This ensures
that operations consume resources in line with their processing demand, which is fundamental to maintaining
network eiciency. In contrast to a public network, gas does not have a tangible economic cost in permissioned
networks because there are no economic incentives for nodes within this controlled environment. This approach
enables the validation of SCs eiciency and the simulation of computational impact.
Although there is no tangible economic cost associated with a permissioned Ethereum network, it is possible to
perform a computational estimation of the gas expenditure incurred for each transaction [37]. The gas consumed
by a transaction is the sum of the costs associated with the individual operations (opcodes) executed within
the transaction [63]. The costs associated with each individual transaction are integrated within the EVM and
deined in the Ethereum Yellow Paper [71]. Consequently, the total gas consumption can be estimated as follows:
︁
�
Total Gas Used = Base Gas + Gas(������� )
�=1
The gas cost for processing a transaction consists of two main components: the Base Gas, which is a ixed
gas cost of 21,000 gas for a standard transaction, and the Gas (������� ), which represents the gas cost for each
operation (������) executed during the transaction. The total gas consumed depends on the number (�) of
operations (�������) executed as part of the transaction.
The Total Gas Used refers to the total gas consumed by the transaction, calculated using the formula above. The
Gas Price is the price per unit of gas, which is set in Gwei (1 Gwei = 10−9 ETH).
In Figure 3, we can see an overall view of the environment that combines both the blockchain network and
the MEC-IoT network. The lower part of the igure identiies the MEC-IoT network, where the nodes execute
the FL algorithm. This MEC-IoT network communicates with the blockchain network, which is depicted in
the upper part of the igure. A series of SCs have been designed to allow the diferent nodes in the MEC-IoT
network to interact with the blockchain and access the various functionalities of these SCs while the FL process
is carried out. Once these SCs are introduced into the network’s ledger, they become immutable and unalterable,
making them resistant to attacks. The SCs for this solution have been implemented in Solidity [28], the native
programming language of the Ethereum platform. This choice leverages the maturity of the Ethereum ecosystem.
It includes a robust suite of development tools (such as Remix and Trule) and its widespread deployment in
various blockchain applications [50]. The deployment allows for precise control over node membership and
access, ensuring that only authorised participants can interact with the SCs. This controlled setup supports
rigorous testing and iterative development processes. Furthermore, it facilitates scalability and adaptability when
deployed in MEC-IoT scenarios. Thus, the environment enables comprehensive evaluation prior to real-world
implementation, ensuring that the developed solutions meet the necessary standards.
MEC-IoT nodes interact with the SCs deployed on the blockchain through a communication interface designed
to ensure eicient and secure operations. This interface allows MEC-IoT nodes to run the necessary functions
without having to store the blockchain, signiicantly reducing their resource requirements. The blockchain nodes,
meanwhile, manage transaction validation and network updates, ensuring the integrity of the stored information.
This modular design separates the roles between MEC-IoT nodes and blockchain nodes, facilitating the scalability
and robustness of the system. The function of the MEC server is of paramount importance in the architecture.
The MEC server acts as the primary coordinator for the FL process, managing key tasks such as global parameter
distribution, local update veriication, and inal model aggregation.
Blockchain SC 1 SC N
network
MEC-IoT network
Node 1 Node 3
Node 1 Node 3
Node 2 Node N
Server
Node 2 Node N
Ledger
Success/Failure
The irst SC, referred to as “Authentication Contractž, has been speciically designed to ensure the legitimacy
of all network nodes and prevent potential Sybil attacks. Figure 4 illustrates the behaviour and interaction low
with this SC. Before interacting with this contract, each node will generate a public-private key pair, making each
node responsible for the security of its private key. To secure private keys, AES-256 encryption [40] is employed,
using a securely derived key from a password via a robust key derivation function such as PBKDF2 with SHA-256
[38]. This approach ensures an additional layer of security by enhancing key entropy and resilience against
brute-force attacks, making it signiicantly more challenging for attackers to access a node’s private key, even if
they obtain physical access to the node.
Through this SC, the network nodes must register on the blockchain platform, allowing the network to
recognise the existence of the node and store its public key. Upon registration, the node will be assigned a unique
Node Identiier (ID), which will be used for a dual authentication system based on the public-private key pair and
the node’s ID. The IDs are generated through an internal control mechanism of the SC, taking the public key of
the node as input, ensuring their unicity in the network, given the impossibility of having 2 nodes registered
with the same public key.
To authenticate the node, it must digitally sign a piece of content using its private key. The blockchain will then
verify the authenticity by retrieving the node’s public key using the hash of the signature and data, and checking
if the node is registered in the system. Finally, it will ensure that this public key is linked to the requesting node’s
ID and not to another node. In this way, we make it diicult for an attacker to be able to introduce fake nodes
without being detected, by using the immutable ledger of the blockchain to store the IDs and public keys of
legitimate nodes, discarding any nodes that are not in the registry.
This Authentication Contract is essential for the proper functioning of the network, as node authentication will
determine whether the node can access the functions of the second SC. The second SC, referred to as “Poisoning
Mitigation Contractž, has been speciically designed to counteract data and model parameter poisoning attacks in
FL:
Data Poisoning. To prevent data poisoning during training and evaluation processes, this SC is responsible for
storing certain information. Initially, it will store four identifying hashes for the data and labels of the global
dataset to be used. This allows for quick identiication and detection of poisoning attacks, such as Label Flipping
or Targeted Dropping, if an attacker modiies any data or labels. Additionally, each node generates 10 partitions
from the initial dataset and randomly selects one for training. The contract will also store a combined hash for
the data and labels of each subset selected by the nodes, ensuring data traceability from start to inish.
Parameter Poisoning. To counteract these attacks, the contract is designed to communicate with the MEC server.
The parameters sent by the server to each client participating in the process will be stored on the blockchain.
Before starting the training and evaluation phases, each client will verify that the parameters received from the
server match those stored on the blockchain. This prevents an attacker from intercepting and maliciously altering
the model parameters during client-server communication.
Thanks to the dual authentication process based on digital signatures and node IDs, implemented in the irst
SC, we ensure the legitimacy of all network nodes. An attacker will not be able to introduce a node into the
network on a surreptitious basis without being detected. The public keys of legitimate nodes are registered on
the blockchain, so if an unknown public key is detected, it will be immediately identiied. Additionally, each node
must pass the relevant SC authentication process to access the functionalities of the FL process. The dual-factor
authentication of this SC function ensures that even if an attacker gains access to a node’s private key, they
would still need to obtain the node’s unique ID, which was assigned by the blockchain.
At the start of each training round, the server retrieves the latest global model parameters, publishes them on
the blockchain through the Poisoning Mitigation Contract, and forwards them to participating IoT nodes. Each
node veriies these parameters against the on-chain version before training locally on its dataset partition. Upon
completion, nodes submit hashes of their updated models to the contract, indicating a valid training round. The
server then gathers these veriied local models and combines them via a FedAvg-like strategy [48], producing a
new global model that is once again stored on the blockchain for veriiability. Should a node attempt to introduce
a poisoned model, the on-chain record of historical hashes enables the server to detect inconsistencies. In such
cases, the server can exclude the compromised node’s contribution from the aggregation and revert to the previous
trusted model when an attack is discovered after aggregation.
To further mitigate poisoning attacks once the FL process has begun, a communication scheme has been
designed. The following is a detailed, numbered, step-by-step explanation of how the system detects and mitigates
poisoning attempts. It follows the nine main steps shown in Figure 5. Each step speciies which entity (server or
client) performs the action. The process highlights how the MEC server coordinates the FL worklow and ensures
secure model updates.
1. Store Initial Parameters (Server). Before sending global model updates, the server records the initial model
parameters on the blockchain. This creates a tamper-evident baseline.
2. Send Parameters to Clients (Server). The server retrieves the latest global model parameters from the blockchain
or local storage, stores them on-chain if needed for transparency, and then distributes these parameters to
participating IoT nodes.
3. Store Dataset Hash (Server). The server calculates the global dataset’s hash and records it in the Poisoning
Mitigation Contract. By maintaining this reference on the blockchain, nodes can subsequently ascertain whether
training data have been compromised.
4. Obtain and Verify Data Hash (Client). On receiving the dataset, the client compares its locally computed
dataset hash with the hash stored in the contract (Step 3). If they do not match, the client halts training and lags
possible data poisoning.
Blockchain Network
Blockchain
Smart Contract Store model parameters 1
Send parameters to
2
clients
MEC-IoT
6 Obtain and verify model
6
Network 5 parameters
4
7 Obtain and verify subset
7
data hash
2 8
Store new valid local
8
model
9
Return local model
9
parameters
Client node
Server node
5. Store Subset Data Hash (Client). Before training on a local dataset partition, it is necessary for the client
to create and store a hash of that partition on the blockchain. This step ensures detection of data poisoning or
inconsistencies, even at the partition level (e.g. partial tampering).
6. Obtain and Verify Model Parameters (Client). The client checks whether the model parameters received from
the server (Step 2) align with the values listed on the blockchain. If a diference is detected, the client discards
these parameters and signals potential parameter poisoning.
7. Obtain and Verify Subset Data Hash (Client). The client retrieves its previously stored subset hash and
cross-checks it with its local partition. Any discrepancy points to potential data poisoning or corruption in the
partition.
8. Store New Valid Local Model (Client). After conirming both the dataset and parameters, the client completes
local training. It then calculates a hash of its newly trained model and stores that hash on-chain. This step
preserves a trustworthy record of the local update.
9. Return Local Model Parameters (Client). Upon completion of the training phase in this round, each client is
required to return its parameters to the server. The server also compare these returned parameters against the
on-chain hash (Step 8) to detect inconsistencies or poisoning.
Veriied local model updates are collected and then aggregated by the server using a custom approach to
generate a new global model. The approach selected for the implementation is a custom version of FedAvg. The
server then writes these updated parameters to the blockchain, ensuring that subsequent nodes see a tamper-
evident global state. Subsequently, a similar procedure is applied during the evaluation phase. The system veriies
the integrity of both the model parameters and the evaluation data by cross-referencing them with the blockchain.
Upon completion of the evaluation, performance metrics are transmitted back to the MEC server. This marks the
conclusion of the initial training round within the FL process. Following rounds of the FL process are deined by
an iterative process, leading to the eventual convergence of the inal model parameters. This detailed procedure
ensures continuous traceability of both data and model parameters throughout the entire FL process. As a result,
the system remains capable of detecting poisoning attacks at any stage.
In addition, a historical record of the valid and integrated updates of the local model of each of the nodes has
been implemented. This historical record is implemented in order to have a valid model in case of parameter
poisoning in any learning round. In this case, in that training round, the blockchain is accessed and that node
obtains the last valid model trained, which is the one from the last valid training round carried out.
In case of detecting data poisoning in a training round, the poisoned node checks through the blockchain
the validity of the model parameters received from the server. In case of validity and correspondence with the
parameters stored by the server in that round within the blockchain, in that training round, those parameters
are returned by the node to the server. This ensures that the parameters added by the server in the last training
round are returned, which ofer better performance than the last valid parameters of the local model of that node.
Whenever a poisoning attack is detected, a warning is displayed to indicate the presence of poisoning on the
afected node. In response, the system uses the blockchain to retrieve the last valid local model for that node or
the model received from the server during that training round.
Thanks to the architecture implemented and the communication scheme designed for IoT nodes interacting
with the blockchain, we have successfully prevented the inclusion of malicious nodes. This mechanism ensures
that such nodes cannot negatively afect the performance of our model. We have also managed to detect and
reduce the impact and risk of poisoning attacks. These attacks could otherwise degrade model performance
by manipulating the data used for training and evaluation, or by altering the model parameters sent by the FL
coordinator server to the client nodes.
5 System Evaluation
This section provides a comprehensive evaluation of the proposed system. The analysis focusses on assessing
the impact of the poisoning attacks mentioned above, as well as the efectiveness and eiciency of integrating
blockchain into the FL process within the MEC-IoT environment. Initially, we devise a comprehensive suite
of experimental scenarios that vary the size of the participating node set. Each scenario is tested on several
benchmark datasets and is subjected to a spectrum of data poisoning and parameter poisoning attacks. These
range from subtle label lipping to aggressive parameter tampering, revealing the impact of threats of difering
severity on the model’s performance. Secondly, we evaluate the impact of the blockchain on the system and
the total learning time. This evaluation includes an assessment of network bandwidth consumption caused
by blockchain operations. We analyse how blockchain operations, which include blockchain transactions and
consensus mechanism activities, afect available bandwidth. Additionally, we examine the blockchain’s ability to
scale efectively and be deployed in learning processes with a large number of nodes. This comprehensive analysis
helps us to understand the full resource footprint of blockchain integration in distributed learning environments.
For the initial setup of the MEC-IoT environment, the MECInOT emulator was used [61]. This emulator
facilitates the deployment of MEC-IoT topologies for experimentation in a cybersecurity context. Among its many
features, MECInOT ofers a realistic environment for conducting experiments and obtaining data similar to what
would be collected in a real topology, without the need for physical devices. Furthermore, MECInOT provides
great lexibility in determining the number of IoT devices to deploy in the network through virtualisation and
also supports the inclusion of real network devices.
Parameter poisoning ś network proxy. The attacker controls the link between the client and the server. We
insert a transparent proxy that relays every message, but tweaks the tensors as they pass. It adds a tiny or large
perturbation to the model parameters on the way to the client. The speciic impact will depend on the particular
implementation of the attack used for each experimental scenario. From both endpoints, the round appears
normal, yet the values have already been corrupted in transit.
Data poisoning ś local loader hook. Because raw data never leave the device, the attacker must tamper inside
the client. A short hook is placed in the data-loading routine, which is run once, just before the irst local
epoch. This hook quietly edits a chosen slice of the resident dataset, removing, relabelling, or slightly perturbing
samples. Subsequently, the training process is continued without modiication, although using data that has been
compromised.
In the experiments, we have considered diferent degrees of attack severity in order to analyse the resilience of
the proposed solution under a wide range of threat conditions. For data poisoning, we have applied three levels
of manipulation. First, a mild target dropping, where only a small fraction of the training samples are altered.
Second, a label lipping attack, in which a percentage of the evaluation labels are inverted to mislead the model
during assessment. Finally, a combined attack that uses both target dropping and label lipping to maximise
disruption. In the case of parameter poisoning, we designed three corresponding levels. One approach applies a
lightweight perturbation that introduces low-magnitude noise. Another variant uses a medium impact attack,
adding a broader band of random noise to the parameters. The third is a critical attack, where the parameter
vectors received from the server are fully inverted and further disturbed, pushing the global model into highly
unstable regions.
5.2.1 Evaluation Metrics. In ML, multiple metrics are used to evaluate the performance of classiication models.
Before deining these metrics, we introduce the following concepts:
• True Positives (TP): Correctly predicted positive class instances.
• True Negatives (TN): Correctly predicted negative class instances.
• False Positives (FP): Negative instances wrongly classiied as positive.
• False Negatives (FN): Positive instances wrongly classiied as negative.
Using these deinitions, we can derive the following evaluation metrics:
• Precision: The proportion of true positive predictions among all positive predictions. Precision indicates
how accurate the model is when predicting the positive class.
TP
Precision =
TP + FP
• Recall: The proportion of actual positive observations that were predicted correctly. Recall measures the
model’s ability to identify all positive instances.
TP
Recall =
TP + FN
• F1-Score: The harmonic mean of precision and recall, representing a balance between the model’s ability
to correctly identify positive cases and its minimisation of false positive and false negative errors.
Precision · Recall
F1-Score = 2 ·
Precision + Recall
In this work, the F1-Score is used to evaluate the performance of the model, as it balances the correct identii-
cation of positive cases (recall) and the avoidance of false classiications (precision). Moreover, the F1-Score is
particularly robust in scenarios with imbalanced datasets, which is a common occurrence in FL environments
where heterogeneous data sources may co-exist.
In FL systems, especially under poisoning attacks, precision and recall become critical. Misclassifying a poisoned
sample as clean (FN) or a clean sample as poisoned (FP) can have signiicant downstream consequences. The
F1-Score helps to ensure that both types of errors are minimised, making it a reliable metric in these challenging
scenarios.
We also deined the following metrics used to measure the impact of blockchain network on the learning
process:
• Execution Time (ET): This timeframe covers from the moment the process is initiated by the server until
all clients complete their training rounds and the inal version of the global model is obtained. Used as
primary performance measure.
• Delay: Metric to refer the time diference in the learning process when using the proposed solution or not.
5.2.2 Performance Evaluation. To determine how both the timing and nature of an attack inluence learning
dynamics, we consider 4 test scenarios. These test cases combine data poisoning and parameter poisoning
attacks mentioned above. We also incorporate two diferent injection moments, an early poisoning that strikes
immediately after round 2, and a late poisoning that strikes after round 5. Each case runs on a federation in which
40% of the clients behave maliciously, letting us trace the efect of the same defence across distinct stages of the
training process.
The initial experiment is a 10-node experiment using the MNIST dataset. The data level attack employs
controlled target dropping, subtly altering 30% of the training data. Besides that, the parameter level attack injects
a small amount of zero-mean Gaussian noise into model updates. Figure 6 plots Precision, Recall, and F1-Score
(left-to-right) over 10 FL rounds, comparing the baseline against the 4 deined poisoning scenarios. In every
panel, the blue line is the optimal case, which serves as the reference performance. Two curves track data level
poisoning. The orange line shows the early poisoning attack (40% of clients corrupted after round 2) and the
green line shows the late poisoning attack (after round 5). The remaining two curves capture parameter level
poisoning. The red line corresponds to the early variant, while the purple line represents the late variant.
3 U H F L V L R Q
) 6 F R U H
5 H F D O O