Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
decentralgabe committed Jul 28, 2023
1 parent b57a656 commit 48718ff
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/howto/credential.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# How To: Create a Credential
9 changes: 7 additions & 2 deletions doc/howto/did.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}`.



24 changes: 24 additions & 0 deletions doc/howto/schema.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 48718ff

Please sign in to comment.