A Blockchain-Enabled IoT Logistics System for Efﬁcient Tracking and Management of High-Price Shipments: A Resilient, Scalable and Sustainable Approach to Smart Cities

: The concept of a smart city is aimed at enhancing the quality of life for urban residents, and logistic services are a crucial component of this effort. Despite this, the logistics industry has encountered issues due to the exponential growth of logistics volumes, as well as the complexity of processes and lack of transparency. Consequently, it is necessary to develop an efﬁcient management system that offers traceability and condition monitoring capabilities to ensure the safe and high-quality delivery of goods. Moreover, it is crucial to guarantee the accuracy and dependability of distribution data. In this context, this paper proposes a blockchain-enabled IoT logistics system for the efﬁcient tracking and management of high-price shipments. A smart contract based on blockchain technology has been designed for automatic approval and payment, with the aim of distributing shipping information exclusively among legitimate logistics parties. To ensure authentication, a zero-knowledge proof is used to conceal the blockchain address. Moreover, an intelligent parcel (iParcel) containing piezoresistive sensors is developed to pack delivered goods during the shipping process for violation detection such as severe falls or theft. The iParcels are automatically tracked and traced, and if a violation occurs, the contract is cancelled, and payment is refunded. The transaction fee per party is reasonable, particularly for high-price products that guarantee successful shipment.


Introduction
The employment of logistic services has been increasing in recent years, driven by a variety of factors including the growth of e-commerce and the need for flexible and agile supply chains.According to a report by Armstrong & Associates, the global market of thirdparty logistics providers was valued at approximately $935 billion in 2020 and is expected to continue growing at a compound annual growth rate of around 6% through 2025 [1].This trend is being driven by factors such as the rise of e-commerce and the need for companies to have more agile and flexible supply chains to meet the demands of online customers.In addition, the COVID-19 pandemic has also had an impact on the logistics industry, with many companies turning to third-party logistics to help them navigate disruptions in global trade and supply chains.The increased demand for third-party logistics services has been particularly pronounced in sectors such as healthcare and pharmaceuticals, where the need for timely and reliable delivery of critical goods has been heightened.
Internet of Things (IoT) has been utilized in a variety of ways to improve efficiency, accuracy, and transparency in the supply chain.One common use of IoT in logistics is asset tracking and monitoring.By attaching sensors to shipping containers, pallets, or other assets, companies can track their location, temperature, humidity, and other factors in real-time.This information can be used to optimize routes, reduce spoilage, and ensure that goods are delivered on time and in good condition.However, while businesses may effectively manage their internal operations using centralized systems and individual local databases, there is still a need for increased transparency and trust among stakeholders in various processes [2].For example, real-time tracking in supply chains can help reduce the wait for confirmation of information and improve efficiency.In addition, using a distributed system and disintermediating certain supply chain processes can enhance overall efficiency, particularly in cases of ownership or status changes between parties [3].
In this context, the integration between blockchain and IoT in smart contracts have been proposed to allow the creation of decentralized networks of devices that can autonomously carry out tasks and make decisions based on the data collected by the devices.The data collected by IoT devices can be securely and transparently recorded, ensuring the integrity and authenticity of the data.Smart contracts play a pivotal role in advancing smart cities, fostering efficiency, transparency, and security across urban logistics and infrastructure.They streamline supply chains, enabling faster deliveries and curbing congestion.Real-time tracking through IoT-linked contracts ensures timely deliveries.Automated payments benefit stakeholders such as drivers.Secure data exchange among parties boosts coordination.By digitizing agreements, smart contracts reduce manual paperwork.Optimized routing curtails congestion and improves fuel efficiency.Immutable contracts enhance trust, providing transparent records [4].
There have been several studies conducted on the integration of blockchain and IoT, with a focus on the potential applications and challenges of this integration.Some studies have identified the potential benefits of integration, such as improved security, transparency, and efficiency.However, there are also challenges to be addressed, such as reliability, interoperability, and privacy issues.This paper addresses these challenges by proposing a blockchain-based smart contract for automatic approval and payment with the consideration of distributing the shipping Information between legitimate logistics parties only.A zero-knowledge proof is utilized to conceal the blockchain address and verify the authentication.An intelligent Parcel (iParcel) containing piezoresistive sensors is also proposed for automatic tracking and tracing in which upon violation occurrence, the contract is cancelled and the payment is refunded.The main contributions of the paper can be summarized in the following: (i) A novel IoT-enabled parcel called iParcel for shipment tracking through the reading of GPS locations, and piezoresistive sensors to detect route change, opening, and severe falls.Although the explanation of how iParcel can be utilized in smart contract to ensure reliable shipment tracking has been presented, the detailed description of the iParcel was not presented.(ii) A privacy-preserving smart logistics contract using Ethereum blockchain for shipment supply chain management.The smart contract ensures that the distribution of shipment information remains between legitimate logistics parties only.This eliminates sharing personal data with third parties and distributing end users' personal information without permission.(iii) An implementation of the proposed system for a single echelon supply chain transaction between sender and receiver has been detailed, including the overall system architecture, party relations, and interactions among participating parties.
The rest of the paper is organized as follows: Section 2 discusses the related works and highlights the main difference between the proposed system and the existing systems; Section 3 details the proposed blockchain-enabled IoT logistics system including the archi-tecture and operation, iParcel, and smart contract; in Section 4, the implementation and the findings are discussed; finally, the paper is concluded.

