Blockchain-based Cannabis Traceability in Supply Chain Management

org


I. INTRODUCTION
The cannabis supply chain comprises a complicated network of enterprises.In conjunction with healthcare goods, the bad impacts are detrimental to individual health, the economy, and society.The supply chain for cannabis extract products consists of the selection of seeds, cultivation, production, distribution, and sale of the finished product.Therefore, traceability of product standards and regulations is prone to a lack of confidence, transparency, and immutability of the tracking system.Due to the COVID-19 pandemic, the challenge is to prevent questionable products from finding their way onto the legal market.Consequently, providing traceability is essential for isolating and eliminating potentially dangerous products.Cannabis-extracted products are produced from an identifiable source to make them appear genuine, such as apoptosis induction on human cancer cells by cannabis sativa L [1].The proportion of THC/CBD is also used as a criterion for identifying cannabis strains or cultivars [2].
As reported by the World Health Organization (WHO), cancer is a primary contributor to mortality worldwide, responsible for more than 10 million deaths in the year 2020.It is estimated that by 2041, there will be more than 30 million new cases and more than 20 million deaths.Treatment with the use of chemotherapy is a popular choice due to its high efficiency.However, it has been found that many patients experience side effects from the use of the drug, including the high cost of medicines or treatment methods [3].Currently, the US Food and Drug Administration (US FDA) approves the utilization of Dronabinol and Nabilone, which contain THC as the main ingredient, for treating cancer patients experiencing dizziness, nausea, vomiting, and loss of appetite due to chemotherapy [4].
In 2021, the legal cannabis industry provided US$ 17.8 billion to the world economy.This figure is expected to increase by 25.3% between 2022 and 2030 [5].Thailand is at the leading edge of cannabis liberalization in Southeast Asia.The region decriminalized medical cannabis in 2018, and Thailand then decriminalized the cannabis plant in a push toward commercialization in June 2022 [6].
Fig. 1 depicts the cannabis supply chain distribution process.A seed provider is responsible for distributing seeds to Thailand's FDA-approved producers (Thai FDA).The grower is responsible for nurturing cannabis plants from seed and must register a "Plookganja" application.The grower then delivers the cannabis plants to the manufacturer.The manufacturer produces cannabis extract products in lots and sends each lot to a laboratory.The two most prevalent cannabinoids produced from cannabis are CBD and THC.www.ijacsa.thesai.orgIn the case of THC, the concentration level exceeds 0.2% and must be tested with the results reported to the Thai FDA.The distributor receives a large amount of cannabis extract products and is responsible for transferring them to hospitals, medicine practices, and drug stores.Finally, they dispense the products to consumers typically based on formulated, processed, or synthetic cannabis sold as a finished product.From seed to sale, the whole cannabis supply chain can be traced and validated.This can help reduce the risk of errors, fraud, or other irregularities that may occur in the supply chain.This includes tracking the origin of the cannabis plant, processing the plant, and distribution of the final product.Consequently, monitoring, improving quality control, and tracking product standards and regulations are fundamental to cannabis supply chain traceability.
Several nations, including the United States [7,8], Canada [9], the Asia-Pacific region [10], and so on, are progressively emphasizing and mandating the necessity of cannabis traceability.Thai cannabis products are subject to strict regulations, and the IT system and applications can help ensure they are not tampered with or diverted from the legal supply chain.Decentralized control makes it difficult for bad actors to alter or manipulate the data recorded on the ledger.
Blockchain represents a distributed and decentralized ledger that retains and distributes all transactional records or alternate data and enables all forms of peer-to-peer value transactions [11], protected by encryption and regulated through a process of collective agreement [12].The data structure of the blockchain is composed of a succession of blocks.A network of computers maintained by users or participants through a network of computers constitutes the interconnected sequence of a distributed ledger or list of entries.Cryptography is employed by blockchain to handle and authenticate ledger transactions.Users of the network authorize and record all transactions.Apart from being assigned to chronological timestamps, being interconnected with the previous block, and becoming unalterable once uploaded onto the network, these blocks constitute an essential building block of the blockchain structure [13].Continuous updates of realtime data reduce the necessity for intricate and error-prone reconciliation processes involving the internal records of each party.
Blockchain is an essential technology for modernizing supply chain management in the industry 4.0 era [14], including the Internet of Things (IoT), and smart contracts [15].Cannabis supply chains are concentrating on transparency, real-time monitoring, and securing transactions.Customers demand product visibility and traceability throughout the entire supply chain.This paper seeks to illustrate how blockchain technology may be employed for the traceability of cannabis extract goods.By employing the distributed storage, hash encryption, and programmable smart contract attributes inherent in blockchain technology, this research proposes designing and implementing a blockchain-based traceability system for cannabis extract goods.The system design method is detailed in-depth, and the associated important breakthrough technologies, encompassing both the on-chain and off-chain storage architectures, are elucidated.To demonstrate the system's viability, the blockchain network is based on performance testing and actual applications of cannabis supply chain traceability.
The significance of this study is summarized as follows:  A blockchain-based system that offers data security, immutability, and decentralized control for cannabis extract products is offered for the cannabis supply chain.
 A smart contract capable of processing multiple transactions between stakeholders in the cannabis supply chain is presented.
 A blockchain network founded on a Polygon and cannabis supply chain traceability is presented to facilitate the storage and retrieval of cannabis product traceability data.
 As the recommended solution, blockchain-based cannabis traceability is developed and evaluated for performance and cost.
