Verify a lot as a buyer
Available
Check a sealed lot's signed documents and the daily fingerprints without an account or CropPath software.
When a lot is sealed, CropPath issues its documents once, signed with the packing facility's key, and never changes them: the lot's EPCIS 2.0 document (GET /v1/public/lots/{publicId}/epcis.jsonld), the lot credential and each fruit's credential (…/credential, a UNTP Digital Product Passport as a signed JWT, application/vc+jwt), and the packing facility's UNTP Digital Facility Record (…/facility-record). Anything recorded after the seal is on the public page but not in these documents.
- Read the credential's header (its first part, base64url JSON):
algisES256andkidnames the facility's key,did:web:<domain>:<slug>#key-<n>. - Fetch
https://<domain>/<slug>/did.jsonand take theverificationMethodwhoseidequals thekid; it must also be listed inassertionMethod. - Verify the signature with that
publicKeyJwkand any JOSE library. - In the credential (UNTP 0.7.0), take the EPCIS document's link in
relatedDocument: itsdigestMultibaseisufollowed by the unpadded base64url of the bytes 0x12 0x20 and the SHA-256 of the document's bytes; compute it and compare. A credential sealed before UNTP 0.7.0 holds the hex SHA-256 in thehashDigestof itstraceabilityInformation. - Check that the seal is in the published daily fingerprints:
python3 verify_anchors.py proof --api https://<host> --lot <publicId>(see the Tamper evidence guide).
import { compactVerify, importJWK } from "jose";
const did = await (await fetch("https://<domain>/<slug>/did.json")).json();
const jws = await (await fetch("https://<domain>/v1/public/lots/<publicId>/credential")).text();
const kid = JSON.parse(Buffer.from(jws.split(".")[0], "base64url")).kid;
const method = did.verificationMethod.find((m) => m.id === kid);
const { payload } = await compactVerify(jws, await importJWK(method.publicKeyJwk, "ES256"));
const credential = JSON.parse(new TextDecoder().decode(payload));A credential whose key was revoked for compromise is withdrawn: its download answers 404 and the lot record's issuer is null. A key retired by a rotation stays in did.json, so what it signed still verifies.
The documents carry no operator, grower, parcel, coordinates, device id or device signature. Lab results in the credential are the facility's statement of the lab's result, naming the lab, its key and the report's SHA-256, not the lab's own credential.
In the API reference
GET /v1/public/lots/{publicId}/credentialGET /v1/public/fruits/{publicId}/credentialGET /v1/public/lots/{publicId}/epcis.jsonldGET /v1/public/lots/{publicId}/anchor-proofGET /v1/public/anchors
Downloads
This portal serves these files: you do not need access to the source repository.