0.1.0 • Published 2 years ago

@datamodels/verifiable-credentials v0.1.0

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
github
Last release
2 years ago

VerifiableCredentials DataModel

DataModel implementation of the VerifiableCredentials schemas and definition.

Installation

npm install -D @datamodels/verifiable-credentials

Rationale

A VerifiableCredential is fact-checking review/attestation of claims made about a credentialsubject, following the W3C VC datamodel.

The VerifiableCredentials data-model provides 3 definitions for the users's DID-datastore:

Each of these definitions has an array of VerifiableCredential stream IDs.

Schemas

ClaimedCredentials

The ClaimedCredentials schema defines the format of a document that contains the properties listed below. Properties not defined in the schema cannot be included in the ClaimedCredentials.

PropertyDescriptionValueMax SizeRequiredExample
claimedList of VerifiableCredentials self-issued by this DIDarray of ceramic:// links to VerifiableCredentials streamsfalse

IssuedCredentials

The IssuedCredentials schema defines the format of a document that contains the properties listed below. Properties not defined in the schema cannot be included in the IssuedCredentials.

PropertyDescriptionValueMax SizeRequiredExample
issuedList of VerifiableCredentials issued by this DID to other usersarray of ceramic:// links to VerifiableCredentials streamsfalse

HeldCredentials

The HeldCredentials schema defines the format of a document that contains the properties listed below. Properties not defined in the schema cannot be included in the IssuedCredentials.

PropertyDescriptionValueMax SizeRequiredExample
heldList of VerifiableCredentials received/issued by other DIDsarray of ceramic:// links to VerifiableCredentials streamsfalse

VerifiableCredential

The VerifiableCredential schema defines the format of a document that contains the properties listed below. Properties not defined in the schema cannot be included in the VerifiableCredential.

PropertyDescriptionValueMax SizeRequiredExample
@contextSee https://www.w3.org/TR/vc-data-model/#contextsarray of stringtrue
typeSee https://www.w3.org/TR/vc-data-model/#typesarray of stringtrue
idSee https://www.w3.org/TR/vc-data-model/#identifiersurltrue
issuerSee https://www.w3.org/TR/vc-data-model/#issuerobject with required property "id"true
credentialSubjectSee https://www.w3.org/TR/vc-data-model/#credential-subjectcredentialSubject with required property "id"true
credentialSchemaSee https://www.w3.org/TR/vc-data-model/#data-schemascredentialSchema with required properties "id" and "type"true
issuanceDateSee https://www.w3.org/TR/vc-data-model/#issuance-dateISO Date stringtrue
expirationDateSee https://www.w3.org/TR/vc-data-model/#expirationISO Date stringfalse
proofSee https://www.w3.org/TR/vc-data-model/#proofs-signaturesobject with required property "type"false
evidenceSee https://www.w3.org/TR/vc-data-model/#evidenceobject with required property "id"false
credentialStatusSee https://www.w3.org/TR/vc-data-model/#statusobject with required property "id"false

Streams created using this schema can then be linked to a DID's issued credentials on the definitions above.

License

Dual licensed under MIT and Apache 2