Related Works
The application of IoT and blockchain in supply chain managements has attracted researchers in both academia and industry.The integration between these technologies is an enabler economy [5] and has been employed to improve supply chain management in different industries such as energy market [6], missile industry [7], agricultural food supply [8], healthcare [9,10], Industry 4.0, and Society 5.0 [11].IoT technology could be used to convert the physical flow of the supply chain into a digital flow.IoT tools are used to acquire real-time data on product location, condition, and environment.Numerous IoTbased logistic systems have been proposed in the literature [12][13][14][15][16][17].In contrast, blockchain technology is a potential solution for improving supply chain transparency, security, and traceability; however, there is still a need for further research to fully understand its implications and to develop best practices for its implementation [7].
The authors in [18] explored how blockchains and smart contracts can be used in IoT devices, discussing the benefits and restrictions associated with such applications.They concluded that incorporating blockchain and smart contract solutions in IoT ecosystems has made sharing IoT data and resources more convenient and has enabled the automation of slow workflows through cryptographically authenticated mechanisms.A blockchainregulated, secure, verifiable, and automatic key refreshment mechanism for IoT systems has been proposed in [7] to enable users to verify the freshness of security keys being used.The proposed solution was implemented using Ethereum and Hyperledger Fabric blockchains.The authors carried out cost, scalability, and security analyses for performance evaluation.The results show that the proposed mechanism is economically viable and has strong security.However, the study has some limitations.It does not address all possible attack scenarios, which may limit its effectiveness in real-world scenarios.Additionally, the proposed solution may not be suitable for all types of IoT systems due to differences in system architecture and requirements.
An integrated Building Information Modeling BIM-IoT-Blockchain model has been proposed in [19] to help automate the monitoring process of mega complex infrastructure projects.It creates a Decentralized Common Data Environment (DCDE) for data management.This model would enable the real-time monitoring of construction projects, and improve construction supply chain management, construction asset management, and administration of smart construction contracts.The results show that the proposed BIM-IoT-Blockchain model can significantly improve the efficiency and transparency of construction projects.It can also reduce errors and delays by providing real-time monitoring and improved supply chain management.In [20], a solution that integrates blockchain and IoT technologies into the supply chain management system has been proposed to create a sustainable virtual closed-loop supply chain in E-commerce.The implementation of this solution involves developing an optimization model that considers the reduction of total supply chain costs, sustainability, circular economy, and the integration of blockchain and IoT technologies.The model also includes reselling, refurbishing, recycling, and disposing of products in a single framework to achieve circular economy and sustainability.
The authors in [11] aimed to address the limitations and challenges of using blockchain technology in industries, including scalability, energy consumption, security, and regulatory concerns.A blockchain-based solution was proposed to leverage artificial intelligence (AI) and the Internet of Things (IoT) for secure and efficient data sharing in various industries.The solution involves smart contracts for automated transactions and data integrity, and AI algorithms for optimized resource allocation and system performance improvement.The main limitation of the study is the suitability of the solution for different use cases or industries due to regulatory frameworks or technical requirements.Moreover, further evaluation of scalability and energy efficiency on a larger scale is required.
The potential of smart contracts using blockchain technology in improving transparency, security, and traceability in supply chain operations was also explored.In [21], a peer-to-peer transaction model was proposed based on blockchain for IoT operations, along with a technique for recording smart property and payment data transactions using smart contracts and smart coding.The authors in [9] investigated how blockchain technology can improve the IoT and suggest incorporating it into government infrastructures through regulations.It is expected that cryptocurrencies will become on par with fiduciary money in the future due to the integration of IoT and blockchain.A supply blockchain-based platform has been proposed in [7] to leverage Hyperledger Fabric to develop a proof-ofconcept framework.The platform includes smart contracts to automate aspects of supply chain management and simulation software to model different scenarios for evaluation.Although the findings indicated that employing blockchain technology has the potential to improve supply chain transparency and reduce fraud risks through the real-time tracking of goods, it could face several challenges such as scalability and legal/regulatory concerns.The main limitation of the study is the focus on a single case study and the use of simulation software instead of real-world testing.
In [22], an IoT-blockchain-integrated, hospital-side-oriented Pharmaceutical Supply Chains (PSC) management model has been proposed with three layers: IoT-based physical data layer, blockchain-based data control layer, and data storage and management layer.The authors discussed how this model can enhance supply chain resilience through improved information sharing, traceability, security, and efficiency.A literature review was combined with semi-structured interviews to investigate PSC characteristics, key aspects affecting PSC, and challenges faced by PSC stakeholders for implementation.The authors provide a detailed description of the proposed model's architecture and components.The findings suggest that IoT-blockchain integration can enhance PSC resilience by enabling the real-time monitoring of drug quality and location, reducing counterfeiting risks, improving supply chain visibility and transparency, enhancing trust among stakeholders, and enabling efficient collaboration.However, limitations such as high implementation costs and interoperability issues between different systems or platforms used by different stakeholders in the supply chain should also be considered.
A smart cargo management and monitoring method using blockchain technology and UHF RFID has been proposed in [23] for faster and contactless traceability.Ethereumbased smart contract between the parties has been developed as an automatic payment and approval mechanism.However, the study focused only on local cargo distribution networks rather than global logistics networks within the supply chain.Additionally, further research is needed to evaluate the scalability and feasibility of this approach in realworld scenarios.A new federated, learning-enabled, blockchain-based framework has been developed in [24] that ensures the security and privacy of sensor-IoT-based architectures using sampled Electrochemical sensors (ECS) data.The performance of the framework has been evaluated in terms of the immutability and traceability of data.The findings revealed that the developed framework achieved high levels of security and privacy while maintaining data integrity.However, small-scale testing of the framework on a sensor network and the lack of evaluation in larger-scale deployments are the main limitations of the study.The authors also recognized that other factors beyond security and privacy could impact the effectiveness of the framework in real-world applications.
Table 1 summarizes the existing blockchain-enabled IoT logistics systems.While there have been previous studies on the integration of blockchain and IoT technologies, there are still gaps in the literature that call for further research to achieve comprehensive integration between the two technologies.Despite the potential benefits of IoT devices in providing real-time data on product location and condition, there are concerns about their vulnerability to cyber-attacks or data breaches, which can compromise the security and integrity of supply chain data.Furthermore, implementing blockchain technology poses challenges due to its complexity and high computational requirements.Issues with reliability and privacy preservation of distribution information also arise in the context of blockchain integration with IoT technologies.

Proposed Blockchain-Enabled IoT Logistics System
The proposed blockchain-enabled IoT logistics system monitors and tracks shipments through a sensory data flow during fright shipment from the source to the end destination.The following sub-sections describe the main components of the system in detail, including architecture and operation, iParcel, and smart contract.

