Saltar al contenido principal

Standard for Publishing Lab Certificates as On-Chain Metadata

Status: Draft
Requires: CIP-150

Standard for Publishing Lab Certificates as On-Chain Metadata

Abstract

In physical goods verification and tokenized commodity markets, lab reports are critical to establish product quality, purity, or authenticity. This standard defines:

  • The key "lab" to be used in on-chain KV metadata.
  • The required file name lab.json.
  • Expected format for the contents of the certificate, supporting structured fields with units.

The value associated with the "lab" key MUST point to the off-chain file (e.g. IPFS or other decentralized storage). The JSON file MUST be immutable, versioned, and cryptographically verifiable.

Motivation

A growing number of asset-backed tokens (e.g. coffee beans, precious metals, food, chemicals, pharmaceuticals) need to attach lab-verified attributes such as:

  • Moisture content
  • pH
  • Color
  • Presence of contaminants
  • Protein or ash content

These properties are typically stored off-chain in PDF or JSON files, without on-chain standardization or discoverability. This CIP enables reliable on-chain discovery of lab reports using a well-defined pattern.

Specification

Key: "lab"

  • This key must be stored using a CIP-compliant key-value metadata contract.
  • The key must be: lab
  • The value must be a URL or content-addressed reference to a JSON file (e.g. IPFS CID).

Example:

key: "lab"
value: "ipfs://QmXabc123.../lab.json"

File Name: lab.json

  • The filename MUST be lab.json to signal standardization.
  • It should be referenced by the lab key.

Expected JSON Structure

A lab.json file SHOULD contain a flat structure of property objects, each including:

  • value: Numeric or string value
  • unit: Optional unit field

Example 1:

{
"moisture": { "value": 9.7, "unit": "percent" },
"SO2": { "value": 4.83, "unit": "ppm" },
"pH": { "value": 6.51 },
"protein": { "value": 0.31, "unit": "percent" },
"ASH": { "value": 0, "unit": "percent" },
"color": { "value": "white" }
}

Example 2 (identical structure with different values):

{
"moisture": { "value": 10.1, "unit": "percent" },
"SO2": { "value": 3.15, "unit": "ppm" },
"pH": { "value": 6.45 },
"protein": { "value": 0.25, "unit": "percent" },
"ASH": { "value": 0.02, "unit": "percent" },
"color": { "value": "beige" }
}

Enforcement and Sealing

  • The "lab" entry SHOULD be sealed using sealKey("lab") after it is published.
  • If multiple lab reports exist over time, consider storing versioned keys:
    • "lab_v1", "lab_v2", with "lab" always pointing to the latest.

Storage and Format

  • The JSON file SHOULD be stored on IPFS, Arweave, or similar immutable content-addressed storage.
  • The value in KV is recommended to be the IPFS CID (e.g. "ipfs://...") or full URL.

Use Cases

  • Tokenized food, beverages, commodities
  • Pharmaceutical tracking (e.g. generic ingredients)
  • Energy, water, or industrial emissions
  • Precious metal or gemstone verification

Rationale

The lab certificate standard addresses the critical need for verifiable quality and authenticity data in tokenized physical assets. By providing a consistent structure and on-chain discoverability, this standard enables trust and transparency in commodity markets while maintaining the flexibility needed for diverse analytical requirements.

Backward Compatibility

This standard is fully compatible with CIP-KV-Metadata and may be embedded as part of broader metadata systems (e.g. tokenURI JSON can also reference lab.json).

Security Considerations

  • Make sure the referenced lab.json is immutable and hosted in trusted decentralized storage.
  • Consider signing the file with a lab's cryptographic signature (optional extension).
  • Do not store unverified lab reports without a sealing mechanism.

Conclusion

The Standard for Publishing Lab Certificates as On-Chain Metadata provides a reliable and standardized approach to linking verifiable lab reports with tokenized assets. Its adoption can enhance trust, transparency, and compliance in physical asset tokenization.

Copyright and related rights waived via CC0.

Tags:CBC