The composition of the subsequent parts can be outlined as follows: In Section II, a literature review of blockchain-based traceability solutions is presented.Section III elaborates on the construction of a smart contract and the traceability of the cannabis supply chain.Section IV describes the implementation and test performance of the suggested system.www.ijacsa.thesai.orgSection V provides an evaluation, and then Section VI describes the discussion.Finally, Section VII provides conclusions and recommendations for future research.

II. RELATED WORK
This part provides a critical assessment of current initiatives to solve the product traceability problem.Relevant literature concerning traceability in supply chain management utilizing blockchain technology is recognized and assessed.

A. Tradition Efforts for Supply Chain Traceability
Traceability is characterized by the capacity to obtain any or all information pertaining to an item throughout its life cycle by identification methods.Traceability of the supply chain ensures that when quality-related issues arise, the raw materials or processing links in question can be swiftly verified, product recalls can be conducted as needed, and targeted penalties can be used to enhance the quality and safety of cannabis products.
Traceability is shown to be an effective strategy for regulating product quality across the local and global supply chain.Existing supply chain management systems have generally used barcodes and RFID tags for agricultural goods or pharmaceuticals.For example, Qian et al. [16] designed and implemented a system for milling wheat flour by combining 2D barcode and RFID technologies.Jabbar et al. [17] adopted GS1 standard barcodes with a serialized unique product identity, lot production number, and expiry date.The end consumer can utilize the QR code and/or RFID tag to enable them to read all the immutable traceability information [18,19].Other technologies have been developed to improve the traceability system [19], such as near-field communication (NFC), wireless sensor networks (WSN), cloud computing technology (CCT), and DNA barcoding.However, the typical traceability system does not sufficiently control the information's openness, making it susceptible to manipulation.

