Chapter 69: Blockchain and Barcodes - The Audit Trail |
Executive Summary |
This chapter explores the convergence of blockchain technology and barcodes, presenting a vision where the simple act of scanning a product code becomes a gateway to an immutable record of authenticity and provenance. While traditional barcodes serve primarily as identifiers, future implementations---particularly with two-dimensional (2D) codes---may embed cryptographic hashes that enable verification against distributed ledgers. This combination creates a powerful defense against counterfeiting across multiple industries. The chapter examines how Code 39, a foundational linear barcode symbology, continues to play a vital role in industrial applications due to its alphanumeric capacity and robust error tolerance, while newer technologies build upon its legacy to address modern authentication challenges. Real-world examples from pharmaceuticals, food and beverage, textiles, and manufacturing demonstrate how blockchain-barcode integration is transforming supply chain transparency and consumer trust. |

|
1. Introduction: The Evolution of Trust in Barcodes |
Since their commercial introduction in the 1970s, barcodes have been instruments of identification. They answer a simple question: 'What is this product' The familiar Universal Product Code (UPC) tells a checkout system that a can of soup belongs to a particular product family, but it says nothing about whether that particular can was manufactured in an authorized facility or whether it has traveled through a legitimate supply chain. The barcode, in its conventional form, is a reference number, not a certificate of authenticity. |
Counterfeiters have exploited this limitation for decades. Traditional anti-counterfeiting measures---holograms, special inks, and tamper-evident packaging---provide some deterrence but are increasingly vulnerable to sophisticated reproduction techniques . The scale of the problem is staggering: counterfeit goods erode brand value, endanger consumer safety, and finance illicit activities. The anti-counterfeit packaging market alone is projected to reach hundreds of billions of dollars in valuation, reflecting the severity of this global challenge . |
The advent of blockchain technology offers a paradigm shift. A blockchain is essentially an append-only digital ledger maintained by a distributed network of computers. Once information is recorded on a blockchain, it becomes practically impossible to alter retroactively without detection. This immutability makes blockchain an ideal foundation for creating 'digital audit trails' that accompany physical products through their lifecycle . |
The natural bridge between the physical product and its digital record is the barcode---particularly 2D codes like QR codes, which can store significantly more data than linear barcodes. By encoding a cryptographic hash in a QR code, manufacturers can create a unique digital fingerprint for each individual product. When a consumer or supply chain participant scans this code, the system can query the blockchain to verify that the product's recorded history matches the expected chain of custody . |
This chapter examines how this technology fusion is being deployed across various sectors and, in parallel, provides a detailed examination of Code 39, a linear barcode standard that remains the workhorse of industrial identification. |

|
2. The Cryptographic Foundation: Hashes and Immutable Ledgers |
Before examining the practical applications, it is essential to understand the core technical concepts. A cryptographic hash function is an algorithm that takes an input of any size and produces a fixed-length output, known as a hash or digest. The critical properties of a cryptographic hash include: |
1. Determinism: The same input always produces the same hash. |
2. One-way function: Given a hash, it is computationally infeasible to reconstruct the original input. |
3. Collision resistance: It is highly improbable that two different inputs produce the same hash. |
In the context of product authentication, a manufacturer might assign each product a unique serial number. That serial number is then fed into a hash function, producing a digest. This digest is encoded into a QR code printed on the product packaging. Simultaneously, the manufacturer records the serial number and the hash on a blockchain. Because the blockchain is immutable, this record serves as a permanent, authoritative reference . |
When a consumer scans the QR code, their smartphone app extracts the hash and queries the blockchain. If the hash exists in the ledger and is associated with a valid chain of custody events (manufacturing date, distribution steps, sale), the product is authenticated. If the hash is missing or linked to suspicious activity, the product is flagged as potentially counterfeit . |
This system effectively moves the locus of trust from the packaging itself (which can be copied) to the network of distributed ledger nodes (which cannot be practically corrupted). The following sections explore how this principle is applied in industry-specific contexts. |

