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

Party

Issuer of the credential.

holder

Party

Holder of the credential.

id

Text

Identifier of the credential.

description

Text

Description of the credential.

validFrom

Optional Time

Timestamp as of which the credential becomes valid. If not provided, the credential becomes valid as soon as it is created.

validUntil

Optional Time

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

Parties

Observers of the credential.

  • Choice Archive

    Controller: issuer, holder

    Returns: ()

    (no fields)

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”.

Claim

Field

Type

Description

subject

Text

A subject is a thing about which claims can be made (“Pat” in the example above).

property

Text

Property of the claim (“alumniOf” in the example above).

value

Text

Value of the claim property (“XYZ University” in the example above).

data Credential\_Get\_Result

Result of Credential_Get.

Credential\_Get\_Result

Field

Type

Description

credential

Credential

The fetched credential.

data Credential\_Revoke\_Result

Result of Credential_Revoke.

type Parties

= Set Party

Type synonym for a set of parties.

data PartyCredentialRequirement

Defines the criteria a credential must satisfy to prove authorization for a Party (the subject). The validation will additionally check that the credential is held by either the subject or the issuer.

NOTE: This data type is used internally by Utility applications. External consumers should use their own credential requirement definitions (as these might evolve independently).

PartyCredentialRequirement

Field

Type

Description

issuer

Party

Required issuer of the credential.

requiredClaims

[(Text, Text)]

Required (property, value) pairs. Each must exist in the credential as a claim where the subject is the claim’s subject.