Credentials
You can create and sign Verifiable Credentials using Truvera API. By default, Truvera does not store the credential - only its metadata. You can choose to persist a credential, in which case we will encrypt and store the credential for later retrieval using a password. Verifiable Credentials are cryptographically secure and tamper-proof. Once issued, they cannot be edited.
Issue Credential
Creates and issues a JSON-LD Verifiable Credential that conforms to the W3C VCDM specification. The type
values and subject properties must be represented by a schema URI in the context
property. If you do not specify a context
property, the API will automatically generate an embedded JSON-LD context based on the properties within your credential. You can read more about JSON-LD and contexts here.
The https://www.w3.org/2018/credentials/v1
context URI is always required and will be supplied by default at all times as mandated by the spec. If you pass a custom context, you must ensure that you define all the required JSON-LD terms. Please also note that the request format here is not the same as an issued verifiable credential. You can issue to multiple subjects per credential by passing an array of objects.
To sign a credential, an issuer
must be supplied as either a fully qualified DID string or an object with at least an id
property which is a fully qualified DID. (e.g: did:dock:xyz
)
The issuer
property must be a DID that you control with your Truvera account.
For Polygon ID credentials:
In order to issue Polygon ID credentials, the issuer must be a
did:polygonid
issuer.Polygon ID credentials do not support designs at this point so
template
field should be omitted.
By default, Truvera does not store the credential contents at all - only minimal credential metadata. You can choose to set the persist
value to true
and provide a password
string which will store the credential contents encrypted on our platform. The following metadata is stored on each issuance:
Credential ID property
Credential size in bytes
Issuer DID
Issuance date
Zero Knowledge Proofs (ZKP)
Truvera credentials support anonymous credentials using Zero Knowledge Proofs and Selective Disclosure by using the BBS2023 signing algorithm when issuing the credential. To enable this functionality, simply set the algorithm
field in the request to dockbbs
.
Credential Distribution
Truvera's API has built in credential distribution on issuance, allowing you to send credentials directly to a holder's email and/or Truvera-compatible wallet. You can achieve this by supplying the recipientEmail
field and distribute: true
in your request. For DID distribution, simply set the credentialSubject.id
property to the holder's DID.
Revocation
In order to support revocation the credential must be linked to a revocation registry at the time of issuance. To link the revocation registry to the credential set the status
field in the Credential body to the registry.id
value.
Issue a Credential
Creates and issues a verifiable credential with supplied data. More info about Issue a Credential
A credential issue request body for one credential
Whether to store an encrypted version of this credential with us. Defaults to false, if true you must supply password.
true
Password used to encrypt the credential if you choose to store it. The same password must be used to retrieve the credential contents. Truvera does not store this password.
"securepass"
The credential template UUID, only required for PDF and web rendering customization
""
The holder's email for email distribution, optional. Not required for OpenID flows.
""
Optional. Specifies which signing algorithm to use to sign the issued credential. Defaults to ed25519, for ZKP credendials use dockbbs.
"dockbbs"
Whether to distribute the credential or not based on subject DID or email address. Not required for OpenID flows.
false
Specifies the output format of the credential, either jsonld or jwt. Defaults to jsonld.
"jsonld"
Format to create credentials with the API
The request was successful and returns the created Verifiable Credential.
JSON-LD context array of strings or single string
"https://docknetwork.github.io/vc-schemas/basic-credential.json-ld"
Revocation registry id or user supplied status object
List Credentials
When you issue a credential with us, persistent or not, we will store certain metadata about the credential to make it easier for you to reference. You can pull a list of credential metadata using this route. To return the content of a persisted credential, you should use the GET /credentials/{id}
route.
List Credentials
Get all credential metadata
The request was successful and will return the credential metadata.
The unique identifier for the credential, typically a URL pointing to its location or a hash value.
"https://creds.truvera.io/521bb7..."
The DID and key identifier of the issuer that signed the credential. This key is used to verify the authenticity of the credential.
"did:key:z6Mk...dsmK"
The profile name of the issuer that signed the credential.
"Truvera Issuer"
The type of credential.
"VerifiableCredential"
The registry identifier for revocation information associated with the credential.
"e6d3...59d1"
Indicates whether the credential has been revoked. If true, the credential is no longer valid
false
The date and time when the credential metadata was created.
"2024-09-20T11:13:03.445Z"
The expiration date of the credential.
"2024-09-20T11:13:03.445Z"
Alternative field for the expiration date of the credential.
"2024-09-20T11:13:03.445Z"
The date and time when the credential was issued.
"2024-09-20T11:13:02.648Z"
The size of the credential in bytes.
1003
Indicates whether the credential is persisted in storage.
false
A unique index or identifier within a collection of credentials.
"1004"
A reference to the subject of the credential, typically used to identify the entity to which the credential pertains.
"Truvera Ref"
Indicates if the credential is associated with a specific whitelabel or brand.
The algorithm used for creating or signing the credential.
"dockbbs"
Verifiable (signed) Credential returned by API. The current set of properties is almost complete
Get credentials metadata and contents
When a credential has been persisted on our systems, you can fetch the credential data by supplying a credential ID and the password used at issuance to encrypt the credential.
Get credential metadata and contents if persistent
Get credential metadata and contents if persistent
Valid URI
"https://credentials.truvera.io/1234"
The request was successful and will return the credential metadata and its JSON contents (if password was supplied).
The unique identifier for the credential, typically a URL pointing to its location or a hash value.
"https://creds.truvera.io/521bb7..."
The DID and key identifier of the issuer that signed the credential. This key is used to verify the authenticity of the credential.
"did:key:z6Mk...dsmK"
The profile name of the issuer that signed the credential.
"Truvera Issuer"
The type of credential.
"VerifiableCredential"
The registry identifier for revocation information associated with the credential.
"e6d3...59d1"
Indicates whether the credential has been revoked. If true, the credential is no longer valid
false
The date and time when the credential metadata was created.
"2024-09-20T11:13:03.445Z"
The expiration date of the credential.
"2024-09-20T11:13:03.445Z"
Alternative field for the expiration date of the credential.
"2024-09-20T11:13:03.445Z"
The date and time when the credential was issued.
"2024-09-20T11:13:02.648Z"
The size of the credential in bytes.
1003
Indicates whether the credential is persisted in storage.
false
A unique index or identifier within a collection of credentials.
"1004"
A reference to the subject of the credential, typically used to identify the entity to which the credential pertains.
"Truvera Ref"
Indicates if the credential is associated with a specific whitelabel or brand.
The algorithm used for creating or signing the credential.
"dockbbs"
Verifiable (signed) Credential returned by API. The current set of properties is almost complete
Create request claims
Creates a request to gather certain claims and then issues the holder a credential after submission. The claims are user provided and type is based on the schema provided. This can be useful to catch a subject's DID without knowing it beforehand, name or other field. It should only be used when you do not already know this data or cannot find it by other means. There is a risk that a user may enter false data - so use it sparingly and not for fields that are important.
Typically, once the request has been created, you would show the holder the QR URL as an image or deep link for them to scan with a wallet and enter claims. After the holder submits the requested information the credential is automatically issued.
Issue a Credential after requesting claims from the user
Creates and issues a verifiable credential with supplied data + claims from the user.
A credential issue request body for one credential
"https://docknetwork.github.io/vc-schemas/basic-credential.json"
OpenID issuer and claim request created
OpenID provider configuration
Key/value pair mapping for OpenID claims to JSON-LD terms
Get request claims
Lists all created request claims that are open (the holders have not submitted the requested information).
Delete Credential
A credential can have its metadata deleted, and if persisted the contents will also be deleted. Deleting a credential will remove any reference to it and its contents from our systems. This action cannot be undone. This action will not revoke or invalidate the credential in any way.
Delete a Credential
Deletes all credential metadata and contents from the client. More info about Delete Credentials
Valid URI
"https://credentials.truvera.io/1234"
Credential has been deleted.
Last updated