|
3. Code 39: The Industrial Standard of Identification |
While the future of authentication involves sophisticated cryptographic techniques, the present relies heavily on proven, reliable barcode symbologies. Among these, Code 39 holds a position of particular importance. Understanding its characteristics provides context for the transition to newer, data-rich codes. |
3.1 Historical Origins and Naming |
Code 39, also known as USS Code 39, Code 3 of 9, or Alpha 39, was developed by David Allais and Ray Stevens of Intermec Corporation in 1974 . It was the first barcode symbology capable of encoding alphanumeric data, a significant advancement over earlier numeric-only codes. The name derives from its structure: each character is represented by a pattern of nine elements---five bars and four spaces---of which three are wide and six are narrow . This 'three out of nine' wide pattern gives the code its name and its distinctive, rugged appearance. |

|
3.2 Character Set and Data Capacity |
A key reason for Code 39's widespread adoption is its robust character set. It directly encodes: |
- Uppercase letters A through Z (26 characters) |
- Numeric digits 0 through 9 (10 characters) |
- A set of special symbols: space, minus (-), period (.), dollar sign ($), slash (/), plus (+), and percent (%) . |
This provides 43 characters in the standard version. An extended version, Code 39 Extended or Full ASCII Code 39, supports lowercase letters and the full ASCII character set by using two-character combinations, though this reduces density . |

|
3.3 Structural Characteristics |
The Code 39 symbology has several defining features: |
Variable Length: There is no fixed limit on the number of characters a Code 39 barcode can encode, though practical considerations of print area and scanner capability typically restrict usage to between 20 and 50 characters . |
Self-Checking: Code 39 is inherently self-checking. A single printing defect is unlikely to cause one valid character to be misread as another, thanks to the specific pattern of wide and narrow elements . This property is a major advantage in harsh industrial environments. |
Start/Stop Characters: Every Code 39 barcode begins and ends with an asterisk (*) character. These are required characters that define the boundaries of the code . Some implementations display the asterisks in the human-readable text, while others suppress them. |
Optional Check Digit: While not required by the specification, a modulo-43 check digit can be added to improve data integrity. This is particularly recommended in critical applications . |

|
3.4 Technical Limitations |
Despite its strengths, Code 39 has significant limitations that influence its application: |
Low Data Density: Because each character requires nine elements, Code 39 is relatively wide compared to other codes like Code 128. For a given amount of data, a Code 39 barcode will be roughly 30% wider than a Code 128 barcode . |
Printing Sensitivity: As a width-encoded symbology, Code 39 is sensitive to ink spread or printing irregularities. Slight variations in bar width can render the code unreadable . |
Size Requirements: Practical implementation requires careful attention to print quality, quiet zones (blank margins), and minimum bar height. The recommended X-dimension (narrow bar width) is 0.33mm, with a minimum of 0.191mm . |

|
3.5 Code 39's Enduring Role in Industry |
The technical profile of Code 39---alphanumeric capacity, self-checking nature, and wide scanner support---makes it ideally suited to a particular niche: non-retail industrial applications. |
Automotive Manufacturing: Code 39 is the standard symbology defined by the Automotive Industry Action Group (AIAG) for parts identification, vehicle identification, and inventory tracking . |
Military and Defense: The U.S. Department of Defense has historically used Code 39, known there as LOGMARS (Logistics Applications of Automated Marking and Reading Symbols), for supply chain identification . |
Medical Equipment: Healthcare environments rely on Code 39 to track instruments, equipment, and inventory due to its readability even when printed on durable but imperfect surfaces. |
Electronics Manufacturing: The electronics industry uses Code 39 for tracking circuit boards and components through assembly processes. |
However, the limited data capacity of Code 39 makes it unsuitable for encoding the cryptographic hashes required by blockchain-based authentication systems. This is where 2D codes, particularly QR codes, become indispensable. |

