Cotton production involves repeated changes in material form, ownership and quantity, making a garment difficult to trace using disconnected records. We present CottonTrace, a web-based prototype that links eight material stages through quantity-labelled lot genealogy, contract-based validation, an application-managed permissioned-ledger model, off-chain evidence, Internet of Things ingestion and a QR-accessible Digital Product Passport. An explainable detection layer combines robust statistics with domain rules to route suspicious records to auditors. The design is examined against the implementation and the project-reported synthetic evaluation of 18 lots, 61 blocks and 2,488 sensor readings. That evaluation records rejection of invalid operations, detection of edited evidence, eight findings corresponding to planted irregularities, and verification of 12 upstream lots for a garment passport. These observations demonstrate functional integration within the pilot. They do not establish distributed consensus, field accuracy, calibrated fraud probabilities or a complete environmental life-cycle assessment. The main contribution is a transparent workflow connecting deterministic validation, evidence integrity, material attribution and human review in a single cotton traceability prototype.
Introduction
The text describes the development of CottonTrace, a blockchain-inspired digital traceability system designed to track cotton from farms to finished garments. The system records the complete journey of cotton through different processing stages, including harvesting, ginning, spinning, weaving, dyeing and garment manufacturing.
Its main objective is to improve supply chain transparency, preserve material history, verify supporting documents, detect suspicious activities and provide consumers with access to product information through a digital product passport.
1. Introduction
Cotton garments often contain materials collected from different farms and processing facilities. During manufacturing, cotton may be mixed, divided into smaller batches or transferred between multiple organisations.
Traditional tracking systems generally record successive ownership but may fail to identify exactly which raw materials contributed to a finished product.
To address this problem, CottonTrace introduces a blockchain-based traceability approach that records:
The origin of cotton materials.
The quantity of material used at each processing stage.
Transfers between different organisations.
Transformations and mixing of materials.
Supporting certificates and documents.
Sensor readings and audit records.
The complete history of finished garments.
An important feature is that blockchain records can help detect changes in stored information, but they cannot independently guarantee that the original information is physically accurate.
2. Problem Definition and Research Objectives
The research identifies three major challenges in cotton supply chain traceability.
A. Identity Continuity
Maintaining the identity of cotton materials when ownership, packaging or batch numbers change during processing.
B. Material Continuity
Tracking how much material is consumed, mixed, divided or transferred between different manufacturing stages.
C. Evidence Continuity
Maintaining the connection between material batches, certificates, sensor measurements and the organisations responsible for recording them.
The main objectives are:
Develop a system to track cotton from its agricultural origin to finished garments.
Maintain material genealogy during transformations, mixing and partial shipments.
Verify transactions and supporting documents using cryptographic hashes.
Detect suspicious activities through rule-based and statistical anomaly detection.
Generate digital product passports for consumer transparency.
Estimate resource consumption and environmental indicators associated with finished products.
3. Review of Related Work
Previous studies have explored blockchain, IoT and digital product passports for supply chain management.
Textile traceability: Earlier blockchain frameworks have demonstrated the use of distributed records for tracking textile products.
GS1 EPCIS 2.0: Provides a standard for recording supply chain events, including material transformations and consumption.
Hyperledger Fabric: Provides a permissioned blockchain architecture for managing transactions between organisations.
SHA-256: A cryptographic hashing algorithm used to verify the integrity of stored evidence.
Anomaly detection: Statistical methods help identify unusual measurements and suspicious activities.
Digital Product Passport: Supports product identification, provenance information and sustainability-related data.
IoT and MQTT: Support the collection and communication of sensor measurements across supply chains.
Environmental accounting: The GHG Protocol provides guidance for calculating product life-cycle greenhouse gas emissions.
The research gap is the need to integrate material tracking, transaction validation, document verification, anomaly detection and consumer-facing product information into one operational platform.
4. System Architecture
CottonTrace is developed using the following technologies:
Component
Technology
Frontend
Next.js, React, TypeScript
Backend
Next.js application services
Database
PostgreSQL
ORM
Prisma
Cloud database
Neon
File storage
Vercel Blob
Cryptographic verification
SHA-256
Anomaly detection
Statistical and rule-based methods
The system involves different supply chain participants:
Farmers.
Cotton ginning facilities.
Spinning mills.
Weaving and knitting units.
Dyeing facilities.
Garment manufacturers.
Brands.
Auditors and administrators.
Each user belongs to an organisation and receives permissions according to their role.
5. Lot Genealogy and Material Tracking
One of the most important features of CottonTrace is its ability to maintain material genealogy.
The system supports eight types of material lots:
Seed.
Harvest.
Bale.
Fibre.
Yarn.
Fabric.
Dyed fabric.
Garment.
Each lot maintains information such as:
Unique identification number.
Original quantity.
Available quantity.
Measurement unit.
Current owner.
Creator.
Material attributes.
Creation transaction.
The system uses parent-child relationships to track material transformations.
For example, when cotton from multiple harvests is combined into one bale or yarn batch, the system records the quantity contributed by each parent lot.
It also supports partial transfers, where only a portion of a batch is transferred to another organisation.
This ensures that the finished garment can be traced back to its original material sources.
6. Smart Contract Modules and Responsibilities
CottonTrace uses seven contract modules to control different operations.
Module
Main responsibility
Lot
Validates material types, ownership, quantities and processing yield
Transfer
Controls material transfers and shipment acceptance
Event
Validates ownership and permitted activities
Certification
Controls auditor and administrator permissions
Document
Manages document attachments and hash verification
Sensor
Validates registered devices and organisations
Passport
Controls garment batch ownership and passport publication
These modules validate operations before allowing changes to the database.
If an operation violates the rules, the transaction is rejected and the operational changes are rolled back.
7. Functional Requirements and Data Management
The system focuses on six important requirements:
Material identification: Every material batch receives a unique identity.
Inventory management: Available quantities are updated when materials are reserved, transferred or consumed.
User authorization: Different organisations have different operational permissions.
Evidence verification: Documents are linked to their cryptographic hashes.
Auditability: Rejected operations and suspicious activities can be reviewed.
Consumer transparency: Finished products can be presented through digital product passports.
References
[1] T. K. Agrawal, V. Kumar, R. Pal, L. Wang, and Y. Chen, “Blockchain-based framework for supply chain traceability: A case example of textile and clothing industry,” Computers & Industrial Engineering, vol. 154, Art. no. 107130, 2021. doi: 10.1016/j.cie.2021.107130.
[2] GS1, EPCIS Standard, release 2.0, Jun. 2022. Available: https://ref.gs1.org/standards/epcis/2.0.0/
[3] E. Androulaki et al., “Hyperledger Fabric: A distributed operating system for permissioned blockchains,” in Proc. 13th EuroSys Conf., Art. no. 30, pp. 1–15, 2018. doi: 10.1145/3190508.3190538.
[4] National Institute of Standards and Technology, Secure Hash Standard, FIPS PUB 180-4, Aug. 2015. doi: 10.6028/NIST.FIPS.180-4.
[5] V. Chandola, A. Banerjee, and V. Kumar, “Anomaly detection: A survey,” ACM Computing Surveys, vol. 41, no. 3, Art. no. 15, pp. 1–58, 2009. doi: 10.1145/1541880.1541882.
[6] NIST/SEMATECH, “Detection of outliers,” e-Handbook of Statistical Methods, Sec. 1.3.5.17. Available: https://itl.nist.gov/div898/handbook/eda/section3/eda35h.htm
[7] European Parliament and Council of the European Union, Regulation (EU) 2024/1781 establishing a framework for the setting of ecodesign requirements for sustainable products, Jun. 2024, Arts. 9–11. Available: https://eur-lex.europa.eu/eli/reg/2024/1781/oj/eng
[8] N. Kshetri, “Blockchain’s roles in meeting key supply chain management objectives,” International Journal of Information Management, vol. 39, pp. 80–89, 2018. doi: 10.1016/j.ijinfomgt.2017.12.005.
[9] K. Wüst and A. Gervais, “Do you need a blockchain?,” in Proc. Crypto Valley Conf. Blockchain Technology, pp. 45–54, 2018. doi: 10.1109/CVCBT.2018.00011.
[10] L. Atzori, A. Iera, and G. Morabito, “The Internet of Things: A survey,” Computer Networks, vol. 54, no. 15, pp. 2787–2805, 2010. doi: 10.1016/j.comnet.2010.05.010.
[11] A. Banks, E. Briggs, K. Borgendale, and R. Gupta, Eds., MQTT Version 5.0, OASIS Standard, Mar. 7, 2019. Available: https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html
[12] F. T. Liu, K. M. Ting, and Z.-H. Zhou, “Isolation forest,” in Proc. 8th IEEE Int. Conf. Data Mining, pp. 413–422, 2008.
[13] World Resources Institute and World Business Council for Sustainable Development, Product Life Cycle Accounting and Reporting Standard, Greenhouse Gas Protocol, 2011. Available: https://ghgprotocol.org/product-standard
[14] P. Prajapati, D. Vatyani, and A. Sharma, Cotton Seed-to-Cloth Production: Blockchain-Enabled Traceability, IoT, AI and Digital Product Passport System, major-project report, Dept. of Information Technology, SGSITS, Indore, academic session 2026–2027, Chs. 3–6. Unpublished project report supplied with the implementation.
[15] Gupta, P., Sharma, V. and Varma, S., 2021. People detection and counting using YOLOv3 and SSD models. Materials Today: Proceedings.
[16] Gupta, P., Sharma, V. and Varma, S., 2022. A novel algorithm for mask detection and recognizing actions of human. Expert Systems with Applications, 198, p.116823.
[17] Gupta, P. and Kulkarni, N., 2013. An introduction of soft computing approach over hard computing. International Journal of Latest Trends in Engineering and Technology (IJLTET), 3(1), pp.254-258
[18] Kushwaha, U., Gupta, P., Airen, S. and Kuliha, M., 2022, December. Analysis of CNN Model with Traditional Approach and Cloud AI based Approach. In 2022 International Conference on Automation, Computing and Renewable Systems (ICACRS) (pp. 835-842). IEEE
[19] Gupta, P., Arya, N., Singar, C.P., Chaudhari, A., Singh, U. and Gupta, S., 2025. Safety of Pedestrians in AI-Optimized VANETs for Autonomous Vehicles via Real-Time Vehicle-to-Vehicle Communication. In AI-Driven Transportation Systems: Real-Time Applications and Related Technologies (pp. 169-181). Cham: Springer Nature Switzerland.