Documentation

W3C.VC

1. Core Value Types #

Reuse DIDValue from W3C.DID for representing JSON-like values.

2. Context and Type Definitions #

Credentials use JSON-LD contexts and types for semantic meaning.

structure W3C.Context :

JSON-LD context URI or object

Instances For

    Credential or presentation type

    Instances For

      3. Temporal Properties #

      Credentials have temporal validity constraints.

      structure W3C.DateTime :

      XML datetime string (ISO 8601)

      Instances For

        DateTime Parsing and Comparison #

        ISO 8601 datetime parsing and comparison functions. Supports simplified format: YYYY-MM-DDTHH:MM:SSZ

        Parsed datetime components

        Instances For

          Parse a string to natural number

          Equations
          Instances For

            Parse ISO 8601 datetime string (simplified format: YYYY-MM-DDTHH:MM:SSZ)

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Convert datetime components to comparable value (seconds since epoch approximation)

              Equations
              Instances For

                Compare two DateTimes (returns true if dt1 < dt2)

                Equations
                Instances For

                  Compare two DateTimes (returns true if dt1 > dt2)

                  Equations
                  Instances For

                    Compare two DateTimes (returns true if dt1 ≤ dt2)

                    Equations
                    Instances For

                      Compare two DateTimes (returns true if dt1 ≥ dt2)

                      Equations
                      Instances For

                        4. Issuer #

                        The issuer can be a URI or an object with additional properties.

                        inductive W3C.Issuer :

                        Issuer representation

                        Instances For

                          Extract issuer ID from Issuer

                          Equations
                          Instances For

                            5. Credential Subject #

                            The subject of the credential (entity about which claims are made).

                            Credential subject with optional id and claims

                            Instances For

                              6. Credential Status #

                              Information about the credential's revocation or suspension status.

                              Credential status entry

                              • id : String

                                REQUIRED: URI identifying the status information

                              • type_ : String

                                REQUIRED: Status mechanism type

                              • additionalProperties : List (String × DIDValue)

                                Additional status-specific properties

                              Instances For

                                7. Credential Schema #

                                Reference to a schema for validating credential structure.

                                Credential schema reference

                                • id : String

                                  REQUIRED: URI identifying the schema

                                • type_ : String

                                  REQUIRED: Schema type

                                • additionalProperties : List (String × DIDValue)

                                  Additional schema-specific properties

                                Instances For

                                  8. Evidence #

                                  Supporting evidence for the claims in a credential.

                                  structure W3C.Evidence :

                                  Evidence entry

                                  Instances For

                                    9. Terms of Use #

                                    Defines terms under which the credential can be used.

                                    structure W3C.TermsOfUse :

                                    Terms of use entry

                                    Instances For

                                      10. Refresh Service #

                                      Mechanism for refreshing the credential.

                                      Refresh service entry

                                      • id : String

                                        REQUIRED: URI of the refresh service

                                      • type_ : String

                                        REQUIRED: Service type

                                      • additionalProperties : List (String × DIDValue)

                                        Additional service-specific properties

                                      Instances For

                                        11. Proof #

                                        Cryptographic proof that makes credentials and presentations verifiable.

                                        Proof purpose (why the proof was created)

                                        Instances For
                                          structure W3C.Proof :

                                          Cryptographic proof (embedded or enveloping)

                                          • type_ : String

                                            REQUIRED: Proof type

                                          • cryptosuite : Option String

                                            OPTIONAL: Cryptosuite identifier

                                          • created : Option DateTime

                                            OPTIONAL: Timestamp of proof creation

                                          • verificationMethod : Option String

                                            OPTIONAL: Verification method URI

                                          • proofPurpose : Option String

                                            OPTIONAL: Purpose of the proof

                                          • proofValue : Option String

                                            OPTIONAL: The cryptographic proof value

                                          • challenge : Option String

                                            OPTIONAL: Challenge for preventing replay attacks

                                          • domain : Option String

                                            OPTIONAL: Domain for binding to specific verifier

                                          • additionalProperties : List (String × DIDValue)

                                            Additional proof-specific properties

                                          Instances For

                                            12. Credential #

                                            A credential is a set of claims made by an issuer about a subject. This is the base structure before securing with proof.

                                            structure W3C.Credential :

                                            Credential (before securing with proof)

                                            Instances For

                                              13. Credential with Proof #

                                              A credential with proofs attached, but not yet verified. This is an intermediate structure before verification.

                                              Credential with attached proofs (not yet verified)

                                              Instances For

                                                14. Valid and Invalid Verifiable Credentials #

                                                structure W3C.ValidVC :

                                                Valid Verifiable Credential

                                                A credential whose cryptographic proof has been successfully verified. The issuer's signature is valid and the credential has not been tampered with.

                                                Abstraction:

                                                • Does not expose cryptographic details (Ed25519, BBS+, etc.)
                                                • Protocol-level abstraction: "cryptographically valid credential"
                                                • Construction implies successful verification
                                                Instances For
                                                  structure W3C.InvalidVC :

                                                  Invalid Verifiable Credential

                                                  A credential whose cryptographic proof verification has failed. Reasons include:

                                                  • Signature verification failure
                                                  • Tampered credential content
                                                  • Invalid issuer key
                                                  • Malformed proof
                                                  Instances For

                                                    Verifiable Credential

                                                    Sum type of valid and invalid credentials. Represents the result of cryptographic verification.

                                                    Design Pattern:

                                                    • valid: Proof verification succeeded
                                                    • invalid: Proof verification failed
                                                    • Verification function is a simple pattern match
                                                    • Enables formal verification of protocol properties
                                                    Instances For

                                                      Get the underlying credential (without proof)

                                                      Equations
                                                      Instances For

                                                        Get the issuer of the credential

                                                        Equations
                                                        Instances For

                                                          Verify cryptographic signature

                                                          Design Core:

                                                          • valid: Always returns true (proof already verified at construction)
                                                          • invalid: Always returns false (proof verification failed)

                                                          This simple definition enables formal reasoning about verification without exposing cryptographic implementation details.

                                                          Equations
                                                          Instances For

                                                            Check if a verifiable credential is valid

                                                            Equations
                                                            Instances For

                                                              Check if a verifiable credential has expired

                                                              Equations
                                                              Instances For

                                                                Check if a verifiable credential is not yet valid

                                                                Equations
                                                                Instances For

                                                                  15. Holder #

                                                                  Entity that possesses and presents credentials.

                                                                  inductive W3C.Holder :

                                                                  Holder representation (similar to Issuer)

                                                                  Instances For

                                                                    Extract holder ID from Holder

                                                                    Equations
                                                                    Instances For

                                                                      16. Presentation #

                                                                      A presentation is data derived from credentials for a specific verifier.

                                                                      Presentation (before securing with proof)

                                                                      Instances For

                                                                        17. Presentation with Proof #

                                                                        A presentation with proofs attached, but not yet verified.

                                                                        Presentation with attached proofs (not yet verified)

                                                                        Instances For

                                                                          18. Valid and Invalid Verifiable Presentations #

                                                                          structure W3C.ValidVP :

                                                                          Valid Verifiable Presentation

                                                                          A presentation whose cryptographic proof has been successfully verified. The holder's signature is valid and the presentation has not been tampered with.

                                                                          Instances For
                                                                            structure W3C.InvalidVP :

                                                                            Invalid Verifiable Presentation

                                                                            A presentation whose cryptographic proof verification has failed.

                                                                            Instances For

                                                                              Verifiable Presentation

                                                                              Sum type of valid and invalid presentations. Same design pattern as VerifiableCredential.

                                                                              Instances For

                                                                                Get the underlying presentation (without proof)

                                                                                Equations
                                                                                Instances For

                                                                                  Get the holder of the presentation

                                                                                  Equations
                                                                                  Instances For

                                                                                    Check if a verifiable presentation is valid

                                                                                    Equations
                                                                                    Instances For

                                                                                      19. Constants #

                                                                                      W3C defined constants.

                                                                                      The required v2 context URI

                                                                                      Equations
                                                                                      Instances For

                                                                                        The required credential type

                                                                                        Equations
                                                                                        Instances For

                                                                                          The required presentation type

                                                                                          Equations
                                                                                          Instances For

                                                                                            20. Structural Validation Predicates #

                                                                                            Validation checks that don't depend on cryptography.

                                                                                            Check if context list has the required v2 context as first element

                                                                                            Equations
                                                                                            Instances For
                                                                                              def W3C.hasRequiredType (types : List CredentialType) (requiredType : String) :

                                                                                              Check if type list includes required type

                                                                                              Equations
                                                                                              Instances For

                                                                                                Check if credential subject has at least one claim

                                                                                                Equations
                                                                                                Instances For

                                                                                                  All credential subjects must have at least one claim

                                                                                                  Equations
                                                                                                  Instances For

                                                                                                    Credential status must have id and type if present

                                                                                                    Equations
                                                                                                    Instances For

                                                                                                      Credential schema must have id and type if present

                                                                                                      Equations
                                                                                                      Instances For

                                                                                                        A credential is structurally valid if it satisfies all MUST requirements

                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For

                                                                                                          A credential with proof must have at least one proof

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            A presentation is structurally valid if it satisfies all MUST requirements

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              A presentation with proof must have at least one proof

                                                                                                              Equations
                                                                                                              Instances For

                                                                                                                21. Complete Validation and Verification #

                                                                                                                Combines structural validation with cryptographic verification.

                                                                                                                Complete validation of a verifiable presentation

                                                                                                                Equations
                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                Instances For

                                                                                                                  22. Temporal Validity #

                                                                                                                  Check if credentials are within their validity period.

                                                                                                                  Abstract notion of current time (to be provided by verification context)

                                                                                                                  Instances For

                                                                                                                    Check if a credential is temporally valid at a given time

                                                                                                                    Equations
                                                                                                                    Instances For

                                                                                                                      23. Security Properties #

                                                                                                                      Issuer Binding: A valid credential is cryptographically bound to its issuer

                                                                                                                      Equations
                                                                                                                      Instances For

                                                                                                                        Holder Binding: A valid presentation is cryptographically bound to its holder

                                                                                                                        Equations
                                                                                                                        Instances For

                                                                                                                          Non-Repudiation: An issuer cannot deny issuing a valid credential

                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Credential Integrity: Valid credentials maintain their integrity

                                                                                                                            Equations
                                                                                                                            Instances For

                                                                                                                              Presentation Integrity: Valid presentations maintain their integrity

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                24. Privacy Properties #

                                                                                                                                Formal privacy properties for credentials and presentations.

                                                                                                                                Selective Disclosure: Ability to reveal only specific claims

                                                                                                                                Equations
                                                                                                                                Instances For

                                                                                                                                  Unlinkability: Credentials should not be trivially linkable across uses

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    25. DateTime Comparison Properties #

                                                                                                                                    DateTime comparison is reflexive for valid datetimes

                                                                                                                                    theorem W3C.dateTime_before_after (dt1 dt2 : DateTime) :
                                                                                                                                    dateTimeBefore dt1 dt2 = truedateTimeAfter dt2 dt1 = true

                                                                                                                                    If dt1 is before dt2, then dt2 is after dt1

                                                                                                                                    theorem W3C.dateTime_trans (dt1 dt2 dt3 : DateTime) :
                                                                                                                                    dateTimeBefore dt1 dt2 = truedateTimeBefore dt2 dt3 = truedateTimeBefore dt1 dt3 = true

                                                                                                                                    Transitivity of dateTimeBefore

                                                                                                                                    26. Core Theorems #

                                                                                                                                    Valid credentials always pass signature verification

                                                                                                                                    Invalid credentials always fail signature verification

                                                                                                                                    Valid presentations always pass signature verification

                                                                                                                                    Invalid presentations always fail signature verification

                                                                                                                                    Valid credentials satisfy issuer binding

                                                                                                                                    Valid presentations satisfy holder binding (if holder present)

                                                                                                                                    26. Example Credentials and Presentations #

                                                                                                                                    Example context

                                                                                                                                    Equations
                                                                                                                                    Instances For

                                                                                                                                      Example credential subject

                                                                                                                                      Equations
                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                      Instances For

                                                                                                                                        Example proof

                                                                                                                                        Equations
                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                        Instances For

                                                                                                                                          Example credential

                                                                                                                                          Equations
                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                          Instances For

                                                                                                                                            Example credential with proof

                                                                                                                                            Equations
                                                                                                                                            Instances For

                                                                                                                                              Example valid verifiable credential

                                                                                                                                              Equations
                                                                                                                                              Instances For

                                                                                                                                                Example presentation

                                                                                                                                                Equations
                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                Instances For

                                                                                                                                                  Example presentation with proof

                                                                                                                                                  Equations
                                                                                                                                                  Instances For

                                                                                                                                                    Example valid verifiable presentation

                                                                                                                                                    Equations
                                                                                                                                                    Instances For

                                                                                                                                                      27. DateTime Comparison Examples #

                                                                                                                                                      These examples demonstrate the DateTime parsing and comparison functions.

                                                                                                                                                      Example DateTime values

                                                                                                                                                      Equations
                                                                                                                                                      Instances For
                                                                                                                                                        Equations
                                                                                                                                                        Instances For
                                                                                                                                                          Equations
                                                                                                                                                          Instances For
                                                                                                                                                            Equations
                                                                                                                                                            Instances For

                                                                                                                                                              Test credential with validFrom and validUntil

                                                                                                                                                              Equations
                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                              Instances For
                                                                                                                                                                Equations
                                                                                                                                                                Instances For

                                                                                                                                                                  Test cases for DateTime comparison

                                                                                                                                                                  Equations
                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                  Instances For

                                                                                                                                                                    Test cases for DateTime parsing

                                                                                                                                                                    Equations
                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                    Instances For