|
4. Applications by Industry |
The integration of blockchain-based verification with scannable codes is not a theoretical concept. It is being actively deployed across multiple industries to combat counterfeiting and ensure regulatory compliance. |
4.1 Pharmaceuticals: Combating the Threat to Patient Safety |
The pharmaceutical industry is at the forefront of adopting these technologies due to the direct patient safety implications of counterfeit drugs. Inaccurate or fake medications can result in treatment failure, adverse reactions, or death. |
Bayer HealthCare, a global pharmaceutical leader, adopted a blockchain-based solution called AccessReal to address grey market activity and counterfeiting in Hong Kong . The system uses a clone-proof identification label, known as an ARcode, applied to each product. This label is serialized and encrypted, giving each item a unique identity. The integration of blockchain technology and artificial intelligence allows Bayer to monitor product distribution meticulously. Suspicious distribution patterns trigger immediate alerts, enabling timely intervention . |
The system provides end-consumers with the ability to authenticate products via a simple smartphone scan . This capability is a significant advancement from traditional track-and-trace systems, which often only provided visibility to distribution partners. For consumers, scanning the code verifies authenticity and provides confidence that the medication is genuine. |
Research proposals further formalize this framework. One proposed system, C-Trust, combines blockchain with cryptographic hashing, role-based access, and QR code verification to establish end-to-end product authenticity . The system uses the SHA-256 hash algorithm to maintain privacy, while authorized users (manufacturers, distributors, retailers) update product movement data on the blockchain, creating an immutable supply chain trail . The system's architecture includes a reporting mechanism enabling consumers to flag suspected counterfeit products . |
Another proposed system, TruSecure, envisions five key roles: Administrator, Manufacturer, Supplier, Retailer, and Consumer . The manufacturer generates a unique QR code for each product, embedding essential details such as product ID, manufacturing date, and location. This QR code is registered on the blockchain. Suppliers and retailers scan and update product details as they move through the supply chain. The consumer scans the code to verify authenticity and view the complete chain of custody . |
The pharmaceutical applications demonstrate a key principle: blockchain verification adds value not just at the final point of sale but throughout the supply chain, enabling any participant to validate the product's provenance. |

|
4.2 Food and Beverage: From Farm to Fork Transparency |
The food and beverage industry faces dual challenges of counterfeiting and regulatory compliance. Consumers increasingly demand transparency about the origin and processing of their food, while regulators enforce strict standards for safety and sustainability. |
Jamaican Blue Mountain Coffee, one of the world's most prized and counterfeited coffees, has adopted blockchain technology to protect its brand integrity . Each batch of coffee features a unique QR code that consumers can scan. This code provides detailed information about the coffee's journey from farm to market, including origin, harvest date, and processing details . The system addresses both consumer fraud (ensuring consumers receive authentic product) and regulatory compliance (helping meet European Union standards related to deforestation and sustainability) . |
The system is notable for its emphasis on 'telling the story' behind the product. This reflects a broader consumer trend: authentication is not merely about verifying a product is not fake, but about confirming its claimed attributes---fair trade, organic, sustainable, and artisanal. Blockchain-barcode integration provides a mechanism to make these value claims verifiable. |
Other agricultural sectors face similar challenges. Research has explored the use of blockchain and QR code-based systems for safeguarding creative textile products, such as Batik and Weaving in Indonesia . The system utilizes Hyperledger Fabric as a private blockchain platform, with each product assigned a unique QR code to ensure authenticity and transparency . The goal is to protect artisans' livelihoods by making the unique, handcrafted nature of their products verifiable and tracing their origin to specific communities . |

|
4.3 Supply Chain Security and Aggregation |
A key technical challenge in supply chain verification is aggregation: managing the relationship between individual products (e.g., bottles of medicine) and the larger units in which they are shipped (e.g., cases and pallets). Blockchain-barcode integration addresses this through cryptographic key management . |
When a product is manufactured, it is assigned a unique identifier and a cryptographic hash, which is recorded on the blockchain. This identifier is printed as a barcode on the primary package. When individual products are packed into a case, the case receives its own barcode. The process of aggregating---linking the product-level identifiers to the case-level identifier---is recorded on the blockchain through a transaction that is cryptographically signed . |
When the case is unpacked at a distribution center, the de-aggregation process is recorded similarly. Because each transaction is linked to the previous one via cryptographic hashes, any break in the chain---a product that appears in a case without being recorded, or a case that claims to contain products but has inconsistent hashes---is immediately detectable . |
A patent filing by a technology company describes a trustable product delivery system that uses a printed label (containing a product identifier), an electronic tag such as an RFID marker, and a smart chip inside the product . The smart chip contains a digital key that generates an encoded value (hash) based on the product identifier. The product identifier and the encoded value are recorded in a blockchain ledger . This multi-layered authentication approach makes counterfeiting extraordinarily difficult: a counterfeiter would need to replicate the printed label, the RFID tag, and the internal smart chip simultaneously, while also hijacking the blockchain record . |