Architecture and Operation Workflow
A multi-layer IoT architecture for the blockchain-enabled IoT logistics system is employed to meet the needs of freight shipment in the logistics industry.The architecture consists of three layers: the sensing layer, network layer, and application layer, as shown in Figure 1.
integrity of supply chain data.Furthermore, implementing blockchain technology poses challenges due to its complexity and high computational requirements.Issues with reliability and privacy preservation of distribution information also arise in the context of blockchain integration with IoT technologies.

Proposed Blockchain-Enabled IoT Logistics System
The proposed blockchain-enabled IoT logistics system monitors and tracks shipments through a sensory data flow during fright shipment from the source to the end destination.The following sub-sections describe the main components of the system in detail, including architecture and operation, iParcel, and smart contract.

Architecture and Operation Workflow
A multi-layer IoT architecture for the blockchain-enabled IoT logistics system is employed to meet the needs of freight shipment in the logistics industry.The architecture consists of three layers: the sensing layer, network layer, and application layer, as shown in Figure 1.In the sensing layer, the system employs piezoresistive pressure sensors embedded in iParcel, and Global positioning System (GPS) to monitor and track shipments by In the sensing layer, the system employs piezoresistive pressure sensors embedded in iParcel, and Global positioning System (GPS) to monitor and track shipments by detecting abnormal events such as heavy dropping or steeling.A battery is used to supply the power required for sensors.In the network layer, a cellular network is employed to notify the smart contract immediately upon an abnormal event detection, and upload the shipment ID, time, location, and event information to the application layer.Related information such as battery charge percentage and shipment status could also be included.The application layer is the highest layer, which includes the developed web-based online platform and smart contract.The platform is developed using the PHP programming language and communicates with a MySQL database to monitor the status of high-price shipments during distribution.In contrast, smart contracts are computer programs that self-execute and identify the parties, their duties, and the payment mechanism between the parties.The platform and smart contracts receive related information transmitted by iParcel.
The workflow of smart contract and shipment distribution that is successfully completed without any violation event is shown in Figure 2. The system considers four main parties involved in the distribution process: sender, receiver, courier office, and distributors.All the parties participate in smart contracts in which each party has their own Ethereum address.The addresses are generated instantly without a centralized entity [25].The proposed shipping model is single echelon, with a single sender and single recipient; however, it may be expanded to enable multi-echelon shipments, in which the receiver becomes the subsequent sender.
the power required for sensors.In the network layer, a cellular network is employed to notify the smart contract immediately upon an abnormal event detection, and upload the shipment ID, time, location, and event information to the application layer.Related information such as battery charge percentage and shipment status could also be included.The application layer is the highest layer, which includes the developed web-based online platform and smart contract.The platform is developed using the PHP programming language and communicates with a MySQL database to monitor the status of high-price shipments during distribution.In contrast, smart contracts are computer programs that selfexecute and identify the parties, their duties, and the payment mechanism between the parties.The platform and smart contracts receive related information transmitted by iParcel.
The workflow of smart contract and shipment distribution that is successfully completed without any violation event is shown in Figure 2. The system considers four main parties involved in the distribution process: sender, receiver, courier office, and distributors.All the parties participate in smart contracts in which each party has their own Ethereum address.The addresses are generated instantly without a centralized entity [25].The proposed shipping model is single echelon, with a single sender and single recipient; however, it may be expanded to enable multi-echelon shipments, in which the receiver becomes the subsequent sender.

Intelligent-Parcel (iParcel) Based on IoT
The proposed iParcel comprises of flexible sensing circuits containing piezoresistive pressure sensors (i.e., Uneo GD05, UNEO Inc., Taiwan) and a terminal hardware circuit comprised of a motherboard and a daughterboard.Flexible sensing circuits are connected to a terminal hardware circuit, which collects and analyses sensing data.The basic operation of piezoresistive sensors is based on variations in the resistance value of a material under mechanical stress, causing the output voltage signal to fluctuate with pressure.The violation events are detected by reading the GPS location to detect route change, and the readings of piezoresistive sensors to detect openings and severe falls of the iParcel.Cellular networks are used to notify the smart contract about violation occurrence.

Smart Contract
Smart contracts are computer programs that self-execute and identify the parties, their duties, and the payment mechanism between the parties.For each iParcel shipment, a separate smart contract can be created by either the sender or the courier office.As stated earlier, there are four main parties involved in the distribution process: sender, receiver, courier office, and iParcel.Figure 3 describes the operation of the proposed smart contract.

Intelligent-Parcel (iParcel) Based on IoT
The proposed iParcel comprises of flexible sensing circuits containing piezoresistive pressure sensors (i.e., Uneo GD05, UNEO Inc., Taiwan) and a terminal hardware circuit comprised of a motherboard and a daughterboard.Flexible sensing circuits are connected to a terminal hardware circuit, which collects and analyses sensing data.The basic operation of piezoresistive sensors is based on variations in the resistance value of a material under mechanical stress, causing the output voltage signal to fluctuate with pressure.The violation events are detected by reading the GPS location to detect route change, and the readings of piezoresistive sensors to detect openings and severe falls of the iParcel.Cellular networks are used to notify the smart contract about violation occurrence.