B. Blockchain-based Solution for Cannabis Supply Chain
Traceability Conventional approaches to traceability in the cannabis supply chain frequently adopt centralized systems, which tend to lack transparency at the participant level, allowing the central authority to manipulate data without notifying other involved parties.
Supply chain management in a range of sectors makes substantial use of blockchain technology to assist supply chain operations.Many sectors benefit from block-chain-based solutions, such as the agricultural food (agri-food) sector [20][21][22][23][24][25][26][27][28][29] to ensure data provenance, decentralized control and gives a secure, immutable history of trans-actions to all parties.In medicine supply chain, Musamih et al. [25] introduced the smart contract to verify data provenance, remove intermediaries, and provide all participants with a safe, unchangeable record of all transactions.Furthermore, the luxury goods supply chain, Chen et al. [30] introduced the smart contract to execute all information related to the production and logistics process of luxury product anticounterfeiting.Kang et al. [31] introduced the enhancing traceability and authenticity in wine supply chain through a Stackelberg game-theoretical analysis.
Blockchain platforms have been developed to facilitate and accelerate the development of a decentralized application process in supply chain traceability projects.Two popular methods are Ethereum and Hyperledger Fabric.Shahid et al. [22] and Babu et al. [32] suggested an Ethereum-based solution for the blockchain-based agri-food supply chain that uploads all blockchain-based transactions to IFS (IPFS).An efficient, safe, and reliable storage system creates a hash of the data stored on the blockchain.Using smart contracts and supporting algorithms, this technology displays system interactivity.
Yang et al. [20] introduced the use of Hyperledger Fabric in a blockchain-based traceability system designed for agricultural products such as fruits and vegetables.This system not only improves query efficiency and safeguards privacy but also ensures the legitimacy and dependability of data in supply chain management, all while aligning with the demands of practical, real-world applications.
Nevertheless, the usage of Ethereum with Hyperledger Fabric offers difficulties, including scalability and cost effectiveness.

A. System Framework
This study assesses the traceability of cannabis products within Thailand's cannabis supply chain, spanning from the initial stages, such as cannabis seed selection, cultivation, and production, to the ultimate point of sale, where cannabis products are made available to consumers.The first layer of the cannabis supply chain involves selecting the seed of cannabis strains and the effect of seed storage methods on cannabinoids and psychoactive cannabinoids present in cannabis plants.In order to comply with regulations and record essential information about seeds, sales and purchases, and licensing, it is required to conduct an audit throughout the process of selecting seeds.Cannabis cultivation involves planting, transplanting, watering, harvesting, drying, and recording information on the transplant date, pollination control, fertilizer, harvesting process, drying weight, and other key elements.The extraction process requires the provision of the lot number, processing data, extracted oil weight, extraction gain/loss, and COA.Distribution requires a packing number for the lot, delivery information, and shipment date.Furthermore, the entire process is conducted under controlled environmental conditions at every stage, as factors such as temperature, humidity, or other elements can impact the content of CBD and THC.Starting at the distributor level, the retailer obtains limited quantities of finished products equipped with traceable identifiers, which are then sold to consumers.The application programming interface constitutes the second layer (API).The API interfaces directly or indirectly with a blockchain node or client network [33].The third layer, which comprises the traceability system, possesses the capability to identify, track, and trace individual cannabis product components as they navigate through the entire supply chain, spanning from the initial stage of seed selection to the end consumer.The traceability system's data collecting [34], data www.ijacsa.thesai.orgstorage [35,36], and data processing [37] comprise its data gathering layer.The aim of data collection is to identify and collect the data sources for all units of measurement.
Data storage is used to extract the data from multiple forms and sources into the data warehouse.Data processing analyzes and separates the on-chain and off-chain data.The blockchain is comprised of essential elements, including a smart contract, a consensus algorithm, a blockchain application, and digital storage.Digital data are stored in a decentralized architecture, allowing worldwide access to unused hard drive space.The decentralized infrastructure offers an alternative to centralized cloud storage [38] and is capable of alleviating a number of problems related to centralized systems.As seen in Fig. 2, An abstract model for managing cannabis traceability within the supply chain using blockchain technology [39] is predominantly constituted by four layers: the cannabis supply chain layer, the data interface layer, the traceability system layer, and the blockchain layer.

