CBCIoT: A Consensus Algorithm for Blockchain-Based IoT Applications
Abstract
:1. Introduction
2. Related Work
2.1. Scalability Problem
2.2. Importance of Consensus
2.3. Performance Comparison
2.4. Continuous Growth in Crypto Market
3. Blockchain Overview
3.1. Blockchain Key Terms
- Blocks: Blocks contain transaction data, which include sender address, receivers address, transaction amount, transaction fee, last block reference number (hash), and time stamp. There are multiple transactions stored in a block that a validator or miner must verify. It nearly takes ten minutes for Bitcoin to produce the new block.
- Nodes: In a blockchain, each computer of a peer-to-peer network is called a node. These nodes float the transactions over a network for verification and store them in their public ledger. The main objective of the nodes is to send the transaction from sender to receiver in a secure way.
- Distributed Public Ledger: It records all the transactions so that no one can change it. If someone tries to make a change via any node, then it will not be accepted during consensus between nodes.
- Consensus: It is a general agreement between all nodes in the blockchain. When a block is produced, all the nodes must be agreed if any of the node is changed or manipulated, the other nodes will not accept this change. The consensus mechanism creates a trust between all the nodes and a step towards blockchain immutability.
- Flooding: Transactions reach every node by a process called flooding. When a node receives data, it sends them to all other nodes because mining will be started when a node receives all the data on the network.
- Miner/Validator: A validator or miner is a computer that validates the transactions by calculating the hash, stores it in its ledger, and broadcasts it to the network. In bitcoin, many computers try to validate the block and the computer which solves it first gets the transaction fees and block reward.
- Nonce: It is very easy to calculate the simple SHA-256 hash for certain data, but it becomes much more complex when the computer produces a block hash that meets certain requirements. In simple words, a nonce is a number to achieve a certain difficulty level added to the block for which the validator takes too much time and calculates several hashes until the desired result (hash) has been obtained.
3.2. Types of Blockchain
- Public blockchain: A blockchain which is openly available to miners, developers and members of its community. All the transactions in public blockchain are transparent and accessible to everyone. Public blockchain is fully decentralized where no individual or entity is controlling it. Most of the cryptocurrencies blockchains are public such as Bitcoin and Etereum.
- Private blockchain: Blockchain where only allowed persons can join the network and transactions are also available to its blockchain participants. Private blockchain is more centralized than the public one. Most of the enterprises do no want to disclose their sensitive data between groups of customers or want to hide their offers to specific customers. Ripple and Hyper-ledger are using it.
3.3. Blockchain Use Cases
4. Methodology
- In cryptocurrencies, we deal with transactions, but a massive amount of data in IoT blockchain needs to be handled. So, the broadcast domain should be limited, and we could survive from waiting for a validation process.
- If data are distributed to all nodes in the network, they will cause the network to slow down. They should be distributed to selected nodes or groups of nodes.
- In IoT, data are used instead of coins, so a proper validator/miner selection technique should be used. A validator is selected in PoS by selection techniques in cryptocurrencies, i.e., coin age-based selection (validator is selected by multiplication age of the coins in days with several coins that are being staked) and Randomized block selection (the next validator is selected by combining the lowest hash value and the size of their stakes).
- In cryptocurrencies, the miners get the reward and punishment for doing wrong, if they are selected by the PoS protocol. So here, we cannot punish, but we can lower machine ratings. We can also apply the error detection and correction method to the validator.
- We cannot rely on a single node to validate the data in our scenario. So, there should be multiple nodes for this purpose.
- There should be randomness in the consensus protocol to make it difficult for the attacker. Although security is not the prime topic in this study, we need to keep some basics in our minds because of vulnerabilities present in IoT.
4.1. Problem Solving Strategy by Consensus
4.1.1. Master Node
4.1.2. Voting
4.1.3. Rating
4.2. Procedure
- Every node will send data to the master node, which is selected by all the blockchain nodes in the voting process.
- Master node will receive data for 30 s (to collect maximum one time data) explained in the dataset section; after this period, a master node will send data to 5 randomly selected nodes for validation.
- Five nodes will create a block, and only one node will first send the block to the other four nodes for verification (difficulty level can be added to check the difference).
- If a block is created by more than one node at the same time, the block with greater number of verifications will win.
- After validation and verification, the block and information are broadcasted by the master to all blockchain nodes, which will be stored in their ledger.
- After a block is created, the same procedure is repeated for the next block.
- Genesis block will be created by the blockchain standard procedure.
4.3. Points of Concern
- All the nodes should be time-wise synchronized.
- Master node selection procedure should be fast to collect data from other nodes.
- nodes have to wait a little bit to send data to master every time.
- Simulation should be flexible so that number of nodes, time, etc., can be changed to check the differences in results.
4.4. Explanation with Example
- If it selects all the nodes, then validation will be slowed down as discussed in PoW.
- In case one node for validation could be a better option and blockchain performs efficiently, the attacker can insert data and validate them, if this node is compromised.
- In the case of 3 validating nodes, if one node is compromised, then the generated block will be accurate but less reliable due to one verification.
- If two nodes create two blocks simultaneously, then one block will win due to a greater number of verifications, and it is well performed in an odd number of nodes.
4.5. Phases of Nodes in IoT Blockchain
4.6. Dataset
- RMS Panel;
- Fuel Sensor Box.
4.7. Key Metrics of Performance
5. Analysis and Results
5.1. Sequence of Operations
5.2. Unpredictability in the Algorithm
5.3. Limited Broadcast Domain
5.4. Flexibility in the Algorithm
5.5. Case Study
- Block produced by node 2 with two verifications;
- Block produced by malicious node 4 with one verification.
5.6. Results
5.7. Limitations
- Its working is fine for block size <500 KB, and performance could be degraded a little bit for larger block size as discussed in the results section.
- Difficulty level directly affects it because the number of hashes per block is increased, and it is tested on blockchain 2.0.
- Selection of master node cannot be performed twice consecutively for a single node if its block is not broadcasted.
- Validator node cannot become a Master in the next round if it is a validator in the previous block and master does not broadcast this block in the IoT blockchain.
- This algorithm is working in public blockchain and not tested for private blockchain.
- Security is kept in mind during its construction due to vulnerable IoT systems, but it has not been not tested or tried to compromise it.
- It is suitable and working fine for IoT scenarios where a little delay is present or can be tolerated.
6. Conclusions and Future Work
Author Contributions
Funding
Conflicts of Interest
References
- Novo, O. Blockchain meets IoT: An architecture for scalable access management in IoT. IEEE Internet Things J. 2018, 5, 1184–1195. [Google Scholar] [CrossRef]
- Panarello, A.; Tapas, N.; Merlino, G.; Longo, F.; Puliafito, A. Blockchain and iot integration: A systematic survey. Sensors 2018, 18, 2575. [Google Scholar] [CrossRef] [Green Version]
- Abou Jaoude, J.; Saade, R.G. Blockchain applications–usage in different domains. IEEE Access 2019, 7, 45360–45381. [Google Scholar] [CrossRef]
- Atlam, H.F.; Wills, G.B. Technical aspects of blockchain and IoT. In Advances in Computers; Elsevier: Amsterdam, The Netherlands, 2019; Volume 115, pp. 1–39. [Google Scholar]
- Padma, M.; KasiViswanath, N.; Swathi, T. Blockchain for iot application: Challenges and issues. Int. J. Recent Technol. Eng. 2019, 7, 34–37. [Google Scholar]
- Banafa, A. 7 IoT and Blockchain: Challenges and Risks. In Blockchain Technology and Applications; River Publishers: Gistrup, Denmark, 2020. [Google Scholar]
- Qureshi, K.N.; Sandila, M.A.S.; Javed, I.T.; Margaria, T.; Aslam, L. Authentication scheme for Unmanned Aerial Vehicles based Internet of Vehicles networks. Egypt. Inform. J. 2021. [Google Scholar] [CrossRef]
- Zheng, Z.; Xie, S.; Dai, H.; Chen, X.; Wang, H. An overview of blockchain technology: Architecture, consensus, and future trends. In Proceedings of the 2017 IEEE International Congress on Big Data (BigData Congress), Honolulu, HI, USA, 25–30 June 2017; pp. 557–564. [Google Scholar]
- Dorri, A.; Kanhere, S.S.; Jurdak, R. Towards an optimized blockchain for IoT. In Proceedings of the 2017 IEEE/ACM Second International Conference on Internet-of-Things Design and Implementation (IoTDI), Pittsburgh, PA, USA, 18–21 April 2017; pp. 173–178. [Google Scholar]
- Mohanta, B.K.; Satapathy, U.; Panda, S.S.; Jena, D. A novel approach to solve security and privacy issues for iot applications using blockchain. In Proceedings of the 2019 International Conference on Information Technology (ICIT), Bhubaneswar, India, 19–21 December 2019; pp. 394–399. [Google Scholar]
- Javed, I.T.; Alharbi, F.; Bellaj, B.; Margaria, T.; Crespi, N.; Qureshi, K.N. Health-ID: A Blockchain-Based Decentralized Identity Management for Remote Healthcare. Healthcare 2021, 9, 712. [Google Scholar] [CrossRef] [PubMed]
- Alamri, B.; Javed, I.T.; Margaria, T. Preserving patients’ privacy in medical IoT using blockchain. In Proceedings of the International Conference on Edge Computing, Honolulu, HI, USA, 22–26 June 2020; pp. 103–110. [Google Scholar]
- Wang, G.; Shi, Z.; Nixon, M.; Han, S. Chainsplitter: Towards blockchain-based industrial iot architecture for supporting hierarchical storage. In Proceedings of the 2019 IEEE International Conference on Blockchain (Blockchain), Atlanta, GA, USA, 14–17 July 2019; pp. 166–175. [Google Scholar]
- Biswas, S.; Sharif, K.; Li, F.; Maharjan, S.; Mohanty, S.P.; Wang, Y. PoBT: A lightweight consensus algorithm for scalable IoT business blockchain. IEEE Internet Things J. 2019, 7, 2343–2355. [Google Scholar] [CrossRef]
- Fernández-Caramés, T.M.; Fraga-Lamas, P. A Review on the Use of Blockchain for the Internet of Things. IEEE Access 2018, 6, 32979–33001. [Google Scholar] [CrossRef]
- Ferrag, M.A.; Derdour, M.; Mukherjee, M.; Derhab, A.; Maglaras, L.; Janicke, H. Blockchain technologies for the internet of things: Research issues and challenges. IEEE Internet Things J. 2018, 6, 2188–2204. [Google Scholar] [CrossRef] [Green Version]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Technical Report. 2008. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 10 January 2021).
- Back, A. Hashcash-a Denial of Service Counter-Measure. 2002. Available online: http://www.hashcash.org/hashcash.pdf (accessed on 16 January 2021).
- Lo, S.K.; Liu, Y.; Chia, S.Y.; Xu, X.; Lu, Q.; Zhu, L.; Ning, H. Analysis of blockchain solutions for IoT: A systematic literature review. IEEE Access 2019, 7, 58822–58835. [Google Scholar] [CrossRef]
- King, S.; Nadal, S. Ppcoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake. Self-Published Paper. 19 August 2012. Available online: https://www.chainwhy.info/upload/default/20180619/126a057fef926dc286accb372da46955.pdf (accessed on 16 January 2021).
- Salimitari, M.; Chatterjee, M. A survey on consensus protocols in blockchain for iot networks. arXiv 2018, arXiv:1809.05613. [Google Scholar]
- Popov, S. The Tangle. [Online]. 2016. Available online: http://www.descryptions.com/Iota.pdf (accessed on 22 February 2021).
- Corso, A. Performance Analysis of Proof-of-Elapsed-Time (PoET) Consensus in the Sawtooth Blockchain Framework. Ph.D. Thesis, University of Oregon, Eugene, OR, USA, 2019. [Google Scholar]
- Castro, M.; Liskov, B. Practical byzantine fault tolerance. In OSDI; The USENIX Association: Berkeley, CA, USA, 1999; Volume 99, pp. 173–186. [Google Scholar]
- Swathi, B.; Meghana, M.; Lokamathe, P. An Analysis on Blockchain Consensus Protocols for Fault Tolerance. In Proceedings of the 2021 2nd International Conference for Emerging Technology (INCET), Belagavi, India, 21–23 May 2021; pp. 1–4. [Google Scholar]
- Mazieres, D. The Stellar Consensus Protocol: A Federated Model for Internet-Level Consensus; Stellar Development Foundation: San Francisco, CA, USA, 2015; Volume 32. [Google Scholar]
- Kim, M.; Kwon, Y.; Kim, Y. Is Stellar as secure as you think? In Proceedings of the 2019 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW), Stockholm, Sweden, 17–19 June 2019; pp. 377–385. [Google Scholar]
- Amsden, Z.; Arora, R.; Bano, S.; Baudet, M.; Blackshear, S.; Bothra, A.; Cabrera, G.; Catalini, C.; Chalkias, K.; Cheng, E.; et al. The Libra Blockchain. Calibra Corp. 2019. Available online: https://mitsloan.mit.edu/shared/ods/documents?PublicationDocumentID=5859 (accessed on 14 April 2021).
- Guides, T.S. Why Cardano ADA Deserves Your Attention–Cardano Cryptocurrency Strategy. 2018. Available online: https://tradingstrategyguides.com/cardano-cryptocurrency-strategy/ (accessed on 10 January 2021).
- Duong, T.; Fan, L.; Katz, J.; Thai, P.; Zhou, H.S. 2-hop blockchain: Combining proof-of-work and proof-of-stake securely. In Proceedings of the European Symposium on Research in Computer Security, Darmstadt, Germany, 4–8 October 2020; pp. 697–712. [Google Scholar]
- Nguyen, G.T.; Kim, K. A Survey about Consensus Algorithms Used in Blockchain. J. Inf. Process. Syst. 2018, 14, 101–128. [Google Scholar]
- Ongaro, D.; Ousterhout, J. In search of an understandable consensus algorithm. In Proceedings of the 2014 USENIX Annual Technical Conference (USENIX ATC 14), Philadelphia, PA, USA, 19–20 June 2014; pp. 305–319. [Google Scholar]
- Jiang, T.; Fang, H.; Wang, H. Blockchain-based internet of vehicles: Distributed network architecture and performance analysis. IEEE Internet Things J. 2018, 6, 4640–4649. [Google Scholar] [CrossRef]
- Wang, X.; Zeng, P.; Patterson, N.; Jiang, F.; Doss, R. An improved authentication scheme for internet of vehicles based on blockchain technology. IEEE Access 2019, 7, 45061–45072. [Google Scholar] [CrossRef]
- Hu, J.; He, D.; Zhao, Q.; Choo, K.K.R. Parking management: A blockchain-based privacy-preserving system. IEEE Consum. Electron. Mag. 2019, 8, 45–49. [Google Scholar] [CrossRef]
- Sidorov, M.; Ong, M.T.; Sridharan, R.V.; Nakamura, J.; Ohmura, R.; Khor, J.H. Ultralightweight mutual authentication RFID protocol for blockchain enabled supply chains. IEEE Access 2019, 7, 7273–7285. [Google Scholar] [CrossRef]
- Huang, J.; Kong, L.; Chen, G.; Wu, M.Y.; Liu, X.; Zeng, P. Towards secure industrial IoT: Blockchain system with credit-based consensus mechanism. IEEE Trans. Ind. Inform. 2019, 15, 3680–3689. [Google Scholar] [CrossRef]
- Zou, S.; Xi, J.; Wang, S.; Lu, Y.; Xu, G. Reportcoin: A novel blockchain-based incentive anonymous reporting system. IEEE Access 2019, 7, 65544–65559. [Google Scholar] [CrossRef]
- Javed, I.T.; Alharbi, F.; Margaria, T.; Crespi, N.; Qureshi, K.N. PETchain: A Blockchain-Based Privacy Enhancing Technology. IEEE Access 2021, 9, 41129–41143. [Google Scholar] [CrossRef]
- Tang, F.; Ma, S.; Xiang, Y.; Lin, C. An efficient authentication scheme for blockchain-based electronic health records. IEEE Access 2019, 7, 41678–41689. [Google Scholar] [CrossRef]
- Alamri, B.; Javed, I.T.; Margaria, T. A GDPR-Compliant Framework for IoT-Based Personal Health Records Using Blockchain. In Proceedings of the 2021 11th IFIP International Conference on New Technologies, Mobility and Security (NTMS), Paris, France, 19–21 April 2021; pp. 1–5. [Google Scholar]
- Wu, J.; Xiong, F.; Li, C. Application of Internet of Things and Blockchain Technologies to Improve Accounting Information Quality. IEEE Access 2019, 7, 100090–100098. [Google Scholar] [CrossRef]
- Liu, Y.; Wang, K.; Lin, Y.; Xu, W. A lightweight blockchain system for industrial internet of things. IEEE Trans. Ind. Inform. 2019, 15, 3571–3581. [Google Scholar] [CrossRef]
- Hammi, M.T.; Hammi, B.; Bellot, P.; Serhrouchni, A. Bubbles of Trust: A decentralized blockchain-based authentication system for IoT. Comput. Secur. 2018, 78, 126–142. [Google Scholar] [CrossRef]
- Niya, S.R.; Schiller, E.; Cepilov, I.; Maddaloni, F.; Aydinli, K.; Surbeck, T.; Bocek, T.; Stiller, B. Adaptation of Proof-of-Stake-based Blockchains for IoT Data Streams. In Proceedings of the 2019 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), Seoul, Korea, 14–17 May 2019; pp. 15–16. [Google Scholar]
- Bachmann, S. Proof of Stake for Bazo. Bachelor’s Thesis, University of Zurich, Zürich, Switzerland, 2018. [Google Scholar]
- Du, M.; Ma, X.; Zhang, Z.; Wang, X.; Chen, Q. A review on consensus algorithm of blockchain. In Proceedings of the 2017 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Banff, AB, Canada, 5–8 October 2017; pp. 2567–2572. [Google Scholar]
Consensus | Decentralization | Accessibility | Scalability | Comp. O.H. | Storage O.H. | Network O.H. | Latency | Throughput | Suitability (IoT) |
---|---|---|---|---|---|---|---|---|---|
PoW | High | Public, PL. | High | High | High | Low | High | Low | No |
dPBFT | Medium | Private, P. | High | Low | High | High | Medium | High | Partially |
Stellar | High | Public, PL. | High | Low | High | Medium | Medium | High | Partially |
PoI | High | Public, PL. | High | Low | High | Low | Medium | High | Partially |
Ripple | High | Public, PL. | High | Low | High | Medium | Medium | High | Partially |
Raft | Medium | Private, P. | High | Low | High | N/A | Low | High | Partially |
OmniLedger | High | Public, PL. | High | Medium | Low | Medium | Medium | High | Partially |
RapidChain | High | Public, PL. | High | Medium | Low | Low | Medium | High | Partially |
DPoS | Medium | Public, PL. | High | Medium | High | N/A | Medium | High | Partially |
PoS | High | Private, P or PL | High | Medium | High | Low | Medium | Low | Partially |
PoET | Medium | Private, P or PL | High | Low | High | Low | Low | High | Full |
PBFT | Medium | Private, P. | Low | Low | High | High | Low | High | Full |
Tangle | Medium | Public, PL. | High | Low | Low | Low | Low | High | Full |
Mechanism | Decentralized Control | Flexible Trust | Low Latency | Asymptotic Security |
---|---|---|---|---|
Proof of Work | Yes | No | No | No |
Proof of Stake | Yes | No | Maybe | Maybe |
Byzantine agreement | No | Yes | Yes | Yes |
Tendermint | Yes | No | Yes | Yes |
SCP | Yes | Yes | Yes | Yes |
Criterion | Proof-Based Consensus | Vote-Based Consensus |
---|---|---|
Join nodes freely | Mostly | No |
Decentralization | High | Low |
executing nodes | Unlimited | Limited |
Trust | More Trustful | Less Trustful |
Award | More Serious | Less Serious |
Security threat | Yes | Mostly No |
Examples | PoW, PoS | Raft |
Characteristics | PoW | PoS | DPoS | RAFT | SCP | CBCIoT (Study) |
---|---|---|---|---|---|---|
Accessibility | Public | Public, Private | Public | Private | Public | Public |
Decentralization | High | high | High | Medium | High | High |
Throughput | Low | Low | High | High | High | High |
Scalibility | Strong | Strong | Strong | Weak | Strong | Strong |
verification Speed | >100 s | <100 s | <100 s | <5 s | <5 s | <5 s |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Uddin, M.; Muzammal, M.; Hameed, M.K.; Javed, I.T.; Alamri, B.; Crespi, N. CBCIoT: A Consensus Algorithm for Blockchain-Based IoT Applications. Appl. Sci. 2021, 11, 11011. https://doi.org/10.3390/app112211011
Uddin M, Muzammal M, Hameed MK, Javed IT, Alamri B, Crespi N. CBCIoT: A Consensus Algorithm for Blockchain-Based IoT Applications. Applied Sciences. 2021; 11(22):11011. https://doi.org/10.3390/app112211011
Chicago/Turabian StyleUddin, Moin, Muhammad Muzammal, Muhammad Khurram Hameed, Ibrahim Tariq Javed, Bandar Alamri, and Noel Crespi. 2021. "CBCIoT: A Consensus Algorithm for Blockchain-Based IoT Applications" Applied Sciences 11, no. 22: 11011. https://doi.org/10.3390/app112211011
APA StyleUddin, M., Muzammal, M., Hameed, M. K., Javed, I. T., Alamri, B., & Crespi, N. (2021). CBCIoT: A Consensus Algorithm for Blockchain-Based IoT Applications. Applied Sciences, 11(22), 11011. https://doi.org/10.3390/app112211011