Blockchain-Based Flexible Double-Chain Architecture and Performance Optimization for Better Sustainability in Agriculture

: Blockchain is an emerging decentralized distributed technology that can cross the boundaries and guarantee safe and trustworthy value transfers between participants. Combining the blockchain technology with the Internet of Things (IoT) technology to enhance the transparency and sustainability of agricultural supply chains, has attracted researchers from both academia and industry. This paper reviews the latest applications of the blockchain and IoT technologies in the sustainable agricultural supply chain management and explores the design and implementation of a blockchain-based sustainable solution. By placing the sustainable agricultural supply chain management at its core, a blockchain-based framework is designed. Considering the hetero-geneity of the transaction data and the IoT data, the openness of sustainability information and the sensitivity of participants’ data, a double-chain structure is proposed including the consensus method, the transaction mechanisms, the sustainability assessment method and the performance optimization strategy. The sustainable management practices of all participants are introduced into the blockchain network, especially those allowing the government to play a more significant role in agriculture supply management. Meanwhile, to meet the scenario requirements, a data reduction method is designed to improve performance and reduce block size. Simulations are performed to evaluate the latency, throughput, costs and efficiency of the proposed structure. This paper can be a useful reference for further research on the application of blockchain and IoT technologies in sustainable agricultural management.

The performance and cost of technology deployment have become the second challenge in developing sustainable ASCs. In recent years, blockchain technology is found to be an ideal tool to prevent tampering and guarantee the traceability of agricultural data and provide a truthful record, based on which regulators can supervise and third parties can provide services. Due to its speci c heterogeneity, the agricultural industry requires critical considerations of data heterogeneity, multipartite interactions, and technical indicators such as the usability and scalability of the system when adopting blockchain-based solutions. In sustainable ASCs, data generated during transactions and sustainability data collected by IoT devices are different in their security requirements, generation rates and scales; thus, the integration of data ows, the selection of blockchain networks, appropriate technology combinations, and the operation of sustainable ASCs deserve further attention from scholars and practitioners.
At present, many studies introduce blockchain-and IoT-based solutions into agricultural scenarios that include sustainability concerns to varying degrees (e.g., [3]). The majority of efforts have been invested in discovering technological possibilities (e.g., [4,5]) and evidence of improvement (e.g., [6]), summarizing use cases (e.g., [7]) and proposing frameworks and systems (e.g., [8]). Nevertheless, extensive research is required to enable blockchain systems to interact signi cantly with other technologies in a sustainability-driven ASC. Signi cant research is required to enable blockchain solutions that truly consider the demands and principles of other methodologies in a sustainable agricultural system, including monitoring and managing agricultural sustainability. This paper addresses the deployment of blockchain and IoT technologies in ASCs with a speci c focus on sustainability. The main contributions of this paper include: (1) This paper summarizes the data requirements of a value creation mechanism for sustainability assessment designs to enhance interactions between related parties and improve sustainability in ASCs, and propose a sustainability framework for agricultural supply chains based on blockchain technology; (2) This paper also develops a blockchain-based exible double-chain structure to ful l the multifunctional sustainability management needs of agricultural systems, design corresponding incentive mechanisms, improve the consensus algorithm, and indicate the applicability and effectiveness of the proposed structure using throughput, latency, and cost indicators; (3) This paper proposes a data reduction method to improve the ef ciency of data collection and further lower the storage pressure on blockchain-based databases and considers performance optimization of the vast scale and limited value of IoT data in ACSs scenarios.
The rest of the paper is organized as follows: Section 2 reviews the concept of sustainability in ASC and recent works of blockchain-and IoT-based solutions. Section 3 introduces the design of blockchain-based double-chain architecture in ASCs, the data reduction method, and performance optimization strategy. Section 4 presents the simulation and discussion. Section 5 concludes the paper.

