DOI: 10.3303/CET23103152 Paper Received: 04 July 2023; Revised: 19 July 2023; Accepted: 20 September 2023 Please cite this article as: Chin H.H., Varbanov P.S., Termizi S.N.A.A., Wan Alwi S.R., Manan Z.A., 2023, Blockchain-Based Transaction Data Structure Design for Process Integration and Industrial Symbiosis System, Chemical Engineering Transactions, 103, 907-912 DOI:10.3303/CET23103152 CHEMICAL ENGINEERING TRANSACTIONS VOL. 103, 2023 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Panos Seferlis, Yee Van Fan, Athanasios Papadopoulos Copyright © 2023, AIDIC Servizi S.r.l. ISBN 979-12-81206-02-1; ISSN 2283-9216 Blockchain-Based Transaction Data Structure Design for Process Integration and Industrial Symbiosis System Hon Huin China, Petar Sabev Varbanovb,*, Siti Nor Azreen Ahmad Termizib, Sharifah Rafidah Wan Alwib, Zainuddin Abdul Mananb aSustainable Process Integration Laboratory – SPIL, NETME Centre, Faculty of Mechanical Engineering, Brno University of Technology - VUT Brno, Technická 2896/2, 616 69 Brno, Czech Republic bProcess Systems Engineering Centre (PROSPECT), Research Institute for Sustainable Environment (RISE), Faculty of Chemical and Energy Engineering, Universiti Teknologi Malaysia, 81310 UTM Johor Bahru, Johor, Malaysia varbanov@fme.vutbr.cz Industrial Symbiosis (IS) and Process Integration (PI) are important activities with the potential to save resource intake and environmental footprints. Process Integration has been done theoretically and in practice for several decades but is still missing an efficient tool for multi-actor documentation and information preservation. The current paper sets out to develop data structures and tool prototypes for data preservation and transaction recording in process designs and Industrial Symbiosis (IS) to support the advancement of decentralised information tracking. The blockchain concept is utilised in this paper, where the information on the key properties of the streams and process stages can be stored in a secured block, and the transaction of resources can be dealt with using the information from the chain of blocks. Each block can represent the actors of the process in the IS, and an actor can request to join the blockchain by mining the blocks and going through the Proof-of- Work (PoW) verification of the new block. This paper introduces several terms to formulate a proper blockchain to store the information and showcase a simple simulation of adding/removing blocks for an IS system. The illustrative case study demonstrates that the method can evaluate Industrial Symbiosis and Process Integration solutions and track the key properties of the streams and process stages, costs, revenues, and environmental footprints. 1. Introduction The rapid technological development in the current convergence towards higher automation and efficiency has empowered industrial systems in the chemical industry to install many sensors to track the related data to keep up with the latest trends of the Internet of Things (IoT) and Industry 4.0/5.0 (De Nul et al., 2021). An enormous amount of data is available to be processed every second, so the need for computing is rapidly growing. It becomes challenging for centralised systems to ensure high availability to deliver fast data due to their vulnerability in single-point failure – i.e., one failure in the system can cause the entire system to fail. Network congestions and potential malicious attacks are also possible. In such cases, a decentralised and inherently secure system becomes highly preferable. The Peer-to-peer (P2P) model (Casado-Vara et al., 2018) is often adopted in decentralised systems where the peers (e.g., the companies) exchange information with one another directly through a local system without centralised commands. The main benefit is that the P2P system does not depend on single-point control; consequently, high system availability can be ensured. In such a system, if a failure happens at one point, it does not affect the rest of the system. One example of a P2P application is the decentralised energy trading application, where system availability and robustness are key to the operation (Sikorski et al., 2017). The scalability of a decentralised system is also flexible since the system is not highly integrated. Adding new nodes or actors does not impact the system as a whole that much. However, the identity of the new roles should be monitored to avoid malicious impacts. The application of blockchain technology is recognised as the most effective way to ensure trust among peers and is essentially widely adopted in distributed energy generation market (Yap et al., 2023). Historically, the 907 concept of “Blockchain” originated from Bitcoin – a digital cryptocurrency introduced by Satoshi Nakamoto in the year 2008 (Nakamoto, 2008). Blockchain is a fundamental technology for cryptocurrencies, and it consists of a data structure connected in chronological order as a transactional ledger (Schinckus, 2021). It is based on Merkel tree and security Hash function (SHA-256) encryption. Its decentralised nature makes data tampering extremely difficult and almost immutable by cryptographic techniques. The distributed ledger of data transmission and storage is achievable by using blockchain to allocate a shared ledger for each active user (Chen et al., 2022). The P2P market application has been widely adopted, mainly in energy trading applications (Zhou et al., 2018). Several articles can be easily found with unique applications of blockchain, such as new blockchain consensus in managing renewable energy with smart contracts (Wang et al., 2019) or fairness energy trading (Li et al., 2019). A noticeable application also can be found in chemical process systems, such as Heat Exchange Networks in Eco-Industrial Parks (Nair et al., 2016), regional plastic recycling (Chin et al., 2022), biogas generation and wastewater treatment plants (Gao et al., 2008). Kröhling et al. (2022) also designed prosumer-centric mechanisms to facilitate utility exchanges in Eco-Industrial Parks. The prosumers are incentivised to exchange utility surpluses, promoting recycling efforts while also benefiting the participating companies. Other applications that are found are in the additive industry (Kurpjuweit et al., 2021), construction waste material trading (Wu et al., 2023) and many more. Although the prosumers in these P2P Markets still have goals and interests of their own, the collaboration between them could result in higher profits, striving towards a common regional goal and win-win benefits to all participating firms. The decentralised tracking capabilities of a blockchain can improve the efficiency of emission trading schemes by reducing fraud and improving the fidelity of the system. A framework and methodology for mass implementation of energy and resources cooperation is proposed by integrating disparate fields of industrial ecology, business studies and industrial investments (Pyakurel and Wright, 2021). The literature review has shown the importance of information sharing between companies in driving the IS and the benefits of decentralised management with blockchain for an IS system. There are also limited applications of blockchain in the domain of Process Integration, which can potentially revolutionise the resource or utility exchange strategies among firms. This paper proposes a blockchain-based concept to record the resource data for transactions among plants, with the key properties being recorded. A plant within the hub of the studied IS with an energy surplus or deficit can record its data in a block to the same blockchain while undergoing the PoW mechanism for safety. An example of recording the data in a blockchain is showcased using the case study of Total Site Heat Integration. This paper is divided into several sections. Section 2 explains the basic blockchain concepts, and Section 3 showcases the example of the data structure being recorded in a block and demonstrates the addition of new actors/blocks to the existing chain. 2. Fundamentals of blockchain A blockchain is a database system which is managed in a decentralised way. It stores any type of information regarding the actors or users related to it – including the records, transactions, events, or scripts. In addition to those information records, a block also contains a number called ‘nonce’, which is a number dedicated to that block and can only be used once. These data and nonces are encrypted in a string of a fixed length, called a hash. Each hash represents the unique data and characteristics of that block. A linked block also contains the hash of the previous block, which also affects the generation of the unique hash for the block. Figure 1 shows an example of a linked blockchain with two blocks. Block #2 also contains the previous block’s exact hash value. The information on the previous block ensures that this block is indeed connected to the first block and cannot be altered easily. Figure 1: Example of a blockchain with two linked blocks 2.1 The Hash The Hash value is a key property of the block. It is generated via cryptographic hash functions, for example, the Secure Hash Algorithm–256 bit (Rogaway and Shrimpton, 2004). The algorithm can take any information as 908 input and produces a unique 64-digit hexadecimal number, but it is computationally expensive to get the data from the hash value. The characteristic of an ideal hash function also ensures that any slight change in the input data can result in a vastly different hash value. In this case, it is very difficult to predict the hash value with a similar set of inputs. This adds extra security to the malicious attacks, as one can only find the correct inputs randomly. Not only that, if a single data piece is modified in a block, the hash value is modified, and as the next block is dependent on the current block, this would affect the subsequent linked blocks as well. The block miner (one trying to find the nonce of the block) should not only mine the specific block but also all the subsequent linked blocks. An example is shown in Figure 2, where if one block is tampered with, the next block has to be corrected as well for the entire blockchain to function. 2.2 The consensus mechanisms in a P2P network Since blockchain is a decentralised system, that means anyone can join the network without authority intervention (such as Bitcoin blockchain). Different types of consensus mechanisms are implemented to ensure that all the nodes/blocks (users) agree on the content of the blockchain and that the block itself is synchronised with all other blocks. The common consensus mechanisms include Proof of Work (PoW) (Nakamoto, 2008), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (PBFT) (Aggarwal and Kumar, 2021). The most widely used consensus mechanisms are PoW and PoS (Bach et al., 2018). When a user makes a transaction or changes, the message is broadcasted onto the network and is transparent to all other users. In a PoW mechanism, the new user or miner creates a new block containing all the relevant transaction information and broadcasts it into the blockchain. The new block is mined until the nonce that produces a hash meeting the target (e.g., with the minimum number of leading zeroes in the hash) is found. The new block is broadcast to the network. Other nodes on the network start to verify the PoW of this chain and append the new block to their local chain. In this paper, a simple PoW mechanism is demonstrated. More information and basic blockchain tutorial sessions can be found in Zhou and Kraft (2022). Figure 2: Example of changing one block resulting in cascading changes to the next block(s) 3. Recording streams data for Total Site Heat Integration in a blockchain A Total Site Heat Integration (TSHI) problem involves a site with multiple processes/plants, where Heat Integration (HI) is performed in each plant first. As each plant contains heat surpluses or deficits with requirements of flows and temperatures, they are also matched with other plants for sending or receiving cross- site heat resources. 909 The steps for Data Extraction and recording are explained in Figure 3. Based on Varbanov et al. (2019), the data acquisition for a HI evaluation most often starts at the site level and follows the steps: 1) Site Description, 2) Identification of potential interfaces, 3) Scoping site processes, 4) Data acquisition for each selected process. The main parameters are process connections and the utility system, namely: processing capacities, process energy demand, primary energy demand, heat and power generation, and waste energy flows. The potential interactions of the site with the surrounding regional and municipal entities can be evaluated for increasing the efficiency of the energy resource utilisation via any waste heat reuse. When it comes to the level of processes, the first step of Data Extraction is to identify the process flowsheets, and then the stream properties are identified in two parts. First, the current (existing) duties of the heat exchangers, heaters and coolers are identified. This provides a baseline for the follow-up heat recovery evaluation. The second part of this procedure is the Process Streams selection (Hot and Cold Streams) for HI. Each process stream’s properties should be evaluated by the appropriate mass and energy flow measurements and approximate balancing. Data Reconciliation is the next step to ensure data consistency. This is done by using the measured data for flowrates, temperatures, and pressures, together with the appropriate process constraints, to reconcile the data set. Each process has an existing flowsheet. The next step is to identify the heat surpluses or deficits of the process by using appropriate tools. For a new design, such a tool is Pinch Analysis which identifies the minimum utility demands based on thermodynamic bounds. Depending on whether the process had conducted HI, the real energy surpluses or deficits depend on the current flowsheets, and the process/plant owner could record the data in a block and broadcast it into the blockchain. In retrofit or operational situations, the plant managers can identify the residual heating and cooling demands based on operational data and their judgement. In cases of dynamic operation such as that batch processes, process stream availability would vary with time, and the streams would have upper and lower limits on their temperatures and flowrates. Figure 3: Procedure in extracting heat surpluses and deficits from a process Table 1: Heat deficits or surpluses data for each process used in this work Process/Plant Hot streams data Cold streams data 1 Stream 1: 20 t/h, Tin = 100 oC, Tout = 40 oC Stream 2: 30 t/h, Tin = 200 oC, Tout = 90 oC Stream 3: 40 t/h, Tin = 400 oC, Tout = 100 oC - 2 • Stream 1: 50 t/h, Tin = 20 oC, Tout = 70 oC Stream 2: 60 t/h, Tin = 75 oC, Tout = 80 oC Stream 3: 70 t/h, Tin = 90 oC, Tout = 100 oC To demonstrate the recording of data in a blockchain, a simple simulation of creating blocks through a simple API is created, using Python Flask (FLASK, 2023) as a tool. Table 1 shows the example data of different processes to be added to the blockchain. 910 The PoW mechanism is straightforward here, by using the Hash SHA-256 algorithm to generate the hexadecimal hash values. The verification of the new block’s hash is done by ensuring the hash values start with four leading zeros, i.e., the first four digits of the hash values are 0. For instance, ‘0000c00870f23a23ae80377298491b091db400d575be0efbde5b310f2f763ed1’ is a valid hash value. The nonce of the block is represented by the number of iterations used to reach the correct hash values. Mining the first block yields a blockchain as a single block, as shown in Figure 4a below (a GET request). It shows that it takes about 115,558 iterations to generate the block with the ‘current_hash’ values. Since it is the first block, the previous hash value is shown as zero. A second block can join the blockchain by inputting the information, such as the previous block’s hash values and its own data. In this study, an endpoint to mine a new block is also created, and the user can send a POST request to the URL. Figure 4b shows the result of creating the second block. It can be seen that the previous hash values follow the first block’s value. For this block, the number of iterations to generate the hash is 48,245. One can notice that the hash values generated are vastly different, as this is the purpose of the cryptographic algorithm, to increase the difficulty of predicting the hash values of any block. (a) (b) Figure 4: (a) The first block of data for Plant 1 (b) Mining the second data block of Plant 2 4. Conclusions In this work, it is proposed that the heat surpluses and deficits data of a Total Site Heat Integration problem can be recorded via the concept of blockchain, and the system can be managed in a decentralised way using a P2P model. A simple blockchain simulation is created to explain the concept. The stream data containing the flowrates and temperatures can be broadcasted into the blockchain so that it is visible to other plants/actors within the blockchain. Mining the block requires the PoW mechanism, which could ensure that the new block fulfils the blockchain requirements. As the data are all protected with cryptographic hash values that are difficult to be hacked, the information is protected to ensure data privacy. Materials of the heat surpluses streams can also be recorded so the stream’s hazard level is made clear. Future work should include decentralised Total Site Heat Integration via smart contract management where the plants exchange heat energy flows. Carbon and energy footprint allocation considering processing the transactions, can be included as well. More secure PoW or PoS mechanisms for adding new blocks can be researched as well. The IT system for making efficient inter-actor communication efficient and traceable also needs to be defined and researched. Real-time optimisation can be crucial for enabling the feasibility and efficiency of the proposed cooperation architecture. Acknowledgements The authors acknowledge Universiti Teknologi Malaysia (UTM) for funding the research work related to this paper via grant Q.J130000.2409.08G86, UTM Prominent Visiting Researcher Scheme, the Malaysia Ministry of High Education and Universiti Malaysia Perlis under SLAB/SLAI scheme for financial sponsorship of the first 911 author’s doctoral degree studies. The EU-supported project Sustainable Process Integration Laboratory – SPIL funded as project No. CZ.02.1.01/0.0/0.0/15_003/0000456, by Czech Republic Operational Programme Research and Development, Education, Priority 1: Strengthening capacity for quality research is also acknowledged. References Aggarwal S, Kumar N., 2021, Cryptographic consensus mechanisms. Chapter In: Aggarwal S, Kumar N. (Eds.) The Blockchain Technology for Secure and Smart Applications Across Industry Verticals, Advances in Computers, 121, Elsevier, Amsterdam, The Netherlands, 211-226. Bach L.M., Mihaljevic B., Zagar M., 2018. Comparative analysis of blockchain consensus algorithms, In: 2018 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO). Presented at the 2018 41st International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), IEEE, Opatija, 1545–1550, DOI: 10.23919/MIPRO.2018.8400278. Casado-Vara R., Prieto J., De la Prieta F., Corchado J.M., 2018, How Blockchain improves the supply chain: case study alimentary supply chain. Procedia Computer Science, 134, 393-398 Chen Y., Chen H., Zhang Y., Han M., Siddula M., Cai Z., 2022, A survey on blockchain systems: Attacks, defenses, and privacy preservation. High-Confidence Computing, 2(2), 100048. Chin H.H., Varbanov P.S., You F., Sher F., Klemeš J.J., 2022, Plastic Circular Economy Framework using Hybrid Machine Learning and Pinch Analysis. Resources, Conservation and Recycling, 184, 106387. FLASK, 2023, Welcome to Flask — Flask Documentation (2.3.x). < https://flask.palletsprojects.com/en/2.3.x/>, accessed 09/07/2023. Gao L., Wu H., Jin H., Yang M., 2008, System study of combined cooling, heating and power system for eco- industrial parks. International Journal of Energy Research, 32(12), 1107-1118. De Nul L., Breque M., Petridis A., 2021, Industry 5.0: towards a sustainable, human centric and resilient European industry. Publications Office of the European Union, Luxembourg, ISBN: 978-92-76-25308-2. Kröhling D.E., Federico M., Federico H., Ernesto M., 2022, A peer-to-peer market for utility exchanges in Eco- Industrial Parks using automated negotiations. Expert Systems with Applications, 191, 116211. Kurpjuweit S., Schmidt C.G., Klöckner M., Wagner S.M., 2021, Blockchain in Additive Manufacturing and its Impact on Supply Chains. Journal of Business Logistics, 42, 46–70. Li Y., Yang W., He P., Chen C., Wang X., 2019, Design and management of a distributed hybrid energy system through smart contract and blockchain. Applied Energy, 248, 390–405. Nair S.K., Guo Y., Mukherjee U., Karimi I.A., Elkamel A., 2016, Shared and practical approach to conserve utilities in eco-industrial parks. Computers and Chemical Engineering, 93, 221–233. Nakamoto S., 2008, Bitcoin: a peer-to-peer electronic cash system. , accessed 24.06.2023 Pyakurel P., Wright L., 2020, Energy and resources cooperation for greenhouse gases emissions reduction of industrial sector, Energy and Environment, 32(4), 635-647. Rogaway P., Shrimpton T., 2004, Cryptographic hash-function basics: definitions, implications, and separations for preimage resistance, second-preimage resistance, and collision resistance. In Proceedings of the International Workshop on Fast Software Encryption, Springer, Berlin, GE, 371–88. Schinckus C., 2021, Proof-of-work based blockchain technology and Anthropocene: An undermined situation? Renewable and Sustainable Energy Reviews, 152, 111682. Sikorski J.J., Haughton J., Kraft M., 2017, Blockchain technology in the chemical industry: machine-to-machine electricity market, Applied Energy, 195, 234-246. Varbanov P.S., Yong J.Y., Klemeš J.J., Chin H.H., 2019, Data Extraction for Heat Integration and Total Site Analysis: A Review, Chemical Engineering Transactions, 76, 67-72. Wang S., Li D., Zhang Y., Chen J., 2019, Smart contract–based product traceability system in the supply chain scenario, IEEE Access, 7, 115122–33. Wu L., Lu W., Peng Z., Webster C., 2023, A blockchain non-fungible token-enabled 'passport' for construction waste material cross-jurisdictional trading, Automation in Construction, 149, 104783. Yap K.Y., Chin H.H., Klemeš J.J., 2023, Blockchain technology for distributed generation: A review of current development, challenges and future prospect, Renewable and Sustainable Energy Reviews, 175, 113170. Zhou Y., Wu J., Long C., 2018, Evaluation of peer-to-peer energy sharing mechanisms based on a multiagent simulation framework, Applied Energy, 222, 993–1022. Zhou X., Kraft M., 2022, Blockchain Technology in Chemical Industry, Annual Review of Chemical and Biomolecular Engineering, 13, 343-371. 912 https://www.sciencedirect.com/author/56903012000/jiri-jaromir-klemes