Smart Contract
Smart contracts are computer programs that self-execute and identify the parties, their duties, and the payment mechanism between the parties.For each iParcel shipment, a separate smart contract can be created by either the sender or the courier office.As stated earlier, there are four main parties involved in the distribution process: sender, receiver, courier office, and iParcel.Figure 3 describes the operation of the proposed smart contract.
In the first process (1), the sender or the courier office initiates the shipment distribution by creating the smart contract, generating a secret token, and encrypting the next owner address A No (i.e., the receiver address since the single echelon scenario is considered) to obtain Enc(A No ).The address is encrypted using elliptic curve ElGamal encryption, as presented in [26].The sender completes the trusted setup by generating a proving key pair and employs Verifier Contract (VC) on the blockchain for proof confirmation.The zero-knowledge proofs (zk-SNARKs) are used in the trusted setup to generate the proving key pair, as specified in [27].Then, the ciphertext of the next owner address Enc(A No ) and VC address are recorded in the smart contract.In the second process (2), the sender deposits the payment for shipping and hands over the package to the courier office.The courier proceeds with the shipment process if the payment is successful, but it is cancelled otherwise.In the third process (3), upon receiving the goods from the sender, the courier office ensures that the package conditions are as specified in the contract.If the conditions are met, the package is approved, enclosed in iParcel, and shipped to the receiver.Otherwise, the package is aborted and the contract is cancelled.In the first process (1), the sender or the courier office initiates the shipment distribution by creating the smart contract, generating a secret token, and encrypting the next owner address   (i.e., the receiver address since the single echelon scenario is considered) to obtain (  ).The address is encrypted using elliptic curve ElGamal encryption, as presented in [26].The sender completes the trusted setup by generating a proving key pair and employs Verifier Contract (VC) on the blockchain for proof confirmation.The zero-knowledge proofs (zk-SNARKs) are used in the trusted setup to generate the proving key pair, as specified in [27].Then, the ciphertext of the next owner address (  ) and VC address are recorded in the smart contract.In the second process (2), the sender deposits the payment for shipping and hands over the package to the courier office.The courier proceeds with the shipment process if the payment is successful, but it is cancelled otherwise.In the third process (3), upon receiving the goods from the sender, the courier office ensures that the package conditions are as specified in the contract.If the conditions are met, the package is approved, enclosed in iParcel, and shipped to the receiver.Otherwise, the package is aborted and the contract is cancelled.
Upon the arrival of the package to the destination, as stated in process ( 4), the courier Upon the arrival of the package to the destination, as stated in process (4), the courier office will not release the shipment unless the receiver sends the correct proof based on the sender's shared proving key to the contract, which in turn verifies if the proof is valid and updates the recorded owner.Consequently, the payment will be released to the courier office.If a violation occurs during the shipment process, the shipment is canceled, and the sender is refunded.The smart contract ensures that the legitimate receiver receives the shipment.If a violation occurs, as described in process (5), the iParcel notifies the smart contract about the violation event.Accordingly, the contract is cancelled, and the payment is refunded to the sender.The violation criteria such as route, fall threshold, and payment terms are defined during contract creation.
The smart contract includes the following key elements: (i) variables that represent values and states reflecting the shipment state, type of violation, and the addresses of the involved parties, (ii) methods related to contract functionality that notify about violation events and authenticate the legitimate receiver, and (iii) events that are used to broadcast information to all parties or record vital information on the ledger.Figure 4 shows the steps of smart contract and shipment distribution from the initiation until shipping.The details of the seven steps that are carried out among the parties are as follows: 1.
CreateContract(): The contract is created in this stage by the sender or the courier staff through the courier platform (i.e., courier application, website or management platform).However, the study will consider the scenario of creating the smart contract by the sender.2.
TrustSetup(): Generate a secret token and encrypt the next owner address A No to obtain Enc(A No ).Complete trusted setup and deploy verifier contract.Specify the receiver as Enc(A No ) and set the VC address as AVC.The method is called by the contract creator (i.e., sender or courier office).3.
ShareKey(): Generate a proving key pair and employ Verifier Contract (VC) on the blockchain for proof confirmation.This method can also only be called by the contract creator.4.
DepositMoney(): deposit the payment to the smart contract.If the payment is successful, the courier proceeds with the shipment process.Otherwise, the shipment process is cancelled.This method can only be called by the sender.5.
PackageSent(): handing over the package to the courier office, which in turn ensures that the package conditions are as specified in the contract.This method can only be called by the courier office.6.
PackageApproved(): confirm and check if the package is as specified in the contract.If it is not, the package will be rejected, and the contract will be cancelled; otherwise, the package will be approved.The method can only be called by the courier office.7.
IparcelShipping(): prepare iParcel and initiate shipping process upon the package approving.This method can also only be called by the courier office.If the package is delivered successfully without any violation event, the steps shown in Figure 5 will be conducted.The details of these steps that are carried out among the parties are as follows: 1. iParcelArrived(): notify the receiver and the smart contract of iParcel arrival.2. SendProof(): upon package arrival, the receiver generates proof based on the sender's If the package is delivered successfully without any violation event, the steps shown in Figure 5 will be conducted.The details of these steps that are carried out among the parties are as follows: 1.
iParcelArrived(): notify the receiver and the smart contract of iParcel arrival.2.
SendProof(): upon package arrival, the receiver generates proof based on the sender's shared proving key and delivers the proof to the smart contract, which in turn verifies if the proof is valid and updates the recorded owner to Enc(A No ).3.
GetMoney(): claim the money that has been deposited in the smart contract if the proof is verified.Once the payment is done, the sender and courier office will be notified.If the package is delivered successfully without any violation event, the steps shown in Figure 5 will be conducted.The details of these steps that are carried out among the parties are as follows: 1. iParcelArrived(): notify the receiver and the smart contract of iParcel arrival.2. SendProof(): upon package arrival, the receiver generates proof based on the sender's shared proving key and delivers the proof to the smart contract, which in turn verifies if the proof is valid and updates the recorded owner to Enc(  ). 3. GetMoney(): claim the money that has been deposited in the smart contract if the proof is verified.Once the payment is done, the sender and courier office will be notified.The steps outlined above represent a successful shipment transfer between parties.However, unforeseen situations may arise at any point, including deposit failure, problem detection from iParcel, or authorization issues during shipment receipt.If a violation occurred during the shipment, the messages sequence shown in Figure 6 will be conducted as follows: 1.
ViolationOccurred(): once a violation occurs, iParcel will notify the smart contract, which will in turn cancel the shipment and notify all parties.2.
GetMoney(): Because the shipment process is cancelled, the sender will get refund of the deposit money.
Sustainability 2023, 15, x FOR PEER REVIEW 10 of 18 The steps outlined above represent a successful shipment transfer between parties.However, unforeseen situations may arise at any point, including deposit failure, problem detection from iParcel, or authorization issues during shipment receipt.If a violation occurred during the shipment, the messages sequence shown in Figure 6 will be conducted as follows: 1. ViolationOccurred(): once a violation occurs, iParcel will notify the smart contract, which will in turn cancel the shipment and notify all parties.2. GetMoney(): Because the shipment process is cancelled, the sender will get refund of the deposit money.Different access permissions are allocated to the involved parties to facilitate the protection of privacy and possible attacks for inhibiting traceability.Figure 7 shows the access permissions to the shipment information of each party, in which access is prevented to unauthorized parties.This is achieved using the encrypted sender address and zeroknowledge proof.The security of the encrypted address could be granted using crypto- Different access permissions are allocated to the involved parties to facilitate the protection of privacy and possible attacks for inhibiting traceability.Figure 7 shows the access permissions to the shipment information of each party, in which access is prevented to unauthorized parties.This is achieved using the encrypted sender address and zero-knowledge proof.The security of the encrypted address could be granted using cryptographic security, which varies according to key length and cryptographic algorithm.It is extremely difficult to decrypt the encrypted address in a reasonable period if the private key is unknown.The suggested approach employs a 254-bit elliptic curve to assure the security of the encrypted address [28].In contrast, since unauthorized parties are unable to extract data from the proof such as the address and the secret token, the proposed solution's zero-knowledge proof eliminates privacy breaches, including the sender's private address.Different access permissions are allocated to the involved parties to facilitate the protection of privacy and possible attacks for inhibiting traceability.Figure 7 shows the access permissions to the shipment information of each party, in which access is prevented to unauthorized parties.This is achieved using the encrypted sender address and zeroknowledge proof.The security of the encrypted address could be granted using cryptographic security, which varies according to key length and cryptographic algorithm.It is extremely difficult to decrypt the encrypted address in a reasonable period if the private key is unknown.The suggested approach employs a 254-bit elliptic curve to assure the security of the encrypted address [28].In contrast, since unauthorized parties are unable to extract data from the proof such as the address and the secret token, the proposed solution's zero-knowledge proof eliminates privacy breaches, including the sender's private address.

