# Survey of Blockchain-Based Applications for IoT
## 8 Blockchain Scalability and Efficiency  
### Consensus Algorithm Optimization  
[PERSON] et al. provide a comprehensive comparison of the available consensus algorithms for blockchain-based IoT security, analyzing their impact on latency, scalability, computation, and attack resistance [58]. The study evaluates mechanisms such as PoW, PoS, Byzantine Fault Tolerance (BFT), and Delegated Proof of Stake (DPoS), highlighting their suitability for different IoT environments. BFT-based algorithms provide low latency, which is required for IoT applications, but have high computation costs and are vulnerable to 33% attacks, where an attacker controlling more than 33% of the total validating power can disrupt consensus, halt the network, or manipulate transactions. These algorithms can be used in private, permissioned networks where the number of devices and the users who can connect are controlled.  
One enhancement to PBFT is PBFT-Pipeline, which aims to address the high latency and communication complexity inherent in traditional PBFT. PBFT-Pipeline achieves this by introducing a pipelined processing approach that allows multiple consensus phases to be executed concurrently rather than sequentially. However, despite its improvements, PBFT-Pipeline still faces challenges when dealing with real-time IoT applications. The high network traffic and communication load can hinder performance when transaction rates spike. One approach to achieving the real-time communication required for the IoT is the Random Cluster PBFT (RC-PBFT) consensus algorithm [59]. In this method, consensus is reached within randomly selected clusters in the blockchain and the results are propagated throughout the entire network. RC-PBFT is designed to meet the specific demands of IoT and real-time applications, offering both the security benefits of a blockchain and the speed and scalability necessary to process transactions or blocks generated by IoT devices efficiently. RC-PBFT reduces response time from over 200 ms to about 10 ms, making it more suitable for real-time IoT blockchain applications.  
Two consensus algorithms can be implemented in a hybrid approach to effectively balance efficiency and security, especially in resource-constrained IoT environments. For example, [PERSON] et al. suggested a PoS and PoW Hybrid Consensus that leverages the strengths of both algorithms to address the limitations of each. In this approach, PoS blocks are generated by users with limited computational resources, known as minters,who constitute the majority of users in edge environments. These PoS blocks process and store most of the transactions efficiently, ensuring low latency and real-time performance, which is crucial for IoT applications. To encourage participation and support network sustainability, a portion of the transaction fees is rewarded to the block minters. On the other hand, PoW blocks are generated by users with more substantial computational capabilities, known as miners, and follow the traditional PoW approach of solving cryptographic puzzles to validate transactions. The inclusion of PoW blocks strengthens security by adding computational challenges that deter malicious activities. By combining both PoS and PoW within the hybrid model, the system achieves a practical balance of lightweight, fast transaction processing and robust security, making it suitable for heterogeneous IoT environments [60].