B. On-Chain and Off-Chain
The current storage method of the blockchain traceability system requires the direct entry of traceability information for every node of cannabis items directly into the blockchain.As the number of nodes rises, so does the quantity of transaction data, increasing the storage stress on the blockchain.Given the chain-like configuration of the blockchain, query efficiency is relatively poor; only those of the same blockchain network can gain entry to the chain ledger's data.This research develops the storage mode of a blockchain-based traceability system for cannabis goods, which includes a distributed database of traceability information under an on-chain system.Once the traceability data is input into the system, it undergoes a categorization process.The public information about the product is preserved within the local database.As shown in Fig 3, the encrypted ciphertext is posted, and the hash ID of the public information is appended to the blockchain before being conveyed to the relational database.
Fig. 4 presents a data flow diagram illustrating the cultivation data, harvest data, production data, and distribution data between off-chain and on-chain.In traceability applications, all transactions, images, and data are uploaded by the participants.All participants are required to be licensed when uploading the information onto the database as shown in Table I.The lot number uploaded by the cultivator is automatically generated using the QR code to prevent error and fraud.The cameras are installed in the field for communicating and taking videos.Blockchain via smart contracts can be automatically programmed to impose penalties on the cultivator if they act dishonestly.Any peers or stakeholders in the blockchain can trust that their content can be disputed or refuted.

C. Sequence Diagram
Fig. 5 depicts the interaction between various supply chain actors within the proposed system, broken down into the following three stages.
 Cultivation and Harvest: A cultivator begins the plant lot, uploads it to the blockchain, and then declares an event to all peers, such as cultivator, harvest, and manufacturer.The cultivator updates the growth status, and the image of the license can be uploaded into the blockchain.The plant lot is transported to the harvesting phase when the blockchain is updated with harvest information.All transactions are retained on the blockchain, and the blockchain communicates the hash ID to the data storage.
 Production and Distribution: A company submits the Thai FDA a request for permission before starting production.As soon as the Thai FDA authorizes the request, the producer enters the manufacturing lot into the blockchain and declares an event to all peers, such as manufacturer and distributor.The manufacturer uploads photographs of the manufacturing lot to the blockchain, which then sends a hash ID to data storage so that authorized users may view the images in the future.The production batch is sent to the distributor for packing.
 Retailer and Consumer: Finally, interaction takes place between the retailer and the consumer.Thus, the retailer initiates the contract and purchases the product from the distributor, and this is declared to the peers such as the retailer, distributor, and consumer.The cannabis product is sold to the retailer and subsequently to the consumer.This process ensures that all transactions are documented and accessible to all participants within the supply chain, thereby validating the authenticity and legality of products based on the chronological sequence of events.

D. Comparison of Proposed Solution
This section compares the suggested approach for cannabis supply chain traceability with the conventional solution.
Table II provides an overview of this study.Importantly, the decentralization of the proposed system precludes any one organization from influencing or changing the data.Furthermore, the proposed solution has valuable features, providing security, transparency, credibility, and immutability.Blockchain-based traceability is offered as the proposed solution.The proposed solution uses the Polygon blockchain, which is comparable with other blockchains such as Ethereum and Hyperledger Fabric [40], as presented in Table III.Polygon is a permissionless public blockchain with excellent scalability.The average Polygon transaction fee (gas price) is less than Ethereum, according to the Polygon and Ethereum gas price [41] on May 7, 2023.In addition, data are stored on-chain in all solutions, but the suggested solution includes an extra feature that enables data to be stored off-chain as well.In conclusion, the suggested system includes several programmable smart contract languages.

IV. PROPOSED BLOCKCHAIN-BASED CANNABIS TRACEABILITY IMPLEMENTATION
Using the Polygon blockchain platform, the suggested solution is constructed.Polygon is permission less public blockchain, meaning that anybody may access it.The smart contract is scripted in Python and subjected to testing within Visual Studio Code following its development.It is a webbased online environment for authoring and running smart contract code, offering users the capability to debug and test the environment of the solidity code.

