Schema Management
A schema defines the shape of a credential — its required fields, types, and validation rules. Schemas are JSON Schema documents (Draft 2020-12). They are stored in the platform’s schemas table and (optionally) anchored on the SchemaRegistry contract for public verifiability.
4.2.1. Browsing the Schema Library ##### When to use
Before you create a custom schema, check whether one already exists. Reusing an existing schema makes your VCs interoperable with verifiers that already know it.
Steps
- Navigate to
/issuer/schemas. 2. Filter by Type, Issuer, Status (draft / anchored). - Click any row to inspect.
API
Response:
4.2.2. Creating a Custom Schema ##### When to use
No existing schema fits your domain. You need to define the credential’s required fields and validation rules before you can issue.
Before you begin
- Issuer role.
- A clear specification of the claim (field names, types, constraints).
Steps
- Navigate to
/issuer/schemasand click Create schema. - Fill the Schema metadata form:
- Name —
OrganisationMembership. - Version —
1.0(semver). - Description — short purpose statement.
- Type URI — full URI for
@typefield.
- Name —
- Define the JSON Schema body:
- Toggle Anchor on chain if you want the schema hash recorded in the SchemaRegistry (recommended for public-facing schemas; not required for internal use).
- Click Create. The portal calls
POST /api/v1/credentials/schemas(vc.go:28).
API & SDK
Verify
The schema appears in /issuer/schemas. If anchored, the row shows a chain-link icon; click to view the txHash.
Troubleshooting
4.2.3. Schema Versioning ##### Overview
IDA enforces semver-style versioning on schemas. Once a schema is anchored, its hash is immutable on chain. Changes require a new version (1.0 → 1.1 for backward-compatible additions; 1.0 → 2.0 for breaking changes).
Why it matters
Verifiers and issuers must agree on the schema version. A VC issued under OrganisationMembership@1.0 is not automatically valid against a verifier expecting OrganisationMembership@2.0. Use the version field on the credential’s credentialSchema reference to make this explicit.
How to bump
- From
/issuer/schemas/<schema>, click New version. - Make changes, set
version: "1.1"or"2.0". - Save (and re-anchor if desired).
The platform retains all versions; the issuer chooses which to use at issuance time.
4.2.4. Anchoring a Schema On-Chain ##### When to use
Public-facing or regulated schemas should be anchored so any verifier can check the schema hash matches what’s on chain — preventing tampering by a compromised API.
Steps
- From the schema detail page, click Anchor on chain (if not already anchored).
- Wallet prompts for confirmation. Approve.
- The platform calls
registerSchema(schemaId, hash, version, issuerDid)on the SchemaRegistry contract. - After receipt, the row’s status becomes
anchoredwith atxHash.
API
The anchor flag is part of the schema body (see §4.2.2). To anchor an existing schema after creation:
Verify
Query the SchemaRegistry directly via §11.3 — getSchema(schemaId) should return your hash.