Related Work
Sustainability assessments of products have become an increasingly important eld with increased public attention toward sustainable development, and there are many well-de ned tools for such assessments. However, owing to information latency and a lack of transparency, data collection remains an enduring challenge in life-cycle assessments [9]. Meanwhile, improved transparency also brings challenges related to energy consumption in IT implementation. Thus, the performance and cost of technical solutions become a problem that cannot be ignored by any industry, especially agriculture, that considers the blockchain to be an enabler. A recent paper has proposed a data-driven framework including three-dimensional (economic, environmental, and social) sustainable performance indicators but remained vague as to how these objectives may be attained through improved data analytics capabilities, and the relevance of their objectives is unclear [2]. Another paper has reviewed the role of machine learning in sustainable agricultural supply chains and proposed an ASC performance framework that lists similar objectives [10]. Current frameworks lack measurements and ignore technological sustainability, making them less appropriate for blockchain-based systems.
IoT systems are widely used for data collection in current blockchain solutions for agricultural applications. Using the IoT instead of manual data collection not only avoids human error but also solves the problem of data tampering before upload. For current sensor deployment, many studies focus on production processes without data processing before upload and neglect the security of the sensor networks [10,11] and trust issues [12,13]. For instance, Lin et al. [14] proposed a trusted, self-organized, open and ecological system for food traceability based on blockchain and IoT. Sensors are used to record a variety of environmental data, which are stored in every node of the blockchain system through an IoT gateway. In [15], the blockchain nodes are divided into nine types to store data from different sensors. Accordingly, blockchain technology is also considered an ideal solution to tackle the challenges of security problems in IoT systems [16].
Regarding the deployment of the IoT in the supply chain, different approaches focus on different processes. Some studies consider all participants in the agricultural supply chain (e.g., [17,18]), while others involve only business users. In [14], a reliable food traceability system records information from processing companies, seeding companies, logistics companies and food retailers.
Awan et al. [19] put forward a model for upgrading traditional agriculture to smart agriculture in which blockchain records the product name and origin and other information that is accessible to all stakeholders. While IoT information collection and sharing have penetrated many links in the supply chain, the depth and impact of this sharing are still relatively limited. Blockchain users have access only to product information. However, information on the sustainability assessment of products, which is closely related to stakeholders, is not collected, processed or shared effectively.
Regarding data processing, very few studies have considered the problem of information overload in the blockchain, which edge computing is a possible solution [20]. In [21], edge computing is used to reduce computing and storage costs and thus save network resources, while many other studies ignore this problem and suppose real-time updates and access to data (e.g., [17]). However, this previous work only mentions that edge computing can analyze data from the IoT layer, without providing details about deployment and processing. In [15], the transaction throughput and latency in agricultural blockchain are simulated, but resource ef ciency and block scales are not considered. In [19,22], only the transaction throughput is simulated, without considering transaction latency, the number of users, or other issues.

Design of the Blockchain-Based Double-chain Architecture
The sustainability of agriculture involves economic, environmental, social and technological factors. Therefore, the designed system must adopt a reasonable consensus algorithm and system architecture to ensure safe and ef cient sustainable agricultural development. The sustainability performance metrics of an ASC consists of economic sustainability (ES), potential environmental impacts (EI) and the social sustainability (SS) of the product i, as well as technological sustainability (TS). Sustainability assessments can be expressed as follows: where in the above ES metric Eq. (1), F m represents farmer m, P F represents farmer's pro tability and L P represents land productivity. In the EI metric Eq. (2), P T i represents product type or crop type i, and L C j represents life cycle phase j of product i, such as production, processing and transportation processes. W I , S I and A P represent water impact, soil impact and air pollution respectively.
wherein SS metric Eq. (3), H R , W E and P SR represent human rights, working environment, and product social responsibility respectively. The TS metric Eq. (4) focuses on the technology investment and return of agricultural supply chain participants and determines whether supply chain participants' levels of informatization meet their current development needs. In the TS metric equation, I L represent technological level, F L stands for nancial level, M L refers to management level and K L stands for knowledge and experience level.
The combination of blockchain, IoT and other new technologies can result in a high degree of resource integration, enhance the transparency of ASCs, and quantify the sustainability of the performances of participants. For upstream farmers in ASCs, technologies can detect various indicators, such as crop growth, and help farmers increase production and income, thus realizing green agriculture. For the processing enterprises in ASCs, supporting farmers in deploying IoT equipment with extra computing power can help enterprises obtain additional tokens. Similarly, the sustainability of the enterprise is quanti ed by the results of analyses of the IoT data and the disclosure data. Green production can bring smart contracts into effect. To realize the above vision and functions in ASC scenarios, we construct a double-chain structure (as shown in Fig. 1) composed of a main-chain (Mainchain) and a sub-chain (Subchain). The arrangement accounts for function differentiation and security levels. The Mainchain connects enterprises, farmers, government regulators, and nancial service providers and stores information on enterprises and farmers, such as their account information and their transaction and social sustainability assessment information. The Subchain mostly stores data collected by IoT devices in ASCs, including agriproduct information, product transportation information and data on the corresponding environmental impacts during the life cycle of agricultural products. Farmers and enterprises are the main uploaders of the information. As stakeholders, the government, consumers and nancial institutions have the right to know and supervise part of the information.