|
4.4 Creative and Textile Industries: Protecting Cultural Heritage |
The application of blockchain-barcode verification extends beyond industrial and food products into creative works and cultural heritage products. In many cultures, textiles represent not just economic value but centuries of artistic tradition and communal knowledge. Counterfeit versions, often produced by industrial methods, undercut these artisans and dilute cultural heritage. |
A research project focused on local Batik and Weaving SMEs in Bandung City, Indonesia, developed a system using Hyperledger Fabric as a private blockchain platform and IPFS (InterPlanetary File System) for off-chain data storage . Each product received a unique QR code, enabling consumers and stakeholders to trace its origin and verify its authenticity . |
This application is particularly meaningful because it addresses a challenge that is inherently social as well as economic. The technology shifts the power dynamic: the artisan's claim of authenticity, once difficult to verify, becomes backed by cryptographic evidence. This can enhance market value and preserve the economic viability of traditional crafts. |

|
4.5 Luxury Goods: Proving Provenance |
The luxury goods industry has a long-standing problem with counterfeiting. Handbags, watches, and accessories are frequently copied, and the copies are often sophisticated enough to deceive retailers and consumers alike. Blockchain-barcode solutions provide a method to establish provenance: a record of the product's creation, ownership, and authenticity. |
In these applications, the QR code often serves as a gateway not just to verification but to the product's narrative: who made it, where the materials came from, and how it passed through the hands of craftspeople. This narrative, recorded immutably, becomes part of the product's value proposition. The authentication process thus reinforces the brand's identity and its claim to craftsmanship. |

|
5. Technical Implementation Considerations |
5.1 The Suitability of QR Codes for Cryptographic Data |
The transition from linear codes like Code 39 to 2D codes like QR codes is a technical necessity for blockchain integration. A cryptographic hash, such as a SHA-256 digest, is a 256-bit number, typically represented as a 64-character hexadecimal string. A Code 39 barcode representing 64 characters would be impractically large---approximately 75mm wide even with a very fine X-dimension, before allowing for quiet zones . This would be larger than most product packaging can accommodate. |
QR codes, in contrast, can store up to 4,296 alphanumeric characters in a small, square area. They have built-in error correction, meaning they can be read even if partially damaged or obscured. This makes them ideal for carrying hashes, URLs, and other structured data. |

|
5.2 The Verification Process |
The verification process typically works as follows: |
1. Registration: At the point of manufacture, the product is assigned a unique identifier (UID). The UID is used to generate a cryptographic hash. Both the UID and the hash are recorded on the blockchain. The hash is then encoded into a QR code and printed on the product. |
2. Tracking: Each time the product is handled---shipped from the warehouse, received by a distributor, sold to a retailer---the handler scans the QR code and records a transaction on the blockchain. This transaction includes the location, time, and the handler's identity, all cryptographically signed . |
3. Verification: When a consumer scans the QR code, the app extracts the hash from the QR code and queries the blockchain. If the hash exists and the chain of custody is complete and consistent, the product is flagged as authentic. The consumer may also see the full history of the product . |
If a counterfeit product attempts to use a copied QR code, the verification fails. The counterfeit QR code may contain a hash that does not exist on the blockchain, or the hash may exist but the associated chain of custody would reveal that the product was never legitimately shipped to the location where the scan occurred. This location-based mismatch is a powerful detection method, as was noted in research on pharmaceutical verification . |

|
5.3 Privacy and Data Protection |
One consideration in blockchain-barcode systems is data privacy. The blockchain, by design, is transparent. If personal data were recorded on the blockchain, it would be permanently accessible to anyone. This creates a conflict with data protection regulations. |
To address this, many systems adopt a 'zero-knowledge' or privacy-preserving approach. One documented method uses the SHA-256 hash to maintain the privacy of customers . The system records the hash on the blockchain but does not store sensitive customer data directly on-chain. The hash functions as a pseudonym: the data is verifiable without being transparently identifiable. |

|
6. Challenges and Future Directions |
6.1 The Last Mile Problem |
A fundamental challenge for any product authentication system is the 'last mile': the point at which a consumer interacts with the product. Systems that authenticate products via blockchain assume that the consumer can scan the barcode. This requires: |
- A smartphone with a camera and the appropriate app. |
- An internet connection to query the blockchain. |
- Consumer awareness and willingness to perform the scan. |
Scanned codes in the food and luxury goods sectors have successfully addressed these concerns by making scanning part of the consumer experience . |

