Skip to main content

Data formats

Certichain keeps no application database. What a person holds instead is a set of small, self-checking files and codes: a credential package, an encrypted document on IPFS, a shared document file, a disclosure file, a verifiable credential, a QR code. This section describes each one field by field, says where it is produced and consumed, and shows how a reader checks it.

Three rules hold for all of them:

  1. Untrusted on input. Every reader validates the whole structure before using any field, and most refuse unknown fields. A file of the wrong kind is named ("This is a key update file, not a credential package.").
  2. Signed facts are checked against the chain. A file can prove what an issuer signed, but only the chain says whether the credential exists, who the issuer is now, and whether it is still active.
  3. Secrets are marked. Files that carry a document key (the credential package, the capability link, the key update file, the package archive) are labelled as secret in the UI and on these pages.

Pages in this section​

PageWhat it describes
Credential packageThe JSON file the issuer gives the holder: signed fields, signature, salts, document key
Encrypted document containerThe binary format of an encrypted document on IPFS: canonical header, padded plaintext, wrapped keys
Sharing files and codesShare code, shared document file (grant), capability link, key update file
Invitation fileThe EIP-712 invitation that lets one wallet link to one student's enrolment
Bulk import filesThe records file and its adapters, the result file and the package archive
Disclosure fileThe holder's challenge-bound file that shows chosen fields to one verifier
Verifiable credential fileThe W3C VC 2.0 and Open Badges 3.0 exports of a credential
Compact codesThe short v1., c1. and d1. codes the phone wallet shows as QR codes
Deployment manifestThe JSON file that lists the contract sets on each network
API envelopeThe response shape and signed answers of the verification API

How the formats relate​

Common building blocks​

Building blockUsed byDefined in
EIP-712 domain { name: "Certichain", version: "1", chainId, verifyingContract }Package, grant, invitation, VC proofsrc/lib/eip712.ts
Signed credential fields (domain, credential, signature, credentialId)Package, grantreadSignedFields in src/lib/credential-package.ts
Strict field readers (addresses, 32-byte hex, decimals, signatures)All JSON formatssrc/lib/file-fields.ts
Base64url without paddingContainer, grant, link, key update, share codesrc/lib/doc-crypto/encoding.ts
RFC 8785 canonical JSONContainer header, metadata hashcanonicalize
Wrong-file detectionPackage, grant, key updatesrc/lib/doc-crypto/file-kind.ts

Source files​

  • src/lib/credential-package.ts, src/lib/eip712.ts, src/lib/file-fields.ts
  • src/lib/doc-crypto/
  • src/lib/invitation-file.ts
  • src/lib/import/