System Implementation and Results
Remix IDE has been used to implement and test the proposed system due to its rich features that enable testing and debugging smart contracts before deployment [29,30].It

System Implementation and Results
Remix IDE has been used to implement and test the proposed system due to its rich features that enable testing and debugging smart contracts before deployment [29,30].It comes with a built-in debugger that allows the investigation of various transactions to ensure the correct behavior of the contract in various conditions.Ethereum smart contracts were used due to their extensive documentation and their use in blockchain-based applications, and because Remix could provide multiple Ethereum wallets that allow simulating real-life scenarios.ZoKrates [31] was also used to implement zero-knowledge proof.However, several noteworthy alternatives to Ethereum are available in the blockchain landscape that could be used.Binance Smart Chain (BSC) stands out for its cost-effectiveness and rapid transactions, employing a unique Proof of Staked Authority consensus mechanism.Cardano (ADA) differentiates itself with its research-focused development approach and the Ouroboros Proof of Stake protocol, ensuring scalability and security.Solana (SOL) caters to speed, utilizing the Proof of History consensus for quick transaction finality.Polkadot (DOT) prioritizes interoperability by allowing different blockchains to operate in parallel through sharding.Lastly, Avalanche (AVAX) offers a secure environment for decentralized applications and financial projects, propelled by the Avalanche consensus for swift confirmation [32].
This section provides implementation details and primarily focuses on testing the correct functionality and interaction among system participants using the Ethereum smart contract.

Implementation Details
The code was written in the Solidity programing language, based on the code presented in [29], using Remix IDE and tested for the Ethereum blockchain [30].Each of the four parties participating in the contract has an Ethereum address with an initial balance 100 ETH and can call methods in the smart contract using the modifiers that restrict methods calling to specific parties.For instance, CreateContract() can be called by the sender or courier office only, and DepositMoney() can be called by the sender.The wallet addresses allocated to the parties are shown in Figure 8. contract.

Implementation Details
The code was written in the Solidity programing language, based on the code presented in [29], using Remix IDE and tested for the Ethereum blockchain [30].Each of the four parties participating in the contract has an Ethereum address with an initial balance 100 ETH and can call methods in the smart contract using the modifiers that restrict methods calling to specific parties.For instance, CreateContract() can be called by the sender or courier office only, and DepositMoney() can be called by the sender.The wallet addresses allocated to the parties are shown in Figure 8.After creating the smart contract, the courier office, upon getting the item from the sender, checks if the item is as specified in the contract.The shipment is aborted if it is not as specified.Otherwise, the item is included in the iParcel and sealed.This ensures that the iParcel is trusted by all parties and operates flawlessly before shipment.The parcel state is maintained throughout the code to ensure the shipment's logical flow.The enum variable named "packageState" is used to represent the parcel's state.At the start of each method call, the current state of the parcel is checked, and based on the execution, any necessary state changes are made and updated.The new state is then communicated as an event to all Involved parties, allowing the next caller to act accordingly.Figure 9 shows the attributes of the smart contact code.
If any preidentified violation occurred after shipping, iParcel will call the function "violationOccurred(string, violationType, int)" with parameters including a string message for the triggered event, an enum for the violation type, and an integer for the violation value.This function then changes the state of the package to "Aborted" and issues a refund to the sender.Figure 10 displays the code that is executed by iParcel when a violation occurs.To verify the receiver's authenticity when the shipment reaches its destination, the receiver generates proof based on the sender's shared proving key and delivers After creating the smart contract, the courier office, upon getting the item from the sender, checks if the item is as specified in the contract.The shipment is aborted if it is not as specified.Otherwise, the item is included in the iParcel and sealed.This ensures that the iParcel is trusted by all parties and operates flawlessly before shipment.The parcel state is maintained throughout the code to ensure the shipment's logical flow.The enum variable named "packageState" is used to represent the parcel's state.At the start of each method call, the current state of the parcel is checked, and based on the execution, any necessary state changes are made and updated.The new state is then communicated as an event to all Involved parties, allowing the next caller to act accordingly.Figure 9 shows the attributes of the smart contact code.the proof to the smart contract, which in turn verifies if the proof is valid and updates the recorded owner.If any preidentified violation occurred after shipping, iParcel will call the function "violationOccurred(string, violationType, int)" with parameters including a string message for the triggered event, an enum for the violation type, and an integer for the violation value.This function then changes the state of the package to "Aborted" and issues a refund to the sender.Figure 10 displays the code that is executed by iParcel when a violation occurs.To verify the receiver's authenticity when the shipment reaches its destination, the receiver generates proof based on the sender's shared proving key and delivers the proof to the smart contract, which in turn verifies if the proof is valid and updates the recorded owner.