Design of the Mainchain and Sustainability Assessment
The Mainchain stores information on a variety of transactions that occur in ASCs and is supervised by government regulators. It is necessary to design and manage the block data structure, consensus method, and transaction mechanisms.

Block Data Structure and Consensus Method
The key nodes in the Mainchain of the double-chain structure are government regulators, and the non-key nodes are enterprises, farmers and nancial institutions. The initialization of the Mainchain for agricultural resources is shown in Eq. (5). In the Mainchain, the key nodes are responsible for the generation of new blocks.
where BN is the Mainchain after initialization, E refers to enterprises, F refers to farmers, G refers to government regulators, FI refers to third parties such as nancial institutions, BN eo refers to the information uploaded from environmental sustainability assessments (EI) in the Subchain, and IO t refers to transaction information in ASCs. SC represents smart contracts and CA is the consensus method. Our Mainchain and Subchain reference Proof-of-Authority (POA) to design consensus mechanism, and support users to deploy more appropriate mechanism. In the Mainchain, according to their functions, we de ne key nodes and non-key nodes. The key nodes mainly refer to government nodes and non-key nodes refer to the farmers, enterprises and third parties. The task of the key nodes is to audit the data submitted from the non-key nodes. The non-key nodes are responsible for providing information (transaction information of two sides and sustainability-related data) to the key nodes and are responsible for verifying the auditing results of the government nodes. Firstly, a non-key node generates a request about the transaction information that needs to be updated and the transaction information with sustainability-related data is sent to one of the key nodes. Secondly, the key nodes audit the transaction information in turn according to the audit procedures (the auditing order can be set by setting different reputation values). The last key node in the auditing procedures is the accounting node and it calculates the value of the data and sends the result to non-key nodes for veri cation. Thirdly, each non-key node veri es the result audited by the accounting node and sends a con rmation message to all other nodes after veri cation. Fourthly, the key nodes collect the veri cation result. Fifthly, the accounting key node then generates a new block. Finally, the content of the new block is broadcasted to all non-key nodes. Fig. 2 shows a logical diagram of the block-building procedure in the Mainchain.
The data block of the Mainchain contains the block header (Header) and the block body (Body). The block header encapsulates the hash value of the previous block, the version number, the Merkle root hash and the timestamp. The block body encapsulates the audit results, verication results, and a digital signature. Digital signatures come from all Mainchain participants, which can be used to prevent repudiation.

Transactions and Incentive Mechanisms
In the Mainchain, a variety of transactions will occur between different participants in ASCs. The broadcasted transaction information contains the product type, quantity, location, and volume, and the hash values and sustainability scores of both parties. To ensure the uniqueness and security of the transaction, enterprises and farmers will generate a unique hash code according to their identity information and time stamp. The hash code is calculated using Eq. (6) below.
where I is the hash code that identi es both parties, t is the timestamp, and IO a is the information from both parties. Taking the transactions between farmers and enterprises and the transactions between different enterprises as examples, we construct two transaction scenarios.
When transactions occur between an enterprise and a farmer (M EF ) or between enterprises (M EE ), the broadcasted information is expressed as follows: where PT i refers to product type, n is the quantity, l is the location of the transaction, TA is the total amount of the transaction, sre Ei and sre Fi are the sustainability scores of the enterprise and the farmer, and I i is a hash code to identify each party. The incentive mechanism usually refers to an incentive measure (such as awarding tokens) to stimulate the smooth operation and development of blockchain networks. In the Mainchain, there are several ways to obtain tokens, such as green production; enterprises buy agricultural products with high sustainability scores, and farmers sell agricultural products to enterprises with high sustainability scores. For instance, transactions between sustainable farmers and enterprises are rewarded by an incentive mechanism. Before each transaction, we calculate the sustainability score for each of the two parties (farmers or enterprises) based on their EI and SS values to get the combined sustainability score of the transaction. In trading, we set a basic reward unit (in terms of the number of tokens) and classify the sustainable scores into different scales, which correspond to different sustainability reward weights. The nal reward for both parties in a transaction is obtained by multiplying the basic reward unit with the reward weight corresponding to the scale that the combined sustainability score of the transaction falls in.

