## 3 Background
### Blockchain  
Blockchain is a decentralized, distributed ledger technology designed to securely record transactions without the need for a central authority [21,22]. Unlike traditional, centralized databases, blockchain operates on a peer-to-peer network where each participant maintains a copy of the ledger. Transactions are verified through cryptographic mechanisms and consensus protocols, ensuring integrity and transparency [23]. **Structure of Blockchain:**  
As shown in Figure 1, each block in the blockchain consists of several key components [24]:  
* Block Header: This contains metadata, including a timestamp, the hash of the previous block, the Merkle root of transactions, and, in Proof-of-Work systems, a difficulty target. These elements ensure that each block is uniquely identified and linked to the previous one. * Block Body: This stores a list of validated transactions. The transactions are structured in a Merkle tree, which allows for the efficient verification of the integrity and consistency of transaction records. * Nonce: This is a randomly generated number used in mining to adjust the difficulty level, ensuring that block creation remains computationally feasible yet resistant to attacks. * Genesis Block: This is the first block in the blockchain, which initializes the chain and serves as the foundation upon which subsequent blocks are built. Each new block references the hash of its predecessor, ensuring data integrity and immutability. **Choice of Blockchain:**  
The choice of Ethereum for this decentralized authentication protocol is based on several key technical factors that are crucial for ensuring the security, transparency, and robustness of the system. Although blockchains like IoTA offer superior performance in terms of transaction speed and energy efficiency, Ethereum has specific advantages for our application. Security and Maturity: Ethereum is a well-established blockchain, widely used for smart contracts and the development of decentralized applications. It offers a high level of  
Figure 1: Blockchain structure. security through its Proof-of-Work (PoW) consensus mechanism, and with the transition to Proof-of-Stake (PoS) in Ethereum 2.0, improvements in transaction speed and energy consumption are expected. This makes it suitable for an environment that requires strong guarantees regarding data integrity. Support for Smart Contracts: Ethereum allows the development of powerful and flexible smart contracts, which are essential for securely automating the authentication of IoT devices. These contracts enable the enforcement of precise rules, ensure transaction integrity, and securely manage key generation. Scalability Forecast: Although Ethereum currently has relatively slow transaction times and higher energy costs compared to some other blockchains, future developments (such as Ethereum 2.0 and sharding) are expected to significantly improve its scalability and performance. These advancements will better meet the needs of large-scale IoT environments. However, it is important to note that alternatives like IoTA, which does not rely on a traditional blockchain, offer faster transaction times and reduced energy costs, making them attractive for IoT applications where responsiveness and energy efficiency are paramount. IoTA, for instance, uses a Tangle to validate transactions more quickly and efficiently than traditional blockchain mechanisms. Nevertheless, Ethereum remains the optimal choice for this project due to its strong security, broad adoption, and mature development ecosystem. **Security Mechanisms in Blockchain**  
Blockchain security is reinforced through several mechanisms:  
* Public Key Infrastructure (PKI): Blockchain employs asymmetric cryptography [25], where transactions are signed using a private key and verified using a corresponding public key, ensuring authenticity and non-repudiation.