https://github.com/transmute-industries/did-core
W3C Decentralized Identifiers
https://github.com/transmute-industries/did-core
decentralized did identifiers no-vendor-lock self-sovereign-identity verifiable
Last synced: 10 months ago
JSON representation
W3C Decentralized Identifiers
- Host: GitHub
- URL: https://github.com/transmute-industries/did-core
- Owner: transmute-industries
- License: apache-2.0
- Created: 2020-07-05T19:04:05.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T05:34:56.000Z (over 3 years ago)
- Last Synced: 2024-11-20T15:57:00.402Z (over 1 year ago)
- Topics: decentralized, did, identifiers, no-vendor-lock, self-sovereign-identity, verifiable
- Language: JavaScript
- Homepage: https://transmute-industries.github.io/did-core/
- Size: 5.54 MB
- Stars: 8
- Watchers: 4
- Forks: 5
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Decentralized Identifiers
 
TypeScript implementations of [did core](https://www.w3.org/TR/did-core/) and related utilities.
These modules are agnostic to [DID Methods](https://www.w3.org/TR/did-core/#dfn-did-methods).
## Usage with Verifiable Credentials
```ts
import { factory, DidDocument } from '@did-core/data-model';
import { representation } from '@did-core/did-ld-json';
const didDocument: DidDocument = factory.build({
entries: {
'@context': 'https://www.w3.org/ns/did/v1',
id: 'did:example:123',
},
});
const representation: Buffer = await didDocument
.addRepresentation({ 'application/did+ld+json': representation })
.produce('application/did+ld+json');
```
## Usage with JOSE
```ts
import { factory, DidDocument } from '@did-core/data-model';
import { representation } from '@did-core/did-json';
const didDocument: DidDocument = factory.build({
entries: {
// @context is required for use with jsonld verifiable credentials
// but technically optional here
'@context': 'https://www.w3.org/ns/did/v1',
id: 'did:example:123',
},
});
const representation: Buffer = await didDocument
.addRepresentation({ 'application/did+json': representation })
.produce('application/did+json');
```
## Usage with IPLD
```ts
import { factory, DidDocument } from '@did-core/data-model';
import { representation } from '@did-core/did-dag-cbor';
const didDocument: DidDocument = factory.build({
entries: {
// @context is required for use with jsonld verifiable credentials
// but technically optional here
'@context': 'https://www.w3.org/ns/did/v1',
id: 'did:example:123',
},
});
const representation: Buffer = await didDocument
.addRepresentation({ 'application/did+dag+cbor': representation })
.produce('application/did+dag+cbor');
```
### DID Test Suite
This module is used to produce test fixtures for the did core test suite.
The DID Method implementations used for these tests are hosted in the following repos:
- [did:elem](https://github.com/transmute-industries/sidetree.js)
- [did:photon](https://github.com/transmute-industries/sidetree.js)
- [did:key](https://github.com/transmute-industries/did-key.js)
- [did:web](https://github.com/transmute-industries/verifable-data)