Results and Discussion
The proposed system is tested to validate the correct functionality based on four scenarios.The first scenario tests the successful shipment to ensure the correct state change of the package with the shipment flow and sequence.It also ensures that events and logs are updated accordingly.The results confirmed that the system does not execute any function before its turn or get called by the wrong party.For instance, an error occurs when the function IparcelShipping() is executed before approving the package as stated in the contract and executing PackageApproved(), as shown in Figure 11.

Results and Discussion
The proposed system is tested to validate the correct functionality based on four scenarios.The first scenario tests the successful shipment to ensure the correct state change of the package with the shipment flow and sequence.It also ensures that events and logs are updated accordingly.The results confirmed that the system does not execute any function before its turn or get called by the wrong party.For instance, an error occurs when the function IparcelShipping() is executed before approving the package as stated in the contract and executing PackageApproved(), as shown in Figure 11.The second scenario examines the detection of violations and errors.For instance, if iParcel is dropped heavily or opened, the function ViolationOccurred() is called and the message "the shipment is aborted" will be written in the log, as shown in Figure 12.If the function DepositMoney() is not executed successfully because the money is not deposited yet or deposited money is less than the shipment price, the log will have the message "Money deposited is insufficient".The second scenario examines the detection of violations and errors.For instance, if iParcel is dropped heavily or opened, the function ViolationOccurred() is called and the message "the shipment is aborted" will be written in the log, as shown in Figure 12.If the function DepositMoney() is not executed successfully because the money is not deposited yet or deposited money is less than the shipment price, the log will have the message "Money deposited is insufficient".
The second scenario examines the detection of violations and errors.For instance, if iParcel is dropped heavily or opened, the function ViolationOccurred() is called and the message "the shipment is aborted" will be written in the log, as shown in Figure 12.If the function DepositMoney() is not executed successfully because the money is not deposited yet or deposited money is less than the shipment price, the log will have the message "Money deposited is insufficient".The third scenario tests the privacy preservation of distribution information to ensure that any party not involved in the product distribution cannot know any distribution information.The distribution information is encrypted; hence, any party not involved in the product distribution does not have the means of decryption.This indicates that the proposed system is able to preserve the privacy of distribution information.Finally, the fourth scenario tests the verification process of the receiver's authenticity and the update of the owner record.The package will be released once the smart contract gets the correct proof based on the sender's shared proving key from the receiver.Consequently, the recorded owner will be updated to Enc(  ) and the event Receiver-AuthenticatedSuccessfully will be triggered with the message "Authenticated successfully", as shown in Figure 13.The package is not released if the receiver failed to provide the correct proof, which indicates that the proposed method is able to authorize and release the package successfully.The third scenario tests the privacy preservation of distribution information to ensure that any party not involved in the product distribution cannot know any distribution information.The distribution information is encrypted; hence, any party not involved in the product distribution does not have the means of decryption.This indicates that the proposed system is able to preserve the privacy of distribution information.Finally, the fourth scenario tests the verification process of the receiver's authenticity and the update of the owner record.The package will be released once the smart contract gets the correct proof based on the sender's shared proving key from the receiver.Consequently, the recorded owner will be updated to Enc(A No ) and the event Receiver-AuthenticatedSuccessfully will be triggered with the message "Authenticated successfully", as shown in Figure 13.The package is not released if the receiver failed to provide the correct proof, which indicates that the proposed method is able to authorize and release the package successfully.The transaction cost per party in the first and second scenarios was also evaluated.The transaction cost was calculated by multiplying the output value per unit by the gas price, which were then converted into USD.Gas unit is a measurement of the computational work necessary to implement contracts on the Ethereum blockchain platform.The gas price was 20.19 × 10 −6 USD per gas at time of evaluation on 27 November 2022 at 22:05 (EST).The maximum transaction charge in the contract differs between parties because each party executes different processes.Different functions are executed by each party to implement the shipping process in which the proof process is implemented utilizing zero-knowledge proof.The transaction costs differ from one party to another, which reflects the different functions and the instructional complexity and data size conducted by each party.The transaction cost per party in the first scenario is shown in Figure 14.The transaction cost per party in the first and second scenarios was also evaluated.The transaction cost was calculated by multiplying the output value per unit by the gas price, which were then converted into USD.Gas unit is a measurement of the computational work necessary to implement contracts on the Ethereum blockchain platform.The gas price was 20.19 × 10 −6 USD per gas at time of evaluation on 27 November 2022 at 22:05 (EST).The maximum transaction charge in the contract differs between parties because each party executes different processes.Different functions are executed by each party to implement the shipping process in which the proof process is implemented utilizing zero-knowledge proof.The transaction costs differ from one party to another, which reflects the different functions and the instructional complexity and data size conducted by each party.The transaction cost per party in the first scenario is shown in Figure 14.
gas price was 20.19 × 10 USD per gas at time of evaluation on 27 November 2022 at 22:05 (EST).The maximum transaction charge in the contract differs between parties because each party executes different processes.Different functions are executed by each party to implement the shipping process in which the proof process is implemented utilizing zero-knowledge proof.The transaction costs differ from one party to another, which reflects the different functions and the instructional complexity and data size conducted by each party.The transaction cost per party in the first scenario is shown in Figure 14.The results show that the transaction paid by the receiver was higher than other parties.This is because the shipping-receiving process has high complexity compared to the creating contract process.The total transaction fees for sender, receiver, and courier office are 1.96 × 10 6 , 2.1 × 10 6 , and 0.9 × 10 6 gas units, respectively.This is equal to the range between 16.15 and 42.40 USD at the time of evaluation.In contrast, for the transaction cost in the second scenario (i.e., violation occurrence), the sender has the highest cost because the enrollment process was conducted only.The total transaction fees for sender, receiver, courier office, and iParcel are 1.96 × 10 6 , 1 × 10 6 , 0.9 × 10 6 , and 0.2 × 10 6 gas units, respectively.This is equal to the range between 4.1 and 39.57USD at the time of evaluation.Such fees are reasonable charges in the payment of guaranteed successful shipment, especially with high-price products such as automobiles and large home appliances.
The proposed system addresses privacy preservation, cyber-attack vulnerabilities, and data breaches, but requires significant computational resources for shipments.It has not been extensively tested for scalability and energy efficiency in large deployments.Moreover, the evaluation does not cover all potential attack scenarios, potentially limiting The results show that the transaction paid by the receiver was higher than other parties.This is because the shipping-receiving process has high complexity compared to the creating contract process.The total transaction fees for sender, receiver, and courier office are 1.96 × 10 6 , 2.1 × 10 6 , and 0.9 × 10 6 gas units, respectively.This is equal to the range between 16.15 and 42.40 USD at the time of evaluation.In contrast, for the transaction cost in the second scenario (i.e., violation occurrence), the sender has the highest cost because the enrollment process was conducted only.The total transaction fees for sender, receiver, courier office, and iParcel are 1.96 × 10 6 , 1 × 10 6 , 0.9 × 10 6 , and 0.2 × 10 6 gas units, respectively.This is equal to the range between 4.1 and 39.57USD at the time of evaluation.Such fees are reasonable charges in the payment of guaranteed successful shipment, especially with high-price products such as automobiles and large home appliances.
The proposed system addresses privacy preservation, cyber-attack vulnerabilities, and data breaches, but requires significant computational resources for shipments.It has not been extensively tested for scalability and energy efficiency in large deployments.Moreover, the evaluation does not cover all potential attack scenarios, potentially limiting its real-world effectiveness.Our work's limitation is summarized by the research context, which is a prototype environment designed to respond to real-world problem challenges within the principles and conditions of scientific research.The innovative approach we introduced in this research is a showcase, a bold case study for the capacity of emerging technologies such as Internet of Things and blockchain to support novel, sophisticated implementations for the efficient tracking and management of shipments with cost-fair methodologies that are scalable and robust.In a greater context, this blockchain prototype challenges the regulatory framework for the adoption of blockchain and IoT and the need to provide a transparent financial system.In other words, our application is also limited in the sense that while it delivers the core business and the main objectives of its design, it requires additional adjustments for a fully scalable platform capable of addressing all the requirements of the regulatory framework.At the moment, these frameworks are under development by the government and the supervising authorities.
The key implications of our research are summarized as follows: Efficiency: The proposed methodology and proposed installation of the blockchainbased IoT logistic systems for efficient tracking and management of shipments leads to a fully secure, trusted, cost-fair, and efficient solution capable of improving the management of high-value shipments in the context of smart cities and global trade.
Scalability: Our research communicated a fully scalable and integrated approach, which means that it can be applied in the context of any smart transportation and supply chain management projects in a smart city at a global scale.This leads to the sustainability of implementation.The algorithms that power our approach can also serve a bid data smart logistics ecosystem, where more sophisticated analysis and analytics methods for enhanced decision making can be executed.In our research in this paper, we focused on the efficient tracking and management of high-value shipments; in the future, we intend to also focus on the proactive analysis towards optimization and additional value-adding analytical services.This will lead to a sophisticated holistic approach to management of efficient tracking and management of shipments.The integration of this system to AI-enabled intelligent agents can also significantly promote a novel industry of data-driven and blockchain-enabled secure e-marketplaces of shipment management.
Extensibility: Our methodology and implementation can be extended to other various phases of the logistics lifecycle that include the value-adding stages of efficient tracking and management of shipments.As we discussed in the previous paragraph, phases such as utilization or scheduling can be integrated in our methodological approach by extending the lifecycle of the logistics lifecycle and by providing rich data for sophisticated analysis and enhanced decision making.
The key findings that are summarized in the previous section also provide evidence for a strategic interpretation.The first bold interpretation is that modern applied sciences and robust information processing capabilities can empower smart logistics systems that enhance sustainable and resilient economic development.Our interdisciplinary research proved that the deployment of the blockchain-based IoT logistics system for efficient tracking and management of shipments can significantly improve the capacity of systems to enhance the unique value proposition of smart logistics applications in the areas of commerce, supply chain efficiency, and traffic management, including financial management.
Another key implication of our research is related to the data intensity and the network capability of smart logistics systems for the efficient tracking and management of highvalue shipments.Our methodological approach proved that it is feasible to set up scalable and integrated units of processing to shipments and to manage them effectively.It is obvious that a scalable approach to this phenomenon to cover the entire Smart Logistics context will require significant data processing, network capacity, and IoT capabilities.In our opinion, these resources are available nowadays, so the design and implementation of integrated systems for the efficient tracking and management of shipments in smart cities is feasible and can exploit our unique value propositions.
One more significant implication is that systems similar to ours that utilize machinegenerated and managed data through IoT and blockchain applications can be enhanced with complementary methodologies and approaches.One direction that summarizes one proposition is that AI-enabled applications for end-to-end logistics management can likely accompany our methodology by integrating production and supply-driven data that will enhance the overall efficiency of logistics in the context of smart cities.
Another bold proposition of our research is that the IoT data ecosystem in the context of smart logistics can support parallel diverse objectives and can significantly enhance the decision-making capability related to bold problems and challenges of supply chain management, such as tracking efficiency, smart pricing, and sophisticated security management.This implies that there is also a requirement from policy making of view for integrated actions such as:

