When Measurements Meet Blockchain: On Behalf of an Inter-NMI Network †
Abstract
:1. Introduction
- We discuss the relevance of a permanent inter-NMI blockchain network. We describe how this initiative requires each country member’s commitment and how its availability can be worthwhile to them.
- We propose a blockchain network architecture based on a distributed and decentralized model. We explain why this model is the most indicated for the LM scope and foresee the technologies necessary to implement it.
- We implement our inter-NMI blockchain network using the Hyperledger Fabric platform. The implementation integrates servers from PTB and Inmetro in two different managing modes: the direct connection among peers and swarm-based orchestration. We discuss each modes and give directions about managing our inter-NMI network’s eventual growth.
2. Background
2.1. Legal Metrology and Digitalization
2.2. Blockchain and Measurement Applications
2.3. Blockchain-Based Pki Application
2.3.1. Digital Signatures and Smart Meters
2.3.2. Public-Key Infrastructure
2.3.3. How Blockchain Can Help
3. The Inter-Nmi Blockchain Network Architecture
3.1. Properties of a Decentralized Blockchain Network
- Affiliation: This occurs when a particular organization joins the blockchain network. Such a decision can occur voluntarily (e.g., the organization wants to contribute to an application of interest) or through formal agreements (e.g., several organizations establish a contract to maintain a particular application);
- Availability of peers: The organization contributes a specific number of peers. A peer is usually a machine (virtual or physical) that participates in the blockchain network, either as a data replicator (i.e., the peer stores and propagates the blocks) or as a member of the consensus quorum. The number of peers that each organization contributes depends on the format of its membership. Organizations that integrate the network through formal agreements must keep a specific number of peers, also specified in the contract;
- Peers’ identification: Each organization is responsible for identifying and authenticating its peers. At the same time, each organization must broadcast its peers’ identities to the other organizations. We describe this step in detail in the next subsection;
- Peers’ maintenance: Each organization is responsible for maintaining its respective peers. Thus, whenever a certain peer becomes inoperative, the organization is responsible for its repair or replacement, repeating the other necessary steps. If the affiliation is voluntary, the organization is completely free to remove or add new peers whenever it seems necessary. We state that peers’ maintenance is a continuous and important activity to the blockchain network availability.
- Peers’ removal or revocation: Each organization is responsible for notifying the others whenever it permanently removes a peer from the network, or when the peers’ credentials are no longer valid (i.e., expiration or some security compromise).
3.2. Properties of a Permissioned Blockchain Network
3.3. Advantages of Using Multiple Ledgers
4. Case Study: A Blockchain-Based Pki for Smart Meters
4.1. How a Ca-Based Pki Works
4.1.1. Smart Meter Manufacturing
4.1.2. The Initial Verification
4.1.3. Issuing the Digital Certificate
4.1.4. The Meter’s Deployment
4.2. Conceiving of a Blockchain-Based Pki for Smart Meters
4.2.1. Smart Meter Manufacturing
4.2.2. The Initial Verification
4.2.3. The Digital Certificate Issuance
4.2.4. The Meter Deployment
5. Implementation Using Hyperledger Fabric
5.1. Overview of Hyperledger Fabric
- Smart contract and chaincode: In Fabric, a smart contract, which is also called a chaincode, implements the executable logic of our PKI implementation.
- Peer: We utilized thee stages of the peer (endorsing, committing, and anchor peer) from the Fabric component. In our implementation, peer0 (we have named 2 peers as peer0 and peer1 for each NMI) from PTB and Inmetro works as the endorser (to endorse the transaction), committer (commits the block received by orderer service), and anchor peers (communicates between two different NMI organizations) at a time.
- Ordering service: The ordering service is responsible for creating consensus, receiving endorsed transactions from clients, and ordering the replicated transaction blocks to peers [15]. In our implementation, we used the “solo (single node ordering service)” and the “Raft [36] (Crash Fault-Tolerant (CFT) ordering service using distributed consensus)” ordering service for the single-host and multi-host deployments, respectively.
- Membership Service Provider (MSP): To maintain the identities of all NMI nodes in the network, the MSP component is used for our inter-NMI blockchain network. The MSP component from Fabric issues the crypto resources for authentication and authorization for each NMI organization.
- Channel: In Fabric, a channel represents the private tool for communicating between several network members for private and confidential exchanges. Both NMIs (PTB and Inmetro) communicate through a “nmichannel” in the NMI blockchain network.
- Manufacturer (M): Meter manufacturing is similar to CA-based PKI where the manufacturer needs to provide the secured tamper-proof cryptographic module. In our proposal, we denote the digital certificate as a data entry phase in the blockchain. For simplicity, we created a client using the Python SDK (https://github.com/hyperledger/fabric-sdk-py (accessed on 30 December 2020)) of Fabric to generate the asymmetric cryptographic key pair using the Elliptic Curve Digital Signature Algorithm (ECDSA). In this phase, the manufacturer requires initial verification and endorsement for the public key of the smart meter from the PE.
- Permissioned Endorsers (PEs): Being a trusted entity only, the PE is responsible for metrological inspection of smart meters and can submit transactions to the blockchain. The transaction represents inserting the public key of the smart meters into the ledger. To represent PE in our implementation, we used the “peer” concept from Fabric.
- Smart contract: The verification of the digital signature is implemented in a smart contract that is served by the blockchain. In Hyperledger Fabric, a smart contract is a chaincode that executes our logical operation.
- Entities from Society (S): Any authorized entity from society interested in digital signature verification can invoke a smart contract by providing the meter ID, LR information, and signature digest. We created a client application for the verification of this step and to interact with the smart contract.
5.2. Single-Host Deployment
5.3. Multi-Host Deployment
- Configuring communication between peers (without the orchestration tool)
- Docker swarm-based orchestration
5.3.1. Configuring the Communication between Peers (Without the Orchestration Tool)
5.3.2. Docker Swarm-Based Orchestration
- One channel (nmichannel)
- Two peers per NMI (peer0, peer1)
- Five orderers (using the Raft protocol)
- One smart contract (PKI-based)
- Membership Service Provider (MSP) for crypto materials
5.4. Consensus Using the Raft Protocol
6. Results and Discussion
6.1. Overview of the Hyperledger Explorer Tool
- Counters: Section (a) from Figure 5 represents the No. of blocks, transactions, nodes, and the chaincode.
- List of peers: Section (b) represents the peer names of PTB and Inmetro along with five orderers in the NMI network.
- Block notification: Section (c) represents the block that is lastly added and contains the channel name (the block was created through “nmichannel” and provides privacy to the network), the data hash (contains the encrypted code), and the number of TX (describes the number of transactions per block) fields.
- Metrics: Section (d) represents the statistics of the blocks and transactions per channel. The graph also shows the metrics per block or transaction per hour/minute.
- Transactions: Section (e) represents the transactions by organization. For simplicity, we generated crypto resources on PTB-S1 and mapped “PTBMSP” in the Explorer configuration file.
6.2. Using Hyperledger Explorer Tool for a Single Host
6.3. Using Hyperledger Explorer Tool for Multiple Hosts
6.3.1. Using the Solo Orderer Service with and without the Orchestration Tool
6.3.2. Using the Raft Orderer Service with and without the Orchestration Tool
6.4. Fabric’s Performance Issues
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Thiel, F. Digital transformation of legal metrology—The European Metrology Cloud. OIML Bull. 2018, 59, 10–21. [Google Scholar]
- Mustapaa, T.; Autiosalo, J.; Nikander, P.; Siegel, J.E.; Viitala, R. Digital Metrology for the Internet of Things. In Proceedings of the GIoTS 2020—Global Internet of Things Summit, Proceedings, Dublin, Ireland, 3–5 June 2020. [Google Scholar] [CrossRef]
- Esche, M.; Thiel, F. Software Risk Assessment for Measuring Instruments in Legal Metrology. In Proceedings of the Federated Conference on Computer Science and Information Systems, Lodz, Poland, 13–16 September 2015; Volume 5, pp. 1113–1123. [Google Scholar] [CrossRef] [Green Version]
- Peters, D.; Peter, M.; Seifert, J.P.; Thiel, F. A Secure System Architecture for Measuring Instruments in Legal Metrology. Computers 2015, 4, 61–86. [Google Scholar] [CrossRef] [Green Version]
- Melo, W.S.; Machado, R.C.S.; Abreu, B.; Carmo, L.F.; Ramos, R. Certificação Digital como Ferramenta de Segurança para Medidores Inteligentes. In Anais Estendidos do Simpósio Brasileiro de Engenharia de Sistemas Computacionais (SBESC); SBC: Natal, RN, Brazil, 2019; pp. 89–94. [Google Scholar] [CrossRef] [Green Version]
- Rincon, A.E.; Melo, W.S.; Farias, C.M.; Carmo, L.F. Securing Smart Meters through Physical Properties of their Components. IEEE Trans. Instrum. Meas. 2020, 70, 1–11. [Google Scholar] [CrossRef]
- Rodrigues Filho, B.A.; Gonçalves, R.F. Legal metrology, the economy and society: A systematic literature review. Measurement 2015, 69, 155–163. [Google Scholar] [CrossRef]
- do Prado, C.B.; Boccardo, D.R.; Machado, R.C.S.; da Costa Carmo, L.F.R.; do Nascimento, T.M.; Bento, L.M.S.; Costa, R.O.; de Castro, C.G.; Câmara, S.M.; Pirmez, L.; et al. Software Analysis and Protection for Smart Metering. NCSLI Meas. 2014, 9, 22–29. [Google Scholar] [CrossRef]
- Melo, W.S., Jr.; Bessani, A.; Neves, N.; Santin, A.O.; Carmo, L.F.R.C. Using Blockchains to Implement Distributed Measuring Systems. IEEE Trans. Instrum. Meas. 2019, 68, 1503–1512. [Google Scholar] [CrossRef]
- Melo, W.S.; Tarelho, L.V.; Rodrigues, B.A.; Bessani, A.N.; Carmo, L.F. Field surveillance of fuel dispensers using IoT-based metering and blockchains. J. Netw. Comput. Appl. 2020, 175, 102914. [Google Scholar] [CrossRef]
- Rodrigues Filho, B.A.; Silva, M.E.; Fogazzi, C.R.; Araujo, M.B.; Gonçalves, R.F. Information System as a Tool to Decrease the Economic Distortion in Trade Metrology. IFIP Adv. Inf. Commun. Technol. 2015, 459, 121–128. [Google Scholar] [CrossRef] [Green Version]
- Thiel, F.; Wetzlich, J. The European Metrology Cloud: Impact of European Regulations on Data Protection and the Free Flow of Non-Personal Data. In Proceedings of the 19th International Congress of Metrology, Paris, France, 24–26 September 2019; p. 39. [Google Scholar] [CrossRef] [Green Version]
- Christidis, K.; Devetsikiotis, M. Blockchains and Smart Contracts for the Internet of Things. IEEE Access 2016, 4, 2292–2303. [Google Scholar] [CrossRef]
- Peters, D.; Wetzlich, J.; Thiel, F.; Seifert, J.P. Blockchain Applications for Legal Metrology. In Proceedings of the IEEE International Instrumentation and Measurement Technology Conference, Houston, TX, USA, 14–17 May 2018; p. 6. [Google Scholar]
- Peters, D.; Yurchenko, A.; Melo, W.; Shirono, K.; Usuda, T.; Seifert, J.P.P.; Thiel, F. IT Security for Measuring Instruments: Confidential Checking of Software Functionality. In Advances in Intelligent Systems and Computing; Springer: Cham, Switzerland, 2020; Volume 1129, pp. 701–720. [Google Scholar] [CrossRef]
- Yurchenko, A.; Moni, M.; Peters, D.; Nordholz, J.; Thiel, F. Security for Distributed Smart Meter: Blockchain-based Approach, Ensuring Privacy by Functional Encryption. In Proceedings of the 10th International Conference on Cloud Computing and Services Science—CLOSER, Prague, Czech Republic, 7–9 May 2020; pp. 292–301. [Google Scholar] [CrossRef]
- Melo, W., Jr.; Machado, R.C.S.; Peters, D.; Moni, M. Public-Key Infrastructure for Smart Meters using Blockchains. In Proceedings of the 2020 IEEE International Workshop on Metrology for Industry 4.0 and IoT, Roma, Italy, 3–5 June 2020; p. 6. [Google Scholar]
- Leitão, F.O.; Vasconcellos, M.T.; Brandão, P.C.R. Hardware and Software Countermeasures on High Technology Fraud at Fuel Dispensers under the Scope of Legal Metrology. In Proceedings of the IX Simposio Internacional ‘Metrologia 2014’, Havana, Cuba, 12–14 June 2014; pp. 1–10. [Google Scholar]
- Zheng, Z.; Xie, S.; Dai, H.N.; Wang, H. Blockchain Challenges and Opportunities: A Survey. Int. J. Web Grid Serv. 2017, 14, 352–375. [Google Scholar] [CrossRef]
- Vukolić, M. The quest for scalable blockchain fabric: Proof-of-work vs. BFT replication. Lect. Notes Comput. Sci. 2016, 9591, 112–125. [Google Scholar] [CrossRef] [Green Version]
- Bucci, G.; Ciancetta, F.; Fiorucci, E.; Fioravanti, A.; Prudenzi, A.; Mari, S. Challenge and future trends of distributed measurement systems based on Blockchain technology in the European context. In Proceedings of the IEEE 10th International Workshop on Applied Measurements for Power Systems (AMPS), Aachen, Germany, 25–27 September 2019; pp. 1–6. [Google Scholar] [CrossRef]
- Vukolić, M. Rethinking Permissioned Blockchains. In Proceedings of the ACM Workshop on Blockchain, Cryptocurrencies and Contracts—BCC’17, Abu Dhabi, UAE, 2–6 April 2017; pp. 3–7. [Google Scholar] [CrossRef] [Green Version]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 30 December 2020).
- Buterin, V. Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform. White Paper. 2014, p. 37. Available online: https://cryptorating.eu/whitepapers/Ethereum/Ethereum_white_paper.pdf (accessed on 30 December 2020).
- Androulaki, E.; Barger, A.; Bortnikov, V.; Cachin, C.; Christidis, K.; De Caro, A.; Enyeart, D.; Ferris, C.; Laventman, G.; Manevich, Y.; et al. Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains. In Proceedings of the Thirteenth EuroSys Conference, Porto, Portugal, 23–26 April 2018. [Google Scholar] [CrossRef] [Green Version]
- Xiao, Y.; Zhang, N.; Lou, W.; Hou, Y.T. A Survey of Distributed Consensus Protocols for Blockchain Networks. IEEE Commun. Surv. Tutor. 2020, 22, 1432–1465. [Google Scholar] [CrossRef] [Green Version]
- Ismail, L.; Materwala, H. A review of blockchain architecture and consensus protocols: Use cases, challenges, and solutions. Symmetry 2019, 11, 1198. [Google Scholar] [CrossRef] [Green Version]
- Stallings, W.; Brown, L. Computer Security: Principles and Practice, 4th ed.; Pearson: London, UK, 2018. [Google Scholar]
- European Cooperation in Legal Metrology (WELMEC). WELMEC 7.2, 2015: Software Guide. 2015. Available online: https://www.welmec.org/welmec/documents/guides/7.2/2015/Guide_7.2_2015__Software.pdf (accessed on 30 December 2020).
- Jäger, F.; Grottker, U.; Schrepf, H.; Guse, W. Protection of image and measurement data in an open network for traffic enforcement. Comput. Stand. Interfaces 2006, 28, 327–335. [Google Scholar] [CrossRef]
- Boccardo, D.R.; Machado, R.C.S.; Camara, S.; Prado, C.B.; Melo, W.S., Jr.; Ribeiro, L.C.; Carmo, L.F. Software validation of medical instruments. In Proceedings of the 2014 IEEE International Symposium on Medical Measurements and Applications (MeMeA), Lisboa, Portugal, 11–12 June 2014; pp. 1–4. [Google Scholar] [CrossRef]
- Al-Bassam, M. SCPKI: A smart contract-based PKI and identity system. In Proceedings of the ACM Workshop on Blockchain, Cryptocurrencies and Contracts, Co-Located with ASIA CCS 2017, (BCC 2017), Abu Dhabi, UAE, 2–6 April 2017; pp. 35–40. [Google Scholar] [CrossRef]
- Singla, A.; Bertino, E. Blockchain-Based PKI solutions for IoT. In Proceedings of the 4th IEEE International Conference on Collaboration and Internet Computing, CIC 2018, Philadelphia, PA, USA, 18–20 October 2018; pp. 9–15. [Google Scholar] [CrossRef]
- Jiang, W.; Li, H.; Xu, G.; Wen, M.; Dong, G.; Lin, X. PTAS: Privacy-preserving Thin-client Authentication Scheme in blockchain-based PKI. Future Gener. Comput. Syst. 2019, 96, 185–195. [Google Scholar] [CrossRef]
- Rodrigues Filho, B.A.; Gonçalves, R.F. Measuring the economic impact of metrological frauds in trade metrology using an Input-Output Model. IFIP Adv. Inf. Commun. Technol. 2016, 488. [Google Scholar] [CrossRef]
- 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; USENIX Association: Philadelphia, PA, USA, 2014; pp. 305–319. [Google Scholar]
- Deyerl, C.; Distler, T. In Search of a Scalable Raft-based Replication Architecture. In Proceedings of the 6th Workshop on Principles and Practice of Consistency for Distributed Data (PaPoC ’19), Dresden, Germany, 25 March 2019; pp. 1–7. [Google Scholar] [CrossRef]
- Sousa, J.; Bessani, A.; Vukolić, M. A Byzantine Fault-Tolerant Ordering Service for the Hyperledger Fabric Blockchain Platform. In Proceedings of the DSN’18: The IEEE/IFIP International Conference on Dependable Systems and Networks, Luxembourg, 25–28 June 2018. [Google Scholar] [CrossRef] [Green Version]
Environment | PTB-S1 | Inmetro-S2 |
---|---|---|
Model | Intel(R) Xeon(R) Gold 5218 CPU @ 2.30 GHz | Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60 GHz |
CPU(s) | 64 | 8 |
Architecture | x86_64 | x86_64 |
Hyperledger Fabric version | 1.4.9 | 1.4.9 |
PTB-S1 | Inmetro-S2 |
---|---|
peer0.ptb (anchor peer) | peer0.inmetro (anchor peer) |
peer1.ptb | peer1.inmetro |
cli | explorer |
orderer, orderer2, orderer3 | explorerdb |
orderer4, orderer5 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 42 | 402 |
16 | 162 | 1602 |
36 | 362 | 3602 |
64 | 642 | 6402 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 188 | 1570 |
16 | 628 | 6257 |
36 | 1410 | 14,080 |
64 | 2504 | 25,015 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 49 | 404 |
16 | 184 | 1604 |
36 | 410 | 3604 |
64 | 726 | 6404 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 97 | 784 |
16 | 336 | 3115 |
36 | 748 | 6975 |
64 | 1326 | 12,402 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 44 | 404 |
16 | 164 | 1604 |
36 | 364 | 3604 |
64 | 644 | 6404 |
No. of Clients | No. of Blocks | No. of Transactions |
---|---|---|
4 | 83 | 716 |
16 | 289 | 2846 |
36 | 644 | 6389 |
64 | 1139 | 11,350 |
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 (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Moni, M.; Melo, W., Jr.; Peters, D.; Machado, R. When Measurements Meet Blockchain: On Behalf of an Inter-NMI Network. Sensors 2021, 21, 1564. https://doi.org/10.3390/s21051564
Moni M, Melo W Jr., Peters D, Machado R. When Measurements Meet Blockchain: On Behalf of an Inter-NMI Network. Sensors. 2021; 21(5):1564. https://doi.org/10.3390/s21051564
Chicago/Turabian StyleMoni, Mahbuba, Wilson Melo, Jr., Daniel Peters, and Raphael Machado. 2021. "When Measurements Meet Blockchain: On Behalf of an Inter-NMI Network" Sensors 21, no. 5: 1564. https://doi.org/10.3390/s21051564
APA StyleMoni, M., Melo, W., Jr., Peters, D., & Machado, R. (2021). When Measurements Meet Blockchain: On Behalf of an Inter-NMI Network. Sensors, 21(5), 1564. https://doi.org/10.3390/s21051564