|
6.2 The Digital-Physical Link |
A blockchain can authenticate a hash, but it cannot, on its own, ensure that the physical product bearing that hash is genuine. A counterfeiter could potentially copy the QR code from a genuine product and apply it to a fake. This is known as a 'copy attack.' |
Two mitigation strategies exist: |
Tamper-evident packaging: The QR code is destroyed or visibly altered when the package is opened. This ensures that a code that has been scanned cannot be reused. |
Multi-factor authentication: Combining the barcode with other physical characteristics, such as RFID tags, chemical fingerprints, or micro-structures, creates a multi-layered defense . |

|
6.3 Scaling and Interoperability |
As blockchain-barcode systems proliferate, a challenge emerges: ensuring interoperability between different brands, industries, and blockchain platforms. A consumer should ideally be able to use a single app to authenticate products from multiple brands using multiple blockchain backends. The use of standards, such as the GS1 standards for supply chain identification, is essential to prevent fragmentation . |

|
7. Detailed Summary: The Past and Future of Barcodes |
This chapter has traced the trajectory from Code 39, the foundational industrial barcode, to the blockchain-authenticated QR codes of the future. A comprehensive understanding requires situating both technologies within the landscape of identification and authentication. |
Code 39's Enduring Contribution |
Code 39's technical characteristics---alphanumeric encoding, self-checking, and wide scanner support---made it indispensable in the automotive, defense, and electronics sectors. Its ability to encode uppercase letters and numbers with high reliability, even on imperfect surfaces, gave it a role that earlier numeric-only codes could not fulfill. However, its low data density and size constraints highlight the limits of linear symbology. Code 39 is a robust identifier, but it is not a vehicle for rich data or cryptographic integrity. |
The Cryptographic Revolution of QR Codes and Blockchain |
QR codes have become the standard for blockchain-barcode integration because of their high data capacity and error correction. They can store cryptographic hashes, enabling digital fingerprinting of individual products. When combined with blockchain's immutable ledger, this turns the simple act of scanning a code into a trust verification exercise. |
Applications across Sectors |
Pharmaceuticals: Blockchain-QR integration protects patient safety by enabling real-time authentication of drugs and detection of grey market diversion . |
Food and Beverage: The technology ensures compliance with sustainability standards and protects premium brands against counterfeiting, as seen with Jamaican Blue Mountain Coffee . |
Supply Chains: Aggregation and de-aggregation processes are secured by cryptographic keys and hashes, making any break in the chain of custody detectable . |
Cultural Heritage and Textiles: The technology enhances market value for artisans by providing incontrovertible proof of origin and authenticity . |

|
The Future State |
The future envisioned in this chapter is not a complete replacement of linear barcodes with cryptographic QR codes. Rather, it is a layered architecture. Code 39 and Code 128 will continue to serve as internal inventory identifiers and parts markers in industrial settings. QR codes will increasingly supplement these identifiers, providing the data channel for blockchain verification at critical points---at the point of manufacture, at major distribution nodes, and at the point of final sale. |
The promise of this convergence is profound. It transforms the barcode from a mere reference number into an active participant in a distributed system of trust. It empowers consumers to verify the authenticity of their purchases, helps regulators enforce standards, and protects brands from the corrosive effects of counterfeiting. In this vision, the barcode is no longer just a label; it is an audit trail. |
References |
1. C-Trust System for Anti-Counterfeiting in Supply Chain Management Using Block Chain Technology. IEEE, 2026. |
2. CODE 39 and Codabar. KEYENCE Corporation. |
3. Blockchain Technology to Be Utilised in Safeguarding Authenticity of Jamaican Blue Mountain Coffee. Ministry of Agriculture, Fisheries and Mining, Jamaica, 2025. |
4. Decentralized framework for product security using blockchain and smart contract-based QR verification. Springer, 2026. |
5. What is Code 39 BarcodeUses, Structure & Generation Guide. Aspose, 2026. |
6. Trustable Product Delivery with RFID and Smart Chip. US Patent Application US 20210216958A1. |
7. Code39. Stimulsoft Reports Documentation. |
8. Blockchain-based system for creative textile product authentication. Garuda, 2025. |
9. Technology and Security: Countering Criminal Infiltrations in the Legitimate Supply Chain. UNICRI, 2021. |
10. Code 39 - History, Purpose, Advantages, Limitations and Usage. ByteScout, 2013. |
11. Strengthening Pharmaceutical Security: How Bayer Utilised AccessReal. GS1 Singapore, 2025. |