diff --git a/generate-markdown-table-comparison.nu b/generate-markdown-table-comparison.nu new file mode 100755 index 0000000..67e4162 --- /dev/null +++ b/generate-markdown-table-comparison.nu @@ -0,0 +1,10 @@ +#!/usr/bin/env nu +let properties = open ./schemas/traits.json | $in.properties +ls methods/*.json | each {|file| + let method = open $file.name + let traits = { Method: $"[did:($method.name)]\(https://www.w3.org/TR/did-extensions-methods/#did-methods\)" } + # $traits | merge + ($properties | columns | filter {$in != "name"} | each {|name| + { trait: $"[($properties | get $name | get title)]\(#($name)\)", value: ($method | default false $name | get $name | if $in { "✅" } else { "" }) } + }) | reduce -f $traits {|it, acc| $acc | insert $it.trait $it.value } +} | to md diff --git a/methods/key.json b/methods/key.json new file mode 100644 index 0000000..5afb3b9 --- /dev/null +++ b/methods/key.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://identity.foundation/did-traits/schemas/traits.json", + "name": "key", + "updateable": false, + "updateable_service_endpoints": false, + "deactivatable": false, + "deletable": false, + "explicit_fees": false, + "self-certifying": true, + "updateable_verification_methods": false, + "pre-rotation_of_keys": false, + "multi-sig_verification_method": false, + "human-readable": false, + "resolvable_locally": false, + "resolvable_globally": true, + "history": false, + "history_signed": false, + "hosted_not": true, + "hosted_centrally": false, + "hosted_decentrally": false +} diff --git a/methods/peer.json b/methods/peer.json new file mode 100644 index 0000000..966c61f --- /dev/null +++ b/methods/peer.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://identity.foundation/did-traits/schemas/traits.json", + "name": "peer", + "updateable": true, + "updateable_service_endpoints": true, + "deactivatable": false, + "deletable": false, + "explicit_fees": false, + "self-certifying": true, + "updateable_verification_methods": true, + "pre-rotation_of_keys": false, + "multi-sig_verification_method": false, + "human-readable": false, + "resolvable_locally": true, + "resolvable_globally": false, + "history": false, + "history_signed": false, + "hosted_not": true, + "hosted_centrally": false, + "hosted_decentrally": false +} diff --git a/methods/tdw.json b/methods/tdw.json new file mode 100644 index 0000000..a56e06b --- /dev/null +++ b/methods/tdw.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://identity.foundation/did-traits/schemas/traits.json", + "name": "tdw", + "updateable": true, + "updateable_service_endpoints": true, + "deactivatable": true, + "deletable": true, + "explicit_fees": false, + "self-certifying": true, + "updateable_verification_methods": true, + "pre-rotation_of_keys": true, + "multi-sig_verification_method": false, + "human-readable": false, + "resolvable_locally": false, + "resolvable_globally": true, + "history": true, + "history_signed": true, + "hosted_not": false, + "hosted_centrally": true, + "hosted_decentrally": false +} diff --git a/methods/web.json b/methods/web.json new file mode 100644 index 0000000..3aec034 --- /dev/null +++ b/methods/web.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://identity.foundation/did-traits/schemas/traits.json", + "name": "web", + "updateable": true, + "updateable_service_endpoints": true, + "deactivatable": true, + "deletable": true, + "explicit_fees": false, + "self-certifying": false, + "updateable_verification_methods": true, + "pre-rotation_of_keys": false, + "multi-sig_verification_method": false, + "human-readable": true, + "resolvable_locally": false, + "resolvable_globally": true, + "history": false, + "history_signed": false, + "hosted_not": false, + "hosted_centrally": true, + "hosted_decentrally": false +} diff --git a/spec/spec.md b/spec/spec.md index e13b647..2b5ef00 100644 --- a/spec/spec.md +++ b/spec/spec.md @@ -106,26 +106,72 @@ Generated with ../generate-markdown-table.nu ## JSON Schema Data Model -TODO +The specification defines a normative JSON Schema data model for documenting and representing DID method traits in a +machine-readable format. The canonical schema is formally defined at +. + +DID method authors SHALL use this schema to describe their method's trait support. The schema is structured with two +primary components: + +- A `name` property of type string identifying the specific DID method. +- Traits properties of type boolean. + +All traits are represented as boolean values with the following semantics: + +- `true` indicates explicit support for the corresponding trait +- `false` explicitly indicates non-support of the trait. +- Omission of a trait property is equivalent to `false`. + +Conforming implementations MUST validate their trait documentation against this JSON Schema, ensuring consistent and +unambiguous representation of DID method capabilities. + +### Example + +This example demonstrates a complete JSON representation of the did:web DID method, illustrating the schema's structure. + + + +```json +{ + "$schema": "https://identity.foundation/did-traits/schemas/traits.json", + "name": "web", + "modifiable": true, + "service_endpoints": true, + "deactivatable": true, + "deletable": true, + "fees": false, + "self-certifying": false, + "rotatable_keys": true, + "pre-rotatable_keys": false, + "modifiable_multi-sig": false, + "human-readable": true, + "resolvable_locally": false, + "resolvable_globally": true, + "history": false, + "history_signed": false, + "hosted_not": false, + "hosted_centrally": true, + "hosted_decentrally": false +} +``` ## Comparison of DID Methods -INFO: this table is not a deliverable of this work item. It's merely an example of how a comparison table could look -like. - -| Method \ Trait | [Deactivatable](#deactivatable) | [Enumerable](#enumerable) | [Globally resolvable](#globally) | [History available](#history) | [Immutable History](#immutable) | [Human-readable](#human-readable) | [Key Pre-Rotation](#pre-rotation) | [Modifiable](#modifiable) | [Self-Certification](#self-certification) | [Self-Creation](#self-creation) | [Explicit fees](#fees) | -| ----------------------------------------------------------------------------- | ------------------------------- | ------------------------- | -------------------------------- | ----------------------------- | ------------------------------- | --------------------------------- | --------------------------------- | ------------------------- | ----------------------------------------- | ------------------------------- | ---------------------- | -| [did:tdw](https://bcgov.github.io/trustdidweb/) | [`x`](#x) | | [`x`](#x) | [`x`](#x) | [`x`](#x) | | [`x`](#x) | [`x`](#x) | [`x`](#x) | | | -| [did:web](https://w3c-ccg.github.io/did-method-web/) | [`x`](#x) | | [`x`](#x) | | | [`x`](#x) | | [`x`](#x) | | | | -| did:key | | | [`x`](#x) | | | | | | [`x`](#x) | [`x`](#x) | | -| did:jwk | | | [`x`](#x) | | | | | | [`x`](#x) | [`x`](#x) | | -| did:peer | | | | [`x`](#x) | | | | [`x`](#x) | [`x`](#x) | [`x`](#x) | | -| did:dht | [`x`](#x) | [`x`](#x) | [`x`](#x) | [`x`](#x) | [`?`](#?) | | [`?`](#?) | [`x`](#x) | [`?`](#?) | [`?`](#?) | | -| [did:webs](https://trustoverip.github.io/tswg-did-method-webs-specification/) | | | | | | | | | | | | -| did:indy | | | | | | | | | | | | -| did:ebsi | | | | | | | | | | | | -| did:cheqd | | | | | | | | | | | | -| [did:iden3](https://github.com/iden3/did-iden3/tree/main) | | | | | | | | | | | | +The following table provides a comprehensive overview of trait support across multiple DID methods, enabling a +systematic comparison of their capabilities. + + + +| Method | [Updateable](#updateable) | [Updateable Service Endpoints](#updateable_service_endpoints) | [Deactivatable](#deactivatable) | [Deletable](#deletable) | [Explicit Fees](#explicit_fees) | [Self-Certifying](#self-certifying) | [Rotatable Verification Methods](#updateable_verification_methods) | [Pre-rotation of Keys](#pre-rotation_of_keys) | [Multi-Signature Verification Method](#multi-sig_verification_method) | [Human-readable](#human-readable) | [Enumerable](#enumerable) | [Locally Resolvable](#resolvable_locally) | [Globally Resolvable](#resolvable_globally) | [DID Document History](#history) | [Cryptograhpically signed DID Document History](#history_signed) | [Not Hosted](#hosted_not) | [Centrally Hosted](#hosted_centrally) | [Decentrally Hosted](#hosted_decentrally) | [Privacy Preserving Cryptography](#cryptography_privacy_preserving) | [Government-approved Cryptography](#cryptography_government-approved) | [GDPR-compliant](#gdpr-compliant) | +| --------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------- | ------------------------------- | ----------------------- | ------------------------------- | ----------------------------------- | ------------------------------------------------------------------ | --------------------------------------------- | --------------------------------------------------------------------- | --------------------------------- | ------------------------- | ----------------------------------------- | ------------------------------------------- | -------------------------------- | ---------------------------------------------------------------- | ------------------------- | ------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------- | +| [did:key](https://www.w3.org/TR/did-extensions-methods/#did-methods) | | | | | | ✅ | | | | | | | ✅ | | | ✅ | | | | | | +| [did:peer](https://www.w3.org/TR/did-extensions-methods/#did-methods) | ✅ | ✅ | | | | ✅ | ✅ | | | | | ✅ | | | | ✅ | | | | | | +| [did:tdw](https://www.w3.org/TR/did-extensions-methods/#did-methods) | ✅ | ✅ | ✅ | ✅ | | ✅ | ✅ | ✅ | | | | | ✅ | ✅ | ✅ | | ✅ | | | | | +| [did:web](https://www.w3.org/TR/did-extensions-methods/#did-methods) | ✅ | ✅ | ✅ | ✅ | | | ✅ | | | ✅ | | | ✅ | | | | ✅ | | | | | ## Appendix