Skip to content

Commit

Permalink
fix(doc): update LD @context (#154)
Browse files Browse the repository at this point in the history
fixes #151

BREAKING CHANGE: Since the context definitions most often have to be embedded in apps, this requires apps to download the new definition.
  • Loading branch information
About7Sharks authored and mirceanis committed Jun 5, 2022
1 parent c9583c7 commit 51cb92a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ the registry looks like this:
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a",
"verificationMethod": [
Expand Down
6 changes: 3 additions & 3 deletions doc/did-method-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ To enable JSON-LD processing, the `@context` used when constructing DID document
```javascript
"@context": [
"https://www.w3.org/ns/did/v1",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
]
```

Expand Down Expand Up @@ -149,7 +149,7 @@ The default DID document for an `did:ethr<Ethereum address>` on mainnet, e.g.
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a",
"verificationMethod": [
Expand All @@ -172,7 +172,7 @@ looks like this:
{
"@context": [
"https://www.w3.org/ns/did/v1",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "did:ethr:0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"verificationMethod": [
Expand Down
16 changes: 8 additions & 8 deletions src/__tests__/networks.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: 'did:ethr:0x26bf14321004e770e7a8b080b7a526d8eed8b388',
verificationMethod: [
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -142,7 +142,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('ethrResolver (alt-chains)', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down
16 changes: 8 additions & 8 deletions src/__tests__/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand All @@ -81,7 +81,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: pubdid,
verificationMethod: [
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand All @@ -142,7 +142,7 @@ describe('ethrResolver', () => {
expect(didDocument).toEqual({
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: pubdid,
verificationMethod: [
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: did,
verificationMethod: [
Expand Down Expand Up @@ -891,7 +891,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: virginDID,
verificationMethod: [
Expand Down Expand Up @@ -923,7 +923,7 @@ describe('ethrResolver', () => {
didDocument: {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
],
id: deactivatedDid,
verificationMethod: [
Expand Down
5 changes: 1 addition & 4 deletions src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ export class EthrDidResolver {
now: BigNumber
): { didDocument: DIDDocument; deactivated: boolean; versionId: number; nextVersionId: number } {
const baseDIDDocument: DIDDocument = {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld',
],
'@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/secp256k1recovery-2020/v2'],
id: did,
verificationMethod: [],
authentication: [],
Expand Down

0 comments on commit 51cb92a

Please sign in to comment.