Data Compression Method and Design of the Subchain
The Subchain collects data from several enterprises and farmers separately, involving a large volume of data and diverse data types, such as information on products, transportation and environmental impacts. Therefore, it is necessary to use IoT sensors to collect these data. Due to the explosive growth of real-time updating data, the data must be simpli ed before they are uploaded to the blockchain. Under the premise of ensuring the accuracy of the information, the compressed data is recorded in the Subchain and thus minimize the storage. Hence, we compress the massive data by designing a data reduction algorithm for the edge nodes and then use smart contracts to audit and verify the data so that participants can access the required data safely and easily. Because environmental data, such as those on water impacts and air pollution, may change slightly with time or temperature, data collected at adjacent times may be more similar. Given this fact, ASC members can set a baseline according to the type of the sensor, the type of the crop, or the data recorded at a certain time.
The input to the data-reduction algorithm is the data collected by each sensor at different time points. These data are temporarily stored in a large-scale two-dimensional matrix. The outputs of the algorithm are three much smaller two-dimensional matrices. The original input data can be recovered from these three small matrices within a controllable error range. The data reduction process is shown in Algorithm 1. In Algorithm 1, data[ ] represents the collected raw data, N interval represents the number of collected raw data in the time interval between two adjacent baseline data time points (interval = T), and signinterval is the time interval between the time point of baseline data and the time point of veri cation data (signinterval = t). The veri cation data is used to verify the compressed data in each time interval to monitor the accuracy of the transmission process. L comp refers to the loss threshold value, in each time interval, only the difference between the value collected at a certain time and the corresponding baseline data is greater the l comp , will we record the value. Fig. 3 shows the data compression and decompression processes. We use data matrix x * m to represent data to be compressed. x stands for categories of IoT devices, a certain type of IoT device is represented by C x , m is the number of time points with collected data, and T m represents a certain time point. In a data matrix, we de ne V as the data value, V S S T m C x represents the value of data collected by IoT device C x at time T m , and superscript S S indicates the changing state of the data value. If the data value changes compared with its baseline data of the same IoT device, then S is incremented by 1 (S = S + 1), otherwise, the value S remains unchanged. Assume that data compression is conducted in each time interval T with n collected raw data, and each T contains only one baseline data (the rst data in each T) and one veri cation data which is selected randomly in t (1 < t <= n).

