Skip to main content
Contact the AIR team to enable Iden3 for your account: Partner with us. For SD-JWT credentials, see What are schemas.
An Iden3 credential schema is a blueprint that defines the structure, data types, and validation rules for the credentials you issue. You create it with the Iden3 Schema Builder, which generates the documents described below.

Schema components

A Schema Type encodes the structure of a particular Verifiable Credential (VC) by defining the type, the fields that must be included inside the VC, and a description for these fields. Schemas let different services interpret the same credential consistently. A verifier that knows the schema can read the credential’s claims without contacting the issuer. A schema type is made of two separate documents:

1. JSON-LD context

The JSON-LD Context contains a description of the type and its fields, providing semantic meaning to your credential data by linking it to standardized vocabularies and ontologies.

Understanding JSON-LD context

JSON-LD context defines the vocabulary and data types used in your credentials. It maps local field names to globally unique identifiers (URIs) that have well-defined meanings. Here’s an example of a JSON-LD Context for a MembershipPointsCredential:

Key JSON-LD context elements

  • @version: Specifies the JSON-LD version (typically 1.1)
  • @protected: Ensures that terms cannot be overridden
  • @id: Maps to globally unique identifiers
  • @type: Specifies the data type using XML Schema types
  • vocab: Custom vocabulary namespace for your specific fields
  • xsd: XML Schema Definition namespace for standard data types

2. JSON Schema

The JSON Schema contains the validation rules for the Issuer Node, defining the structure and constraints for the credential data. Here’s an example of a JSON Schema for the MembershipPointsCredential:

Key JSON Schema elements

  • $metadata: Contains URIs linking to both the JSON-LD context and JSON schema
  • required: Lists all mandatory fields for the credential
  • properties: Defines the structure and validation rules for each field
  • credentialSubject: Contains the actual credential data fields
  • format: Specifies validation formats (uri, date-time, etc.)

Benefits of this two-document approach

  1. Separation of Concerns: JSON-LD handles semantics, JSON Schema handles validation
  2. Interoperability: Different systems can understand credentials using standard vocabularies
  3. Validation: Issuer nodes can validate credential structure before issuance
  4. Flexibility: Allows for complex validation rules while maintaining semantic clarity