# Survey of Blockchain-Based Applications for IoT
## 2 Background
### Blockchain  
Blockchain technology links blocks by incorporating the hash of the header of each previous block into every new block, thereby creating an unbroken chain [3]. If a previously added block is modified, its hash changes, causing a ripple effect that alters the hashes of all the subsequent blocks. This structure makes tampering evident: any change to a single block disrupts the entire chain, enabling the network to detect and discard the altered blocks. This method of linking blocks is fundamental to the blockchain's ability to maintain its data integrity and transparency. Figure 2 below shows a general blockchain structure, where each block contains a hash from the previous block. This linkage creates a secure and immutable chain, ensuring the integrity of the data within the blockchain. Each block not only holds its own data but also references the hash of the prior block, thereby establishing a chronological order and making it difficult to alter information retroactively. This is a fundamental principle that underpins the security of blockchain technology [3]. The hash in each block header includes a Merkle Root, which serves as a cryptographic summary of all transactions in that block [10]. By organizing transactions into a Merkle Tree, blockchain networks ensure efficient verification and data integrity. Any modification to a single transaction alters its hash, propagating changes up the tree and ultimately modifying the Merkle Root, making tampering easily detectable. This structure enables lightweight Simplified Payment Verification (SPV), allowing nodes to confirm transactions without downloading the entire blockchain [11], enhancing scalability and security in decentralized systems. Figure 3 below shows a general overview of the Merkle Tree and how it aggregates the hashes of all transactions in the block. This method allows efficient verification of transactions, as changing any transaction at the leaf level alters the corresponding hash and propagates up to the root hash. This structure ensures data integrity and consistency, making it an essential component in blockchain systems. Because a blockchain is a decentralized system without central authority, nodes or peers in the network must have a process for validating each block before adding it to the chain. This process is known as consensus [3]. The concept of consensus is a core component of blockchain technology. Specific consensus algorithms require substantial computational resources. Therefore, it is essential to choose an algorithm that aligns with the requirements of the application and capabilities of the nodes in a blockchain network. Table 1 below shows the common consensus algorithms. Proof-based algorithms, such as Proof of Work (PoW), deliver strong security and fault tolerance but require  
Figure 2: General blockchain structure. significant computational resources [3]. Conversely, voting-based algorithms such as Practical Byzantine Fault Tolerance (PBFT) [12] use less computational power but generally have lower fault tolerance, making them well-suited for controlled permissioned networks. Blockchain networks can be public, private, or consortium-based for their access control and participation mechanisms. A public blockchain operates in a permissionless manner, allowing any node to join the network, participate in consensus, and validate data without requiring approval from an administrator or a central authority. Conversely, a private blockchain functions as a permissioned network, where nodes require authorization from an administrator or a central authority to participate [16]. Consortium blockchains blend the aspects of both private and public blockchains, with multiple organizations jointly managing access to a limited number of nodes to read, write, and validate the data [17]. Table 2 below presents a comparison of blockchain network types.