A. Implementation Framework
This section discusses the five algorithms of the cultivation lot, the harvest lot, the production lot, sales data and read lot that define the operation of the proposed blockchain-based solution.First, the cultivator initiates the plant lot number and then updates the growth details in the blockchain.Algorithm 1 describes uploading the cultivation lot number into a blockchain.The inputs for this algorithm include a license number for the cultivator, a unique identifier for the plant lot, the strain name or ID, the date the plants were planted, the current growth stage of the plants, and the number of plants in the lot.First, the cultivation record is created in Cantrak, which is a system for tracking cannabis cultivation.The record includes all the input variables provided.Next, the cultivation record is written into the blockchain, which is a secure and tamper-resistant distributed database.The blockchain ensures that the cultivation record cannot be altered or deleted once it has been written.A hash ID is generated to uniquely identify the cultivation record in the blockchain.Finally, the hash ID is printed to confirm that the cultivation record has been successfully written into the blockchain.This algorithm can be used by cultivators to securely store their cultivation lot numbers and related information on the blockchain for verification purposes."license_number": license_number, "lot_number": lot_number, "strain": strain, "planted_date": planted_date, "growth_stage": growth_stage, "number_of_plants": number_of_plants } // Write cultivation record to blockchain hash_id = blockchain.write_data(cultivation_record)Output: // Print hash ID for confirmation Print ("Cultivation record successfully written to the blockchain with hash ID:", hash_id) End Algorithm 2 describes the design to upload the harvest lot number into the blockchain.The inputs for this algorithm include a unique identifier for the plant lot, the date the plants were harvested, the specific strain of cannabis, the number of plants harvested, the weight of the harvested material, and part of the plant harvested.First, the harvest record is created in Cantrak, including all the input variables provided.Next, the harvest record www.ijacsa.thesai.org is written into the blockchain, a secure and tamperresistant distributed database.The blockchain ensures that the harvest record cannot be altered or deleted once it has been written.A hash ID is generated to uniquely identify the harvest record on the blockchain.Finally, the hash ID is printed to confirm that the harvest record has been successfully written into the blockchain.This algorithm can be used by cultivators to securely store their harvest lot numbers and related information on the blockchain for verification purposes."plant_lot_number": plant_lot_number, "harvested_date": harvested_date, "strain": strain, "num_plants_harvested": num_plants_harvested, "weight": weight, "item_harvested": item_harvested } // Write the harvest record on the blockchain hash_id = blockchain.write_data(harvest_record)Output: // Print hash ID for confirmation Print ("Harvest record successfully written to the blockchain with hash ID:", hash_id) End Algorithm 3 describes the process for uploading the production lot number to a blockchain.The inputs for this algorithm include the name of the process (e.g., drying, curing, extraction), a unique identifier for the production lot, the date the production process started, the date the production process ended, the specific strain of cannabis being produced, type of product being produced, and the address of the uploaded Certificate of Analysis (COA) document containing THC% & CBD%.First, the production lot record is created in Cantrak, including all of the input variables provided, such as the reference for the COA document.Next, the production lot record is written into the blockchain, a secure and tamperresistant distributed database.The blockchain ensures that the production lot record cannot be altered or deleted once it has been written.A hash ID is generated to uniquely identify the production lot record on the blockchain.Finally, the hash ID is printed to confirm that the production lot record has been successfully written into the blockchain.This algorithm can be used by cannabis producers to securely store their production lot numbers and related information on the blockchain for verification purposes.The uploaded COA document can also be easily accessed and verified through the reference address provided in the production lot record.

