Credential Schemas
Last updated
Was this helpful?
Last updated
Was this helpful?
Schemas are useful when enforcing a specific structure on a collection of data like a Verifiable Credential. Data Verification schemas, for example, are used to verify that the structure and contents of a Verifiable Credential conform to a published schema. On the other hand, Data Encoding schemas are used to map the contents of a Verifiable Credential to an alternative representation format, such as a binary format used in a zero-knowledge proof.
Truvera credential schemas are using json schema format and should follow this structure
Schemas are used to describe the structure of credentials, specifically the credential subject. It helps the issuer, holder, and verifier to unambiguously determine the claims contained within the credential. To create a schema, you need to define the object body using JSON schema.
body
body
object
true
JSON-schema.
Return a list of all schemas created by the authenticated user.
offset
query
integer
false
How many items to offset by for pagination
limit
query
integer
false
How many items to return at one time (max 64)
Reading a Schema from the blockchain can easily be achieved by using the get
method which will return the JSON schema to a specific schema ID. The schemaId
needs to be URL encoded (e.g. /schemas/https%3A%2F%2Fschema.dock.io%2FTestSchema-V1-1695817897561.json
)
schemaId
path
String
true
A URL encoded schema id.
Get all schemas created by user. More info about List Schemas
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
Whether to include ecosystems or not
true
Returns the JSON schema for a specific ID. More info about Get Schema By ID
32 byte hex string. Ignoring higher base (base64) for simplicity.
Deletes a schema from the database
32 byte hex string. Ignoring higher base (base64) for simplicity.
Object containing unique id of the background task and associated data. This id can be used to query the job status
Creates a JSON schema on the blockchain. More info about Schema Creation
Verifiable Credential Schema
The schema version, generally following the JSON-schema specification.
http://json-schema.org/draft-07/schema#
Name of the schema.
My Schema
A brief description of the schema.
Truvera Schema Example
Defines the type of schema. Usually 'object'.
object
The properties that define the schema.
{"id":{"type":"string"},"emailAddress":{"type":"string","format":"email"},"alumniOf":{"type":"string"}}
Required fields within the schema.
["emailAddress","alumniOf"]
Specifies whether additional properties outside the defined schema are allowed.
true
Object containing unique id of the background task and associated data. This id can be used to query the job status