•
Regulations for the standardization of blockchain-based IoT data generation for smart logistics and shipment management.

•
Regulations and policies for the integration of such secure systems in the financial system towards embedded systems of IoT services that will adopt same standards, making the adoption of sophisticated shipment management systems easier in the core of smart cities infrastructures.

•
Policy guidelines for blockchain IoT-enabled intelligence for secure and trusted logistics and financial systems and fraud avoidance.
It is also obvious from our unique, resilient approach that there is a lot of space for Artificial Intelligence-enabled enhancement of our approach.This is another future research direction that we intend to undertake in the near future.

Conclusions and Future Works
This paper focused on developing a smart and secure logistics system to manage the growing logistics volume efficiently.The system is designed to ensure the quality and safe delivery of high-price goods while maintaining privacy.To achieve this, a smart contract based on blockchain was developed for automatic approval and payment with the consideration of distributing the shipping information between legitimate logistics parties only.A zero-knowledge proof was used to conceal the blockchain address and prove the authentication.Moreover, an intelligent parcel (iParcel) with piezoresistive sensors is used for violation detection during the shipping process.The iParcel automatically tracks and traces the delivery, and in case of any violation, the transaction is cancelled, and the payment is refunded.By implementing this smart logistics system, the distribution of high-price goods can be managed effectively with traceability and condition monitoring capabilities.Successful shipment and violation occurrence scenarios were implemented.The transaction fees range between 16.15 and 42.40 USD for the first scenario and between 4.1 and 39.57USD for the second scenario.The transaction fee per party is reasonable for high-price products in the payment of guaranteed successful shipment.Although the work described a logistic system based on the integration between blockchain and IoT in detail, only a single echelon scenario was illustrated.The system could be easily extended for multi-echelon scenarios where the receiver becomes the subsequent sender.In addition, the iParcel will be fabricated and tested to investigate violation detection accuracy.
Our research paper contributes significantly to the theory of Smart Logistics and smart cities, with a focus on the efficient, intelligent, and secure management of growing logistics volumes.It also contributed to the practice and the applied sciences by providing a cost-effective pilot system that is fully scalable and extended.This can potentially lead to a patent and commercialization through technology transfer and startup business that will specialize in this very delicate and sensitive research problem of the smart logistics industry.As it was also communicated in the previous section, additional future research is related to the integration of Artificial Intelligence for the orchestration of the decision-making capability of the entire production and logistics lifecycle, as well as the analysis of big data analytics and infrastructure for a holistic smart logistics application for materials and financial management.The limitation of our work is summarized by the research context itself, which is a prototype environment under the principles and the conditions of scientific research that responds to real world problems and challenges.Issues with reliability and privacy preservation of distribution information could be raised in the context of blockchain integration with IoT technologies.Also, in our work, we focused on a very specific research problem.The visualization of smart cities [33] requires integration of this kind of solution to an integrated marketplace of services that add value to the industrial and the financial value chain.Thus, the integration of our approach to one-stop-shop services available to businesses and users is necessary.Last but not least, our solution can be a bold enabler of the New Silk Road, as it is connected to the Gulf Cooperation Council Countries.The provision of fully secured services can also promote the value perception of high-profitmargin transactions contributing to customer loyalty and trust; this can be another direction also for our future research.

