- Overview
- Setup
- Tutorials
- How Tos
- Reference
Utility.Credential.V0.Credential¶
Templates¶
template Credential
A credential contract issued by an issuer to a holder for a specific purpose. It allows an issuer to attest a fact about a subject. The subject is typically the same as the holder of the credential. Credentials should be immutable, so that they can be fetched (i.e. verified) without contention. Credentials can be configured to be existential: by not providing an expiry date, they are valid as long as the contract exists on ledger.
Signatory: issuer, holder
Field
Type
Description
issuer
Issuer of the credential.
holder
Holder of the credential.
id
Identifier of the credential.
description
Description of the credential.
validFrom
Timestamp as of which the credential becomes valid. If not provided, the credential becomes valid as soon as it is created.
validUntil
Timestamp as of which the credential ceases to be valid. If not provided, the credential is valid indefinitely (or until it is revoked). Since credentials should be immutable, it is recommended to only provide this timestamp if it is guaranteed to stay constant. For example, paid credentials should typically have None here, because the initial validity period could either be extended (if the user tops up their balance) or shortened (if the USD vs CC rate changes).
claims
{ref}
[Claim <type-utility-credential-v0-credential-claim-45224>]A list of claims, which are statements about a subject. The subject is typically the same as the holder of the credential.
observers
Observers of the credential.
Choice Archive
Controller: issuer, holder
Returns: ()
(no fields)
Choice Credential\_Get
Fetch the credential.
Controller: actor
Returns: Credential\_Get\_Result
Field
Type
Description
actor
The actor party.
Choice Credential\_Revoke
Revoke the credential.
Controller: actor
Returns: Credential\_Revoke\_Result
Field
Type
Description
actor
Revoker of the credential: This can either be the issuer or the holder.
Data Types¶
data Claim
A claim is a statement about a subject. Reference: https://www.w3.org/TR/vc-data-model-2.0/#claims (terminology therein used below) For example: “Pat is an alumni of XYZ University”.
Result of
Credential_Get.
Field
Type
Description
credential
The fetched credential.
data Credential\_Revoke\_Result
Result of
Credential_Revoke.
(no fields)
type Parties
data PartyCredentialRequirement
Defines the criteria a credential must satisfy to prove authorization for a
Party(thesubject). The validation will additionally check that the credential is held by either thesubjector theissuer.NOTE: This data type is used internally by Utility applications. External consumers should use their own credential requirement definitions (as these might evolve independently).