Input:
// Define input variables process_name = [string] // name of the process (e.g., drying, curing, extraction) lot_number = [string] // unique identifier for the production lot start_date = [string] // date the production process started end_date = [string] // date the production process ended strain = [string] // the specific strain of cannabis being produced product_type = [string] // the type of product being produced (e.g., dried flower, oil, concentrate) coa_doc_reference = [string] // address of uploaded coa document containing thc% & cbd% // Create production lot record in Cantrak production_lot_record = { "process_name": process_name, "lot_number": lot_number, "start_date": start_date, "end_date": end_date, "strain": strain, "product_type": product_type "coa_doc_reference": coa_doc_reference } // Write production lot record to blockchain hash_id = blockchain.write_data(production_lot_record)Output: // Print hash ID for confirmation Print ("Production lot record successfully written to blockchain with hash ID:", hash_id) End Algorithm 4 describes uploading sales data to a blockchain.It takes several input variables, including the seller's and buyer's license numbers, date of the transaction, type and quantity of the product being sold, price per unit, and the reference for a COA document containing information about the product's THC and CBD content.The algorithm creates a sales record in Cantrak, including all the input variables, and is then written into the blockchain, generating a hash ID that serves as a unique identifier for the record.Finally, the algorithm prints the hash ID for confirmation, indicating that the sales record has been successfully written into the blockchain."seller_license_number": seller_license_number, "buyer_license_number": buyer_license_number, "transaction_date": transaction_date, "product_type": product_type, "product_quantity": product_quantity, "product_price": product_price "coa_doc_reference": coa_doc_reference } // Write sales record to blockchain hash_id = blockchain.write_data(sales_record)Output: // Print hash ID for confirmation Print ("Sales record successfully written to blockchain with hash ID:", hash_id) End Algorithm 5 describes the reading of a lot number to the blockchain.This algorithm is designed to retrieve data from the blockchain using a unique lot number as input.It is typically used for tracking the cannabis cultivation process.The algorithm fetches data associated with a specific lot number from the blockchain and displays such data if found.It checks for the existence of data relating to the lot number and prints the details if data are available.

V. RESULTS
The smart contract is coded in Python and validated through testing in Visual Studio Code once it is constructed.Additionally, an online web-based development environment is utilized for creating and executing programs related to smart contracts.This platform also has facilities for debugging and testing the solidity code's surroundings.This section presents a cost evaluation of the Polygon smart contract code.When executing a transaction on the Polygon blockchain, it is important to take into account the gas cost linked with its transmission.The experimental indoor cultivated condition covers a 100 m 2 area with four crops per year.All transactions are simulated according to the sequence diagram in Fig. 5.The smart contract uses gas for its different functions, the cost of which is converted into fiat currency (USD) in Table IV.The average Polygon gas price is US$ 0.08, according to the Polygon gas price [41] on May 7, 2023.The manufacturing lot conducted by the smart contract owner (manufacturer) is the most expensive of the four functions.This unusually large cost may be explained by the function needing data storage having six distinct variables.The cultivation lot and sale figures, respectively, represent the second and third greatest expenses.The performance of the system is tested on the Polygon blockchain network (Standard Polygon speed selection) through use cases and receives performance test results, including transaction speed.The test results of the four functions are shown in Table V.The manufacturing lot is the fastest transaction.The harvest lot and sale data, respectively, represent the second and third speedy transaction.