Figure 1 .
Figure 1.The architecture of the proposed blockchain-enabled IoT logistics system.

Figure 1 .
Figure 1.The architecture of the proposed blockchain-enabled IoT logistics system.

Figure 2 .
Figure 2. The workflow of proposed blockchain-enabled IoT logistics system.

Figure 2 .
Figure 2. The workflow of proposed blockchain-enabled IoT logistics system.

18 Figure 3 .
Figure 3.The operation of the proposed smart contract.

Figure 3 .
Figure 3.The operation of the proposed smart contract.

Figure 4 .
Figure 4. Messages sequence from contract creation until iParcel shipment start in the proposed blockchain-enabled IoT logistics system.

Figure 4 .
Figure 4. Messages sequence from contract creation until iParcel shipment start in the proposed blockchain-enabled IoT logistics system.

Figure 4 .
Figure 4. Messages sequence from contract creation until iParcel shipment start in the proposed blockchain-enabled IoT logistics system.

Figure 5 .
Figure 5. Messages Sequence of iParcel shipment with no violation.Figure 5. Messages Sequence of iParcel shipment with no violation.

Figure 5 .
Figure 5. Messages Sequence of iParcel shipment with no violation.Figure 5. Messages Sequence of iParcel shipment with no violation.

Figure 6 .
Figure 6.Message Sequence of iParcel shipment with Violation.

Figure 6 .
Figure 6.Message Sequence of iParcel shipment with Violation.

Figure 6 .
Figure 6.Message Sequence of iParcel shipment with Violation.

Figure 7 .
Figure 7. Access permissions to the shipment information of each party.

Figure 7 .
Figure 7. Access permissions to the shipment information of each party.

Figure 8 .
Figure 8.The wallet addresses allocated to the parties.

Figure 8 .
Figure 8.The wallet addresses allocated to the parties.

Figure 9 .
Figure 9.The attributes of the smart contract code.Figure 9.The attributes of the smart contract code.

Figure 9 .
Figure 9.The attributes of the smart contract code.Figure 9.The attributes of the smart contract code.

Figure 9 .
Figure 9.The attributes of the smart contract code.

Figure 10 .
Figure 10.The smart contract code for iParcel when a violation occurs.Figure 10.The smart contract code for iParcel when a violation occurs.

Figure 10 .
Figure 10.The smart contract code for iParcel when a violation occurs.Figure 10.The smart contract code for iParcel when a violation occurs.

Figure 11 .
Figure 11.Error message due to shipping package before approval.

Figure 11 .
Figure 11.Error message due to shipping package before approval.

Figure 12 .
Figure 12.Violation is detected and HeavyDropViolation event is triggered.

Figure 12 .
Figure 12.Violation is detected and HeavyDropViolation event is triggered.

Figure 13 .
Figure 13.The receiver is authenticated and is triggered.

Figure 14 .
Figure 14.Transaction cost per party in (a) successful shipment scenario, and (b) violation event scenario.

Figure 14 .
Figure 14.Transaction cost per party in (a) successful shipment scenario, and (b) violation event scenario.

Table 1 .
A Summary of the most related blockchain-enabled IoT logistics systems.

Table 1 .
A Summary of the most related blockchain-enabled IoT logistics systems.