Figure 3:
The data compression and decompression processes As Fig. 3 shows, the values whose background are red denotes the changed ones compared with the baseline data in a time interval. To compress data, the ith difference is recorded as: At the same time, the index of the difference also needs to be recorded. As described in Fig. 3, the time T m and the category C n are necessary. It is noted that the compression loss is bounded by the loss threshold value L comp , which ranges from 0 to l comp . When the difference between any other collected raw data value and its corresponding baseline data value exceeds L comp , the collected raw data will be regarded as changed data and will be recorded as diff i . The l comp controls the maximum loss of accuracy in the compression. Larger l comp results in a higher loss of accuracy and achieve a higher compression rate, while smaller l comp results in lower data accuracy loss and lower compression rate, and there is no compression when l comp = 0. Besides, the baseline data and veri cation data are required. So, the compressed data consists of three parts: the baseline data list, the veri cation data list and the difference list. The nal data reduction rate (DRR) can be de ned as: where N denotes the function to calculate the number of differences. It can be simpli ed as: We can conclude that when m is large enough and the difference num N (diff ) > 1 3 mx, the compression effect will not be achieved. So the applicable condition of the algorithm is that the data uctuation is less than 1 3 mx. DRR and L comp are closely related, and ASC participants can set L comp according to the desired data reduction effect and storage demand. For example, users need to set a lower l comp value for critical data to guarantee the accuracy of sustainability calculation. For non-critical data, without affecting sustainability assessments, a higher l comp value can be set to save storage space as much as possible. Meanwhile, when m data arrive, DRR can be calculated by segments. Moreover, the data compression rate (controlled by the l comp value) can be adjusted according to the importance levels of the data. The exibility of setting different l comp values for different kinds of data helps to save resources and improve ef ciency dramatically. The decompression process is also depicted in Fig. 3 and it is worth mentioning that the decompressed data can be veri ed with veri cation data list recorded in the compression process. In the calculation process, only the difference between the data at each time point and the baseline data needs to be calculated. The categories of IoT device x are limited and m is de ned as the number of time points with collected data above. Thus, when m approaches in nity, the computational complexity of the compression is O (m). As for the decompression process, when data arrives, the original data can be restored by summing baseline data and diff in compressed data. Besides, the data veri cation process will also be carried out m ∆T times and the total time cost is m + m ∆T . Therefore, when m approaches in nity, the computational complexity of the decompression is O (m). In application scenarios, the cost of calculation is estimated to be equivalent to m times of simple subtraction calculations. The number of times of data generation is the number of times we need to calculate, so the time cost is acceptable here.
The compressed data then is uploaded to the Subchain. To guarantee security, we introduce Veri able Random Function (VRF) to encrypt the compressed data. VRF is equivalent to random oracle adding non-interactive zero-knowledge proof functionally. When sending data locally, nodes can add random information through VRF, and other nodes can verify the selected results according to the public information including random number, proof and public key. The consensus process of the Subchain is as follows. Firstly, the IoT nodes generate data requests. The original raw data should be compressed rst, and the compressed data should be combined with VRF generated random information to ensure the security of data. Secondly, the information will be broadcasted to all key nodes. Thirdly, calculating the reputation of all key nodes through the rules de ned in advance, to select the accounting node. Fourthly, the accounting node calculates the hash value of the block and sends the result to other nodes for veri cation. In the last step, the other nodes will send correct messages to each other after veri cation. When each node receives con rm messages from more than 2 3 of the total nodes, the key nodes update this block. Block building in Subchain is shown in Algorithm 2. The input of Algorithm 2 includes three arrays, which are a set of data to be veri ed, a set of key nodes and a set of non-key nodes. The non-key nodes verify the data audited by the key nodes. If it is correct, every non-key node will return a positive signal to the key nodes. Otherwise, the non-key nodes will return negative signals. When a transaction occurs, the required data are sent to the key nodes of the government regulatory departments rstly. Similar to the Mainchain, the block of data in the Subchain includes the Header and the Body. However, The Body in the Subchain block contains all veri ed information records about the product, transportation and the environmental impacts.
To monitor and encourage farmers and enterprises in the Subchain, tokens can be issued as incentives. For farmers, conducting environmentally friendly practices has several bene ts. First, land productivity and pro tability can be recorded by technology. Second, tokens gained from sustainable production can be used to apply for agricultural insurance and tax bene ts. Third, farmers can enhance their bargaining power. Through controllable IT implementation, enterprises can ensure the transparency of data along supply chains. The way to obtain tokens in the Subchain is to record and analyze the data from IoT devices.

Performance Optimization
In sustainable ASCs scenarios, there are three indicators to be focused on: the throughput R of the model, the latency T L of tasks and the cost P of tasks. The throughput is in uenced by the number and size of the transactions initiated by clients, and the scale of the block. If the block can accommodate all the transactions, the throughput equals to the number of transactions. If not, the actual throughput is the biggest quantity that the block can accommodate. Here, we use r i to represent the number of the transactions that the client i initiates and use η j to present the corresponding size. η is the average transaction size and s B is the size of a block. Then, R can be described as: And the latency T L contains two parts: the block interval T I and the consumed time T C . Thus, the latency can be calculated as: where T I is a variable value de ned by the model. T C is determined by the compression time T Comp , the algorithm calculation time T A and the size s B . And we can conclude that where J denotes the waiting time calculation process of the transaction when s B changes. The cost P mainly contains the calculation cost P C , the storage cost P S and power cost P P . P C and P P are determined by s B and T I , which can be depicted as H s B , T I . Therefore P is explained as: In the experiment, we expect to make the throughput R greater and reduce T L and P. Thus, the objective function can be de ned as: And if we use the original variable, it can be calculated as: where G is the calculation function of R, I refers to the process of T L and E denotes the calculation process of P. To get the optimal solution of the function, we use simulated annealing algorithm [23]. Regarding timing choice, different optimization methods are used for different data streams in the sustainable ASC scenario. The amount of data is relatively small on the Mainchain and the generation of data has a relatively long periodicity. Therefore, of ine optimization is more applicable and only the data generated in one cycle should be considered. However, the amount of data is relatively large on the Subchain and the data is constantly generated, so real-time optimization is more desirable. To achieve real-time optimization, a certain time interval needs to be set, and the parameters in the current time interval are used to optimize the parameters of the next time interval. When the time interval is small enough, the effect of real-time optimization can be achieved. The simulation result is depicted in Section 4.