VI. DISCUSSION
This section examines the extension of the planned Polygon blockchain-based solution and constraints for cannabis supply chain traceability.
The proposed approach demonstrates the potential use of blockchain technology to enhance the traceability of the cannabis supply chain.Similar research has been conducted on the agricultural food (agri-food) supply chain.Even if the information is secure and transparent, it cannot be used by the cannabis sector due to its diverse procedures and complicated organizational structures.In conjunction with healthcare goods, these impacts are not only harmful to persons but also pose a substantial threat to the economy and society.The cannabis supply chain differs from others by emphasizing the identification of strains and THC/CBD ratios [1].In addition, there are no worldwide guidelines for the traceability of agrifood research.For instance, blockchain-based traceability in medicine supply chain management [25,42] includes a www.ijacsa.thesai.orgprocedure distinct from cannabis and prioritizes enhanced data security protection to ensure the pharmaceuticals are genuine.Transparency from upstream to downstream still requires decentralized traceability and supply chain efficiency.
The decentralized application may be used in the storage mode of a blockchain-based traceability system for cannabis goods and includes a distributed database containing traceability information under on-chain circumstances.After uploading traceability data, the system classifies the data.The public information of the product is stored within the local database.As seen in Fig. 3, the encrypted ciphertext along with the hash ID for the public information is uploaded onto the blockchain and communicated to associated databases.
The sequence diagram may be used to convey several relationships to cannabis stakeholders.It will be necessary to add the smart contract and specify its interaction with the other entities.Another option is the simultaneous development of many goods, which necessitates an expansion of the functionalities to suit the extra products; this may be accomplished by altering the current smart contract.This research contributes to the academic field by leveraging existing knowledge to expand and generate new insights into developing a decentralized application for the cannabis traceability process within blockchain-based supply chain management.The emphasis is on enabling trust, transparency, data security, and efficiency in cannabis supply chain management on the blockchain platform.The achievement of these objectives involves architectural design, algorithm development, sequence diagram design, and the creation of blockchain applications.Additionally, this research aims to enhance supply chain management to align with modern standards in the Industry 4.0 era, incorporating IoT technology and smart contracts.This includes ensuring transparency, real-time verification, transaction security, and meeting customer demands for the visibility and traceability of cannabis products throughout the entire supply chain.This research focuses on developing trust in cannabis traceability using a blockchain platform to make data trustworthy, transparent, secure, and efficient.The blockchain's consensus mechanism ensures data cannot be altered by using a timestamped, distributed database and decentralizing.This mechanism is crucial in preventing questionable products from entering the legal market, emphasizing the importance of traceability for identifying and disposing of potentially hazardous products.The flexibility introduced by storing data from the cannabis traceability system on-chain and off-chain reduces the loading pressure on blockchain and storing necessary information.Moreover, scalability in developing a blockchain-based traceability process avoids delays and high transaction fees to establish sustainability for the cannabis industry.
Finally, the algorithms are developed in easy stages and may be implemented inside the application for the cannabis supply chain.

VII. CONCLUSION
This research examines the difficulty of cannabis supply chain traceability and its relevance, particularly in terms of identifying the source to make the product look authentic.It proposes a Polygon blockchain-based strategy for the cannabis supply chain that offers data security, immutability, and decentralized control over cannabis extract products.
The suggested approach leverages a smart contract capable of processing a variety of transactions among cannabis supply chain stakeholders to accomplish the automatic documentation of occurrences that are accessible to all involved parties.The blockchain-based solution includes on-chain and off-chain storage, algorithms, and a sequence diagram.This research reveals that the various smart contract functionalities are responsible for the transaction's cost-effectiveness in terms of the quantity of gas used.The scalability of the blockchainbased solution is necessary for the sustainable cannabis industry.
Finally, the researchers plan to continue their efforts to enhance the international standards for traceability, the supply chain management to align with modern standards in the industry 4.0 eras, and the efficiency of the cannabis supply chain process in future work.

Fig. 1 .
Fig. 1.Product flow and stakeholder relationship in the cannabis supply chain from seed to sale.

Fig. 2 .
Fig. 2.An abstract model for managing cannabis traceability within the supply chain using blockchain technology.

Algorithm 2
Upload the harvest lot number to the blockchain Input: // Define input variables plant_lot_number = [string] // unique identifier for the plant lot harvested_date = [string] // date the plants were harvested strain = [string] // the specific strain of cannabis num_plants_harvested = [int] // number of plants harvested weight = [float] // weight of harvested material item_harvested = [string] // the part of the plant that was harvested // Create harvest record in Cantrak harvest_record = {

TABLE I .
VERIFICATION OF PARTICIPANT INFORMATION

TABLE II .
COMPARISON OF THE SUGGESTED AND CONVENTIONAL APPROACHES

TABLE IV .
COST ESTIMATE OF THE SMART CONTRACT CODE FOR POLYGON