From 48718ff0b990ee489628b515f118305a04d0480e Mon Sep 17 00:00:00 2001 From: gabe Date: Fri, 28 Jul 2023 11:21:50 -0700 Subject: [PATCH] tmp --- doc/howto/credential.md | 1 + doc/howto/did.md | 9 +++++++-- doc/howto/schema.md | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/howto/credential.md b/doc/howto/credential.md index e69de29bb..eb6108010 100644 --- a/doc/howto/credential.md +++ b/doc/howto/credential.md @@ -0,0 +1 @@ +# How To: Create a Credential \ No newline at end of file diff --git a/doc/howto/did.md b/doc/howto/did.md index 414134c25..a248710bf 100644 --- a/doc/howto/did.md +++ b/doc/howto/did.md @@ -49,6 +49,13 @@ For now let's keep things simple and create a new `did:key` with the key type [` } ``` +A sample CURL command is as follows: + +```bash +curl -X PUT localhost:3000/v1/dids/key -d '{"keyType": "Ed25519"}' +``` + +``` If successful, you should see a response such as... ```json @@ -118,5 +125,3 @@ You can get a specific DID's document by making a `GET` request to the method's The [universal resolver](https://github.com/decentralized-identity/universal-resolver) is a project at the [Decentralized Identity Foundation](https://identity.foundation/) aiming to enable the resolution of _any_ DID Document. The service, when run with [Docker Compose, runs a select number of these drivers (and more can be configured). It's possible to leverage the resolution of DIDs not supported by the service by making `GET` requests to `/v1/dids/resolver/{did}`. - - diff --git a/doc/howto/schema.md b/doc/howto/schema.md index e69de29bb..09a8a63f6 100644 --- a/doc/howto/schema.md +++ b/doc/howto/schema.md @@ -0,0 +1,24 @@ +# How To: Create a Schema + +## Background + +When creating [Verifiable Credentials](https://www.w3.org/TR/vc-data-model) it's useful to have a mechanism to define the shape the data in the credential takes, in a consistent manner. The VC Data Model uses an open world data model, and with it, provides a mechanism to "extend" the core terminology to add any term with a technology known as [JSON-LD](https://json-ld.org/). JSON-LD is responsible for the `@context` property visible in VCs, DIDs, and other documents in the SSI space. However, JSON-LD is focused on _semantics_, answering the question "do we have a shared understanding of what this thing is?" more specifically, for a name credential, does your concept of "name" match mine. Though the core data model is a JSON-LD data model, processing VCs as JSON-LD is not a requirement. The SSI Service chooses to take a simpler approach and [process VCs as pure JSON](https://www.w3.org/TR/vc-data-model/#json). + +When constructing and processing VCs as pure JSON it is useful to have a mechanism to define the data and add some light validation onto the shape that data takes. [JSON Schema](https://json-schema.org/) is a widely used, and widely supported toolset that enables such functionalty: the ability to define a schema, which provides a set of properties (both required and optional), and some light validation on top of those properties. The VC Data Model has [a section on data schemas](https://www.w3.org/TR/vc-data-model/#data-schemas) that enables this functionality. + +## Intro to JSON Schema with Verifiable Credentials + +Making use of the `credentialSchema` property [defined in the VC Data Model](https://www.w3.org/TR/vc-data-model/#data-schemas) TBD and other collaborators in the W3C are working on [a new specification](https://w3c.github.io/vc-json-schema/) which enables a standards-compliant path to using JSON Schema with Verifiable Crednetials. The VC JSON Schema specification defines two options for using JSON Schemas: the first, a plan JSON Schema that can apply to _any set of properties_ in a VC, and the second, a Verifiable Credential that wraps a JSON Schema. + +In some cases it is useful to package a JSON Schema as a Verifiable Credential to retain information about authorship (who created the schema), when it was created, and enable other features the VC Data Model offers, such as the ability to suspend the usage of a schema with [a status](https://www.w3.org/TR/vc-data-model/#status). + +An example JSON Schema using [JSON Schema Draft 2020-12]() providing an `emailAddress` property is shown below: + +```json + +``` + + + +## Creating a Schema +