diff --git a/spec/README.md b/spec/README.md new file mode 100644 index 0000000..85b5c20 --- /dev/null +++ b/spec/README.md @@ -0,0 +1,6 @@ +# Web5 Spec + +This directory servers as a sub-resource for the [main spec](../README.md) to further define our usage of selected standards. + +* [Decentralized Identifiers v1.0](did.md) +* [Verifiable Credentials v1.1](vc.md) \ No newline at end of file diff --git a/spec/did-metadata.json b/spec/did-metadata.json index e69de29..998f303 100644 --- a/spec/did-metadata.json +++ b/spec/did-metadata.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-2020-12/schema#", + "type": "object", + "properties": { + "created": { + "type": "string", + "format": "date-time" + }, + "updated": { + "type": "string", + "format": "date-time" + }, + "deactivated": { + "type": "boolean" + }, + "nextUpdate": { + "type": "string", + "format": "date-time" + }, + "versionId": { + "type": "string" + }, + "nextversionId": { + "type": "string" + }, + "equivalentId": { + "type": "array", + "items": { + "type": "string", + } + }, + "canonicalId": { + "type": "string" + } + } +} diff --git a/spec/did-resolution.json b/spec/did-resolution.json index e69de29..b78dfeb 100644 --- a/spec/did-resolution.json +++ b/spec/did-resolution.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-2020-12/schema#", + "definitions": { + "errorType": { + "type": "string", + "enum": ["invalidDid", "notFound", "representationNotSupported", "methodNotSupported", "invalidDidDocument", "invalidDidDocumentLength", "internalError"] + } + }, + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/errorType" + } + } +} \ No newline at end of file diff --git a/spec/did.json b/spec/did.json index e69de29..f211f44 100644 --- a/spec/did.json +++ b/spec/did.json @@ -0,0 +1,121 @@ +{ + "$schema": "http://json-schema.org/draft-2020-12/schema#", + "definitions": { + "verificationMethod": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "controller": { + "type": "string" + }, + "publicKeyJwk": { + "type": "object" + } + }, + "required": ["id", "type", "controller", "publicKeyJwk"] + }, + "service": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "serviceEndpoint": { + "type": "array", + "items": { + "type": "string" + } + }, + "sig": { + "type": "array", + "items": { + "type": "string" + } + }, + "enc": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["id", "type", "serviceEndpoint"] + } + }, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "@context": { + "type": "array", + "items": { + "type": "string" + } + }, + "controller": { + "type": "array", + "items": { + "type": "string" + } + }, + "alsoKnownAs": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationMethod": { + "type": "array", + "items": { + "$ref": "#/definitions/verificationMethod" + }, + "minItems": 1 + }, + "authentication": { + "type": "array", + "items": { + "type": "string" + } + }, + "assertionMethod": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyAgreement": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityInvocation": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityDelegation": { + "type": "array", + "items": { + "type": "string" + } + }, + "service": { + "type": "array", + "items": { + "$ref": "#/definitions/service" + } + } + }, + "required": ["id", "verificationMethod"] +} diff --git a/spec/vc-11.json b/spec/vc-11.json index e69de29..81e5830 100644 --- a/spec/vc-11.json +++ b/spec/vc-11.json @@ -0,0 +1,79 @@ +{ + "$schema": "http://json-schema.org/draft-2020-12/schema#", + "type": "object", + "definitions": { + "credentialStatus": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { "type": "string" }, + "statusPurpose": { "type": "string" }, + "statusListIndex": { "type": "string" }, + "statusListCredential": { "type": "string" } + }, + "required": ["id", "type", "statusPurpose", "statusListIndex", "statusListCredential"] + }, + "credentialSchema": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "type": { "type": "string" } + }, + "required": ["id", "type"] + } + }, + "properties": { + "@context": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "id": { + "type": "string" + }, + "type": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "issuer": { + "oneOf": [ + { "type": "string" }, + { + "type": "object", + "properties": { + "id": { "type": "string" }, + "name": { "type": "string" } + }, + "required": ["id"] + } + ] + }, + "issuanceDate": { + "type": "string", + "format": "date-time" + }, + "expirationDate": { + "type": "string", + "format": "date-time" + }, + "credentialSubject": { + "type": "object", + "properties": { + "id": { "type": "string" } + }, + "required": ["id"] + }, + "credentialStatus": { "$ref": "#/definitions/credentialStatus" }, + "credentialSchema": { "$ref": "#/definitions/credentialSchema" }, + "evidence": { + "type": "array", + "items": { "type": "object" } + } + }, + "required": ["@context", "id", "type", "issuer", "issuanceDate", "credentialSubject"] +} diff --git a/spec/vp-11.json b/spec/vp-11.json index e69de29..bbd1895 100644 --- a/spec/vp-11.json +++ b/spec/vp-11.json @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-2020-12/schema#", + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "id": { + "type": "string" + }, + "type": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "holder": { + "type": "string", + "format": "uri" + }, + "issuanceDate": { + "type": "string", + "format": "date-time" + }, + "expirationDate": { + "type": "string", + "format": "date-time" + }, + "verifiableCredential": { + "type": "array", + "items": { + "$ref": "vc-11.json" + }, + "minItems": 1 + } + }, + "required": ["@context", "id", "type", "holder", "issuanceDate", "verifiableCredential"] +}