Simulation and Evaluation
To verify the applicability and superiority of the double-chain structure in ASCs to improve sustainability, several experimental schemes are designed and simulated by OMNeT++ (an opensource software). The performance and cost of the double-chain and the single-chain structures are evaluated and compared in term of latency of transaction con rmations, cost of unit latencies, throughput, and throughput per unit cost.
Based on the main data ows in sustainable ASCs, the experiment divides the practical agricultural application into three business scenarios: an IoT scenario that contains only IoT data ows, an ASC scenario that contains only ASC transaction ows, and a hybrid scenario that contains both IoT and ASC data ows. In different application scenarios, there are some differences in performance and cost between a single chain and double chain structures. To study these differences, three blockchain structures have been designed, including two single chains and one double chain. One single chain (single-I) is set for IoT scenarios, and the other single chain (single-E) is for ASC scenarios. Double-chain has two chains that can accommodate both IoT and ASC scenarios. The performance and cost of the three chains were recorded under the three scenarios. The performance metrics include transaction latency and throughput, and cost metrics include cost per latency and throughput per unit cost. Moreover, we conduct a throughput comparison of the system under different data reduction rate (DRR) and different adaptive settings ( exibility of block size and block interval).

Parameter Descriptions
In different application scenarios, there will be differences in performance and costs between the single chains and the double chain, as well as between the different single chains. OMNeT++ is used to simulate the communication of an IoT device in the process from transaction generation in the actual environment to the nal con rmation and encapsulation in the block by a consensus algorithm. The transaction con rmation latency, throughput, and cost are recorded for different scenarios. Finally, through the Matplotlib library, the recorded data are visualized for analysis. The simulation setup parameters are shown in Tab. 1. Performance affects the usability of the system, while cost consumption affects the scalability of the system. Assessing the sustainability of a system requires consideration of both performance and cost. An evaluation of these indicators can help achieve the lowest cost under a given performance demand to realize the sustainable development of agriculture. Fig. 4 shows the throughput comparison of the system under different DRR and different adaptive settings. The adaptive system includes three kinds of adaptive settings: 1) adjustable block size and interval; 2) xed block size; 3) xed block interval. In Fig. 4a, DRR = 80% represents 80% compression on the original data and so on. So larger DRR gure indicates higher data reduction. Under the same block resource cost, the higher the DRR is, the greater the throughput is. This is because the greater the data reduction, the more the transaction data can be stored with the same block resource cost. At the same time, the higher the data, the faster the curve levels off, allowing the resulting transactions to be linked up in real-time. Data reduction removes data redundancy, resulting in greater data capacity for the same storage cost, that is, increased throughput. But the greater the data reduction, the longer the data recovery time and the higher the system cost. After all the curves in the gure have levelled off, the lower the percentage, that is, the higher the data reduction, the higher the cost. In practical applications, business requirements and costs should be considered at the same time. To satisfy these requirements, an appropriate data reduction ratio should be selected to minimize the cost.  Fig. 4b, the adaptive system in which both block size and block interval are adjustable can always meet throughput requirements. When the transaction rate is high, the system with xed block-size will experience congestion and throughput decline after the block interval reaches the regulated limit. The system with xed block-interval can adjust the block size to meet the throughput requirements, but too large the block size will increase the cost and delay, so the throughput performance is not as good as that of the system with adjustable size and interval. The higher the DRR, the more data the block can contain at the same storage cost. Regarding when to do data reduction, data reduction is needed when the system needs to get rid of congestion quickly, or when the same block scale needs more throughput. In this case, the larger the DRR is, the faster it gets rid of congestion, and the larger the throughput is under the same block scale. As for the time cost of data reduction, under the same block scale, the higher the DRR, the greater the throughput. But the higher the DRR, the more time it takes to compress and decompress. This will lead to the increase of system delay. Therefore, it is necessary to select the appropriate DRR to meet the throughput requirements while maintaining the delay in an acceptable range. The ASC scenario only contains transactions among ASC participants and the IoT scenario only contains IoT data ows. To achieve optimal performance and minimize cost, performance optimization is used to obtain optimal results. Figs. 5a and 5b correspond to the ASC scenario, and Figs. 5c and 5d correspond to the IoT scenario. In Fig. 5a, there is no congestion in the three chains, and the enterprise single-chain (single-E) latency is the smallest. The IoT single-chain (single-I) consensus algorithm has the longest execution time and the largest latency, while the latency of the double chain lies in the middle. In Fig. 5b, since the enterprise single-chain is designed for the ASC scenario, it has the lowest cost. The IoT single-chain costs more in the IoT scenarios than in the ASC scenarios. The cost of the double chain is moderate. Fig. 5c indicates that in the case of low block resource cost, the single-chain for enterprises does not suffer from congestion, while the single-chain for IoT does suffer from congestion. The total latency in the double-chain lies between those of the two single chains. In Fig. 5d, the cost of the IoT singlechain is the lowest, the cost of the enterprise single-chain is the highest, and the cost of the double-chain is moderate. For every single type of transaction only scenario, the corresponding single-chain performs better in terms of latency and cost, while the double-chain is in the middle.  Fig. 6 shows a performance and latency comparison of different chains under the sustainable ASC scenario (a mixed scenario combining transactions with IoT data). The goal is to maximize throughput and minimize latency and cost through performance optimization. In this hybrid scenario, both ASC and IoT transactions occur.  Fig. 6a, the enterprise has low single-chain latency and no congestion. The IoT singlechain has signi cant latencies in processing IoT transactions, causing congestion in the system. Therefore, the total latency of the double chain lies between the two single chains. In Fig. 6b, IoT single-chain transactions have the lowest costs when processing IoT transactions but the highest costs when processing ASC transactions as well as enterprise single-chain transactions. The double chain uses two mechanisms at the same time, and its cost is relatively moderate when processing both transactions, so the unit latency cost is the lowest when the system eliminates congestion. In Fig. 6c, the enterprise single-chain can always maintain high throughput. The IoT single-chain throughput starts small and then increases due to the long execution time of the consensus algorithm. The Subchain in the double chain has large latencies that cause congestion at the beginning, affecting performance. However, after eliminating the congestion, the two parts of the double chain adapt to the two scenarios, so the throughput of the double chain gradually increases. In Fig. 6d, the cost of the double chain is relatively moderate for both transactions, so the throughput of the unit cost is the highest once the system eliminates congestion.

Analysis and Discussion of the Experimental Results
For performance optimization, the double chain in the sustainable ASC scenario meets the performance requirements, and its implementation cost is the lowest. In the ASC transaction only or IoT transaction only scenarios, the performance and cost of a double-chain are in between the two corresponding single-chains. However, in a sustainable ASC scenario, although the performance of the double chain is moderate, its cost is the lowest, allowing it to achieve comprehensively optimal performance and cost. Therefore, in the sustainable ASC scenario, the double-chain scheme can meet the performance requirements, making the cost minimum.

Conclusion
The combination of blockchain and Internet of Things technologies not only provides transparent solutions for the traditional agricultural supply chain but also provides opportunities to support progress and innovation through sustainable management tools and methods. Concerning the challenges related to transparency, data collection and data sharing in sustainable development, this paper explores sustainable management in ASCs. Addressing the current situation of low-level farmer informatizationand inadequate government supervision about sustainable goals, a doublechain structure with low energy consumption is designed to achieve the sustainability management of the entire supply chain and promote value creation in the life cycle of agricultural products. Finally, the proposed technical scheme is evaluated through simulation and the performances of different implementation scales are analysed. The future work is to develop more accurate technical solutions for the double-chain application in different scenarios.