From 48fbee3e62eab3df4225ae0bdb3a92f5665eb171 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Thu, 2 Jun 2022 15:27:48 +0200 Subject: [PATCH] fix(credential-ld): fix EcdsaSecp256k1RecoverySignature2020 suite context (#909) --- .vscode/launch.json | 10 +- __tests__/shared/verifiableDataLD.ts | 2 +- jest.config.json | 4 +- package.json | 4 +- .../lds-ecdsa-secp256k1-recovery2020-0.0.json | 60 -- packages/credential-ld/package.json | 4 +- .../src/__tests__/issue-verify-flow.test.ts | 109 ++- .../{ => src}/contexts/did_v0.11.json | 0 .../contexts/ed25519-signature-2018-v1.json | 0 .../{ => src}/contexts/kyc-v1.json | 0 .../lds-ecdsa-secp256k1-recovery2020-0.0.json | 21 + .../{ => src}/contexts/socialmedia-v1.json | 0 .../{ => src}/contexts/transmute_v1.json | 0 .../veramo.io_contexts_profile_v1.json} | 0 ....org_security_suites_ed25519-2018_v1.json} | 61 +- ...ity_suites_secp256k1recovery-2020_v2.json} | 22 +- ...d.org_security_suites_x25519-2019_v1.json} | 0 .../src/contexts/w3id.org_security_v1.json | 50 ++ .../src/contexts/w3id.org_security_v2.json | 59 ++ .../w3id.org_security_v3-unstable.json | 720 ++++++++++++++++++ .../www.w3.org_2018_credentials_v1.json} | 0 .../contexts/www.w3.org_ns_did_v1.json} | 0 .../credential-ld/src/ld-credential-module.ts | 2 +- .../credential-ld/src/ld-default-contexts.ts | 33 +- packages/credential-ld/src/ld-suites.ts | 2 +- .../EcdsaSecp256k1RecoverySignature2020.ts | 27 +- .../credential-ld/types/jsonld/index.d.ts | 2 +- .../contexts/X25519KeyAgreementKey2019.jsonld | 26 - .../credential-w3c/contexts/kyc-v1.jsonld | 8 - ...ds-ecdsa-secp256k1-recovery2020-0.0.jsonld | 60 -- .../credential-w3c/contexts/profile-v1.jsonld | 8 - .../contexts/security_context_v1.jsonld | 58 -- .../contexts/socialmedia-v1.jsonld | 7 - .../contexts/transmute_v1.jsonld | 21 - .../src/__tests__/integration.test.ts | 2 + packages/remote-client/package.json | 7 +- packages/tsconfig.settings.json | 8 +- packages/url-handler/package.json | 7 +- yarn.lock | 229 ++---- 39 files changed, 1107 insertions(+), 526 deletions(-) delete mode 100644 packages/credential-ld/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json rename packages/credential-ld/{ => src}/contexts/did_v0.11.json (100%) rename packages/credential-ld/{ => src}/contexts/ed25519-signature-2018-v1.json (100%) rename packages/credential-ld/{ => src}/contexts/kyc-v1.json (100%) create mode 100644 packages/credential-ld/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json rename packages/credential-ld/{ => src}/contexts/socialmedia-v1.json (100%) rename packages/credential-ld/{ => src}/contexts/transmute_v1.json (100%) rename packages/credential-ld/{contexts/profile-v1.json => src/contexts/veramo.io_contexts_profile_v1.json} (100%) rename packages/{credential-w3c/contexts/did_v0.11.jsonld => credential-ld/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json} (54%) rename packages/{credential-w3c/contexts/ed25519-signature-2018-v1.jsonld => credential-ld/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json} (80%) rename packages/credential-ld/{contexts/X25519KeyAgreementKey2019.json => src/contexts/w3id.org_security_suites_x25519-2019_v1.json} (100%) create mode 100644 packages/credential-ld/src/contexts/w3id.org_security_v1.json create mode 100644 packages/credential-ld/src/contexts/w3id.org_security_v2.json create mode 100644 packages/credential-ld/src/contexts/w3id.org_security_v3-unstable.json rename packages/credential-ld/{contexts/w3_2018_credentials_v1.json => src/contexts/www.w3.org_2018_credentials_v1.json} (100%) rename packages/credential-ld/{contexts/security_context_v1.json => src/contexts/www.w3.org_ns_did_v1.json} (100%) delete mode 100644 packages/credential-w3c/contexts/X25519KeyAgreementKey2019.jsonld delete mode 100644 packages/credential-w3c/contexts/kyc-v1.jsonld delete mode 100644 packages/credential-w3c/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld delete mode 100644 packages/credential-w3c/contexts/profile-v1.jsonld delete mode 100644 packages/credential-w3c/contexts/security_context_v1.jsonld delete mode 100644 packages/credential-w3c/contexts/socialmedia-v1.jsonld delete mode 100644 packages/credential-w3c/contexts/transmute_v1.jsonld diff --git a/.vscode/launch.json b/.vscode/launch.json index cbe19839b..afb707721 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,7 @@ { "version": "0.2.0", "configurations": [ + { "type": "node", "request": "launch", @@ -134,9 +135,9 @@ "program": "${workspaceFolder}/node_modules/.bin/jest", "args": [ "--runInBand", - "--coverage=false", - "--config=jest.json" + "--config=jest.config.json" ], + "runtimeArgs": ["--preserve-symlinks"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "disableOptimisticBPs": true, @@ -158,9 +159,10 @@ "${relativeFile}", "--detectOpenHandles", "--runInBand", - "--coverage=false", - "--config=jest.json" + "--config=jest.config.json" ], + "enableContentValidation": false, + "runtimeArgs": ["--preserve-symlinks"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "windows": { diff --git a/__tests__/shared/verifiableDataLD.ts b/__tests__/shared/verifiableDataLD.ts index 2bd2ad159..f80b3327e 100644 --- a/__tests__/shared/verifiableDataLD.ts +++ b/__tests__/shared/verifiableDataLD.ts @@ -48,7 +48,7 @@ export default (testContext: { expect(verifiableCredential['@context']).toEqual([ 'https://www.w3.org/2018/credentials/v1', 'https://veramo.io/contexts/profile/v1', - 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', + 'https://w3id.org/security/suites/secp256k1recovery-2020/v2', ]) expect(verifiableCredential['type']).toEqual(['VerifiableCredential', 'Profile']) diff --git a/jest.config.json b/jest.config.json index 0dec51d95..a5f83bf27 100644 --- a/jest.config.json +++ b/jest.config.json @@ -1,6 +1,6 @@ { - "moduleFileExtensions": ["ts", "tsx", "js", "jsx"], - "collectCoverage": true, + "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "jsonld"], + "collectCoverage": false, "collectCoverageFrom": [ "packages/**/src/**/*.ts", "!**/examples/**", diff --git a/package.json b/package.json index 0d0c8ed18..c63bd8f52 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "test:integration-prepare": "ts-node --project packages/tsconfig.settings.json ./scripts/prepare-integration-tests.ts", "test:integration-pretty": "prettier --write __tests__/shared/documentationExamples.ts", "test:integration": "yarn test:integration-build && yarn test:ci", - "test:ci": "jest --config=jest.config.json", - "test": "jest --config=jest.config.json --coverage=false", + "test:ci": "jest --config=jest.config.json --runInBand --coverage=true", + "test": "jest --config=jest.config.json", "test:watch": "yarn test --watch --verbose", "test:browser": "bash scripts/prepare-react-test.sh && cd ./__browser_tests__/react-sample && yarn install && yarn test:browser-integration", "veramo": "./packages/cli/bin/veramo.js", diff --git a/packages/credential-ld/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json b/packages/credential-ld/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json deleted file mode 100644 index c79835e3c..000000000 --- a/packages/credential-ld/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "id": "@id", - "type": "@type", - "esrs2020": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#", - - "EcdsaSecp256k1RecoverySignature2020": { - "@id": "https://w3id.org/security#EcdsaSecp256k1RecoverySignature2020", - "@context": { - "@version": 1.1, - "@protected": true, - - "id": "@id", - "type": "@type", - - "sec": "https://w3id.org/security#", - "xsd": "http://www.w3.org/2001/XMLSchema#", - - "challenge": "sec:challenge", - "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"}, - "domain": "sec:domain", - "expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"}, - "jws": "sec:jws", - "nonce": "sec:nonce", - "proofPurpose": { - "@id": "sec:proofPurpose", - "@type": "@vocab", - "@context": { - "@version": 1.1, - "@protected": true, - - "id": "@id", - "type": "@type", - - "sec": "https://w3id.org/security#", - - "assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"}, - "authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"} - } - }, - "proofValue": "sec:proofValue", - "verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"} - } - }, - - "EcdsaSecp256k1RecoveryMethod2020": "esrs2020:EcdsaSecp256k1RecoveryMethod2020", - "publicKeyJwk": { - "@id": "esrs2020:publicKeyJwk", - "@type": "@json" - }, - "privateKeyJwk": { - "@id": "esrs2020:privateKeyJwk", - "@type": "@json" - }, - "publicKeyHex": "esrs2020:publicKeyHex", - "privateKeyHex": "esrs2020:privateKeyHex", - "ethereumAddress": "esrs2020:ethereumAddress" - } -} diff --git a/packages/credential-ld/package.json b/packages/credential-ld/package.json index 7ee7279ba..1432f5022 100644 --- a/packages/credential-ld/package.json +++ b/packages/credential-ld/package.json @@ -16,7 +16,7 @@ "dependencies": { "@transmute/credentials-context": "^0.7.0-unstable.34", "@transmute/ed25519-signature-2018": "^0.7.0-unstable.34", - "@transmute/lds-ecdsa-secp256k1-recovery2020": "^0.0.7", + "@transmute/lds-ecdsa-secp256k1-recovery2020": "decentralized-identity/EcdsaSecp256k1RecoverySignature2020", "@veramo/core": "^3.1.0", "@veramo/did-resolver": "^3.1.0", "@veramo/utils": "^3.1.0", @@ -25,7 +25,7 @@ "jsonld": "^5.2.0", "jsonld-signatures": "^9.3.1", "uint8arrays": "^3.0.0", - "vc-js": "^0.6.4" + "@digitalbazaar/vc": "^2.1.0" }, "devDependencies": { "@types/debug": "4.1.7", diff --git a/packages/credential-ld/src/__tests__/issue-verify-flow.test.ts b/packages/credential-ld/src/__tests__/issue-verify-flow.test.ts index 3036a1b08..b3e3c1354 100644 --- a/packages/credential-ld/src/__tests__/issue-verify-flow.test.ts +++ b/packages/credential-ld/src/__tests__/issue-verify-flow.test.ts @@ -13,11 +13,16 @@ import { KeyManager, MemoryKeyStore, MemoryPrivateKeyStore } from '../../../key- import { KeyManagementSystem } from '../../../kms-local/src' import { getDidKeyResolver, KeyDIDProvider } from '../../../did-provider-key/src' import { DIDResolverPlugin } from '../../../did-resolver/src' +import { EthrDIDProvider } from "../../../did-provider-ethr/src"; import { ContextDoc } from '../types' import { CredentialIssuerLD } from '../action-handler' import { LdDefaultContexts } from '../ld-default-contexts' import { VeramoEd25519Signature2018 } from '../suites/Ed25519Signature2018' import { Resolver } from 'did-resolver' +import { getResolver as ethrDidResolver } from 'ethr-did-resolver' +import { VeramoEcdsaSecp256k1RecoverySignature2020 } from "../suites/EcdsaSecp256k1RecoverySignature2020"; + +jest.setTimeout(300000) const customContext: Record = { 'custom:example.context': { @@ -27,8 +32,11 @@ const customContext: Record = { }, } +const infuraProjectId = '3586660d179141e3801c3895de1c2eba' + describe('credential-LD full flow', () => { let didKeyIdentifier: IIdentifier + let didEthrIdentifier: IIdentifier let agent: TAgent beforeAll(async () => { @@ -43,24 +51,32 @@ describe('credential-LD full flow', () => { new DIDManager({ providers: { 'did:key': new KeyDIDProvider({ defaultKms: 'local' }), + 'did:ethr:goerli': new EthrDIDProvider({ + defaultKms: 'local', + network: 'goerli', + }), }, store: new MemoryDIDStore(), defaultProvider: 'did:key', }), new DIDResolverPlugin({ - resolver: new Resolver({ ...getDidKeyResolver() }), + resolver: new Resolver({ + ...getDidKeyResolver(), + ...ethrDidResolver({ infuraProjectId, }), + }), }), new CredentialIssuer(), new CredentialIssuerLD({ contextMaps: [LdDefaultContexts, customContext], - suites: [new VeramoEd25519Signature2018()], + suites: [new VeramoEd25519Signature2018(), new VeramoEcdsaSecp256k1RecoverySignature2020()], }), ], }) didKeyIdentifier = await agent.didManagerCreate() + didEthrIdentifier = await agent.didManagerCreate({ provider: "did:ethr:goerli" }) }) - it('works with Ed25519Signature2018', async () => { + it('works with Ed25519Signature2018 credential', async () => { const credential: CredentialPayload = { issuer: didKeyIdentifier.did, '@context': ['custom:example.context'], @@ -81,4 +97,91 @@ describe('credential-LD full flow', () => { expect(verified).toBe(true) }) + + it.only('works with EcdsaSecp256k1RecoveryMethod2020 credentials', async () => { + const credential: CredentialPayload = { + issuer: didEthrIdentifier.did, + '@context': ['custom:example.context'], + credentialSubject: { + nothing: 'else matters', + }, + } + const verifiableCredential = await agent.createVerifiableCredential({ + credential, + proofFormat: 'lds', + }) + + expect(verifiableCredential).toBeDefined() + + const verified = await agent.verifyCredential({ + credential: verifiableCredential, + }) + + expect(verified).toBe(true) + }) + + it('works with Ed25519Signature2018 credential and presentation', async () => { + const credential: CredentialPayload = { + issuer: didKeyIdentifier.did, + '@context': ['custom:example.context'], + credentialSubject: { + nothing: 'else matters', + }, + } + const verifiableCredential1 = await agent.createVerifiableCredential({ + credential, + proofFormat: 'lds', + }) + + const verifiablePresentation = await agent.createVerifiablePresentation({ + presentation: { + verifiableCredential: [verifiableCredential1], + holder: didKeyIdentifier.did + }, + proofFormat: 'lds', + }) + + expect(verifiablePresentation).toBeDefined() + + const verified = await agent.verifyPresentation({ + presentation: verifiablePresentation, + challenge: "VERAMO", + }) + + expect(verified).toBe(true) + }) + + it('works with EcdsaSecp256k1RecoveryMethod2020 credential and presentation', async () => { + const credential: CredentialPayload = { + issuer: { id: didEthrIdentifier.did }, + '@context': ['https://www.w3.org/2018/credentials/v1', 'https://veramo.io/contexts/profile/v1'], + type: ['VerifiableCredential', 'Profile'], + issuanceDate: new Date().toISOString(), + credentialSubject: { + id: didKeyIdentifier.did, + name: 'Martin, the great', + }, + } + const verifiableCredential1 = await agent.createVerifiableCredential({ + credential, + proofFormat: 'lds', + }) + + const verifiablePresentation = await agent.createVerifiablePresentation({ + presentation: { + verifiableCredential: [verifiableCredential1], + holder: didEthrIdentifier.did + }, + proofFormat: 'lds', + }) + + expect(verifiablePresentation).toBeDefined() + + const verified = await agent.verifyPresentation({ + presentation: verifiablePresentation, + challenge: "VERAMO", + }) + + expect(verified).toBe(true) + }) }) diff --git a/packages/credential-ld/contexts/did_v0.11.json b/packages/credential-ld/src/contexts/did_v0.11.json similarity index 100% rename from packages/credential-ld/contexts/did_v0.11.json rename to packages/credential-ld/src/contexts/did_v0.11.json diff --git a/packages/credential-ld/contexts/ed25519-signature-2018-v1.json b/packages/credential-ld/src/contexts/ed25519-signature-2018-v1.json similarity index 100% rename from packages/credential-ld/contexts/ed25519-signature-2018-v1.json rename to packages/credential-ld/src/contexts/ed25519-signature-2018-v1.json diff --git a/packages/credential-ld/contexts/kyc-v1.json b/packages/credential-ld/src/contexts/kyc-v1.json similarity index 100% rename from packages/credential-ld/contexts/kyc-v1.json rename to packages/credential-ld/src/contexts/kyc-v1.json diff --git a/packages/credential-ld/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json b/packages/credential-ld/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json new file mode 100644 index 000000000..2da92bda4 --- /dev/null +++ b/packages/credential-ld/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json @@ -0,0 +1,21 @@ +{ + "@context": { + "@version": 1.1, + "id": "@id", + "type": "@type", + "esrs2020": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#", + "EcdsaSecp256k1RecoverySignature2020": "esrs2020:EcdsaSecp256k1RecoverySignature2020", + "EcdsaSecp256k1RecoveryMethod2020": "esrs2020:EcdsaSecp256k1RecoveryMethod2020", + "publicKeyJwk": { + "@id": "esrs2020:publicKeyJwk", + "@type": "@json" + }, + "privateKeyJwk": { + "@id": "esrs2020:privateKeyJwk", + "@type": "@json" + }, + "publicKeyHex": "esrs2020:publicKeyHex", + "privateKeyHex": "esrs2020:privateKeyHex", + "ethereumAddress": "esrs2020:ethereumAddress" + } +} diff --git a/packages/credential-ld/contexts/socialmedia-v1.json b/packages/credential-ld/src/contexts/socialmedia-v1.json similarity index 100% rename from packages/credential-ld/contexts/socialmedia-v1.json rename to packages/credential-ld/src/contexts/socialmedia-v1.json diff --git a/packages/credential-ld/contexts/transmute_v1.json b/packages/credential-ld/src/contexts/transmute_v1.json similarity index 100% rename from packages/credential-ld/contexts/transmute_v1.json rename to packages/credential-ld/src/contexts/transmute_v1.json diff --git a/packages/credential-ld/contexts/profile-v1.json b/packages/credential-ld/src/contexts/veramo.io_contexts_profile_v1.json similarity index 100% rename from packages/credential-ld/contexts/profile-v1.json rename to packages/credential-ld/src/contexts/veramo.io_contexts_profile_v1.json diff --git a/packages/credential-w3c/contexts/did_v0.11.jsonld b/packages/credential-ld/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json similarity index 54% rename from packages/credential-w3c/contexts/did_v0.11.jsonld rename to packages/credential-ld/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json index 646c00be2..5f43a0c73 100644 --- a/packages/credential-w3c/contexts/did_v0.11.jsonld +++ b/packages/credential-ld/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json @@ -1,24 +1,29 @@ { - "@context": { - "@version": 1.1, - "id": "@id", - "type": "@type", - - "dc": "http://purl.org/dc/terms/", - "schema": "http://schema.org/", - "sec": "https://w3id.org/security#", - "didv": "https://w3id.org/did#", - "xsd": "http://www.w3.org/2001/XMLSchema#", - + "@context": [{ + "@version": 1.1 + }, "https://w3id.org/security/v1", { + "AesKeyWrappingKey2019": "sec:AesKeyWrappingKey2019", + "DeleteKeyOperation": "sec:DeleteKeyOperation", + "DeriveSecretOperation": "sec:DeriveSecretOperation", "EcdsaSecp256k1Signature2019": "sec:EcdsaSecp256k1Signature2019", + "EcdsaSecp256r1Signature2019": "sec:EcdsaSecp256r1Signature2019", "EcdsaSecp256k1VerificationKey2019": "sec:EcdsaSecp256k1VerificationKey2019", + "EcdsaSecp256r1VerificationKey2019": "sec:EcdsaSecp256r1VerificationKey2019", "Ed25519Signature2018": "sec:Ed25519Signature2018", "Ed25519VerificationKey2018": "sec:Ed25519VerificationKey2018", + "EquihashProof2018": "sec:EquihashProof2018", + "ExportKeyOperation": "sec:ExportKeyOperation", + "GenerateKeyOperation": "sec:GenerateKeyOperation", + "KmsOperation": "sec:KmsOperation", + "RevokeKeyOperation": "sec:RevokeKeyOperation", "RsaSignature2018": "sec:RsaSignature2018", "RsaVerificationKey2018": "sec:RsaVerificationKey2018", - "SchnorrSecp256k1Signature2019": "sec:SchnorrSecp256k1Signature2019", - "SchnorrSecp256k1VerificationKey2019": "sec:SchnorrSecp256k1VerificationKey2019", - "ServiceEndpointProxyService": "didv:ServiceEndpointProxyService", + "Sha256HmacKey2019": "sec:Sha256HmacKey2019", + "SignOperation": "sec:SignOperation", + "UnwrapKeyOperation": "sec:UnwrapKeyOperation", + "VerifyOperation": "sec:VerifyOperation", + "WrapKeyOperation": "sec:WrapKeyOperation", + "X25519KeyAgreementKey2019": "sec:X25519KeyAgreementKey2019", "allowedAction": "sec:allowedAction", "assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"}, @@ -28,31 +33,27 @@ "capabilityChain": {"@id": "sec:capabilityChain", "@type": "@id", "@container": "@list"}, "capabilityDelegation": {"@id": "sec:capabilityDelegationMethod", "@type": "@id", "@container": "@set"}, "capabilityInvocation": {"@id": "sec:capabilityInvocationMethod", "@type": "@id", "@container": "@set"}, - "capabilityStatusList": {"@id": "sec:capabilityStatusList", "@type": "@id"}, - "canonicalizationAlgorithm": "sec:canonicalizationAlgorithm", "caveat": {"@id": "sec:caveat", "@type": "@id", "@container": "@set"}, "challenge": "sec:challenge", + "ciphertext": "sec:ciphertext", "controller": {"@id": "sec:controller", "@type": "@id"}, - "created": {"@id": "dc:created", "@type": "xsd:dateTime"}, - "creator": {"@id": "dc:creator", "@type": "@id"}, "delegator": {"@id": "sec:delegator", "@type": "@id"}, - "domain": "sec:domain", - "expirationDate": {"@id": "sec:expiration", "@type": "xsd:dateTime"}, + "equihashParameterK": {"@id": "sec:equihashParameterK", "@type": "xsd:integer"}, + "equihashParameterN": {"@id": "sec:equihashParameterN", "@type": "xsd:integer"}, "invocationTarget": {"@id": "sec:invocationTarget", "@type": "@id"}, "invoker": {"@id": "sec:invoker", "@type": "@id"}, "jws": "sec:jws", "keyAgreement": {"@id": "sec:keyAgreementMethod", "@type": "@id", "@container": "@set"}, - "nonce": "sec:nonce", - "owner": {"@id": "sec:owner", "@type": "@id"}, + "kmsModule": {"@id": "sec:kmsModule"}, + "parentCapability": {"@id": "sec:parentCapability", "@type": "@id"}, + "plaintext": "sec:plaintext", "proof": {"@id": "sec:proof", "@type": "@id", "@container": "@graph"}, "proofPurpose": {"@id": "sec:proofPurpose", "@type": "@vocab"}, "proofValue": "sec:proofValue", - "publicKey": {"@id": "sec:publicKey", "@type": "@id", "@container": "@set"}, - "publicKeyBase58": "sec:publicKeyBase58", - "publicKeyPem": "sec:publicKeyPem", - "revoked": {"@id": "sec:revoked", "@type": "xsd:dateTime"}, - "service": {"@id": "didv:service", "@type": "@id", "@container": "@set"}, - "serviceEndpoint": {"@id": "didv:serviceEndpoint", "@type": "@id"}, - "verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"} - } + "referenceId": "sec:referenceId", + "unwrappedKey": "sec:unwrappedKey", + "verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}, + "verifyData": "sec:verifyData", + "wrappedKey": "sec:wrappedKey" + }] } diff --git a/packages/credential-w3c/contexts/ed25519-signature-2018-v1.jsonld b/packages/credential-ld/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json similarity index 80% rename from packages/credential-w3c/contexts/ed25519-signature-2018-v1.jsonld rename to packages/credential-ld/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json index 6533c287e..932a38f64 100644 --- a/packages/credential-w3c/contexts/ed25519-signature-2018-v1.jsonld +++ b/packages/credential-ld/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json @@ -8,8 +8,8 @@ "@type": "@id", "@container": "@graph" }, - "Ed25519VerificationKey2018": { - "@id": "https://w3id.org/security#Ed25519VerificationKey2018", + "EcdsaSecp256k1RecoveryMethod2020": { + "@id": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoveryMethod2020", "@context": { "@protected": true, "id": "@id", @@ -18,17 +18,15 @@ "@id": "https://w3id.org/security#controller", "@type": "@id" }, - "revoked": { - "@id": "https://w3id.org/security#revoked", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "publicKeyBase58": { - "@id": "https://w3id.org/security#publicKeyBase58" + "blockchainAccountId": "https://w3id.org/security#blockchainAccountId", + "publicKeyJwk": { + "@id": "https://w3id.org/security#publicKeyJwk", + "@type": "@json" } } }, - "Ed25519Signature2018": { - "@id": "https://w3id.org/security#Ed25519Signature2018", + "EcdsaSecp256k1RecoverySignature2020": { + "@id": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#EcdsaSecp256k1RecoverySignature2020", "@context": { "@protected": true, "id": "@id", @@ -43,6 +41,7 @@ "@id": "https://w3id.org/security#expiration", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" }, + "jws": "https://w3id.org/security#jws", "nonce": "https://w3id.org/security#nonce", "proofPurpose": { "@id": "https://w3id.org/security#proofPurpose", @@ -78,9 +77,6 @@ } } }, - "jws": { - "@id": "https://w3id.org/security#jws" - }, "verificationMethod": { "@id": "https://w3id.org/security#verificationMethod", "@type": "@id" diff --git a/packages/credential-ld/contexts/X25519KeyAgreementKey2019.json b/packages/credential-ld/src/contexts/w3id.org_security_suites_x25519-2019_v1.json similarity index 100% rename from packages/credential-ld/contexts/X25519KeyAgreementKey2019.json rename to packages/credential-ld/src/contexts/w3id.org_security_suites_x25519-2019_v1.json diff --git a/packages/credential-ld/src/contexts/w3id.org_security_v1.json b/packages/credential-ld/src/contexts/w3id.org_security_v1.json new file mode 100644 index 000000000..752950526 --- /dev/null +++ b/packages/credential-ld/src/contexts/w3id.org_security_v1.json @@ -0,0 +1,50 @@ +{ + "@context": { + "id": "@id", + "type": "@type", + + "dc": "http://purl.org/dc/terms/", + "sec": "https://w3id.org/security#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + + "EcdsaKoblitzSignature2016": "sec:EcdsaKoblitzSignature2016", + "Ed25519Signature2018": "sec:Ed25519Signature2018", + "EncryptedMessage": "sec:EncryptedMessage", + "GraphSignature2012": "sec:GraphSignature2012", + "LinkedDataSignature2015": "sec:LinkedDataSignature2015", + "LinkedDataSignature2016": "sec:LinkedDataSignature2016", + "CryptographicKey": "sec:Key", + + "authenticationTag": "sec:authenticationTag", + "canonicalizationAlgorithm": "sec:canonicalizationAlgorithm", + "cipherAlgorithm": "sec:cipherAlgorithm", + "cipherData": "sec:cipherData", + "cipherKey": "sec:cipherKey", + "created": {"@id": "dc:created", "@type": "xsd:dateTime"}, + "creator": {"@id": "dc:creator", "@type": "@id"}, + "digestAlgorithm": "sec:digestAlgorithm", + "digestValue": "sec:digestValue", + "domain": "sec:domain", + "encryptionKey": "sec:encryptionKey", + "expiration": {"@id": "sec:expiration", "@type": "xsd:dateTime"}, + "expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"}, + "initializationVector": "sec:initializationVector", + "iterationCount": "sec:iterationCount", + "nonce": "sec:nonce", + "normalizationAlgorithm": "sec:normalizationAlgorithm", + "owner": {"@id": "sec:owner", "@type": "@id"}, + "password": "sec:password", + "privateKey": {"@id": "sec:privateKey", "@type": "@id"}, + "privateKeyPem": "sec:privateKeyPem", + "publicKey": {"@id": "sec:publicKey", "@type": "@id"}, + "publicKeyBase58": "sec:publicKeyBase58", + "publicKeyPem": "sec:publicKeyPem", + "publicKeyWif": "sec:publicKeyWif", + "publicKeyService": {"@id": "sec:publicKeyService", "@type": "@id"}, + "revoked": {"@id": "sec:revoked", "@type": "xsd:dateTime"}, + "salt": "sec:salt", + "signature": "sec:signature", + "signatureAlgorithm": "sec:signingAlgorithm", + "signatureValue": "sec:signatureValue" + } +} diff --git a/packages/credential-ld/src/contexts/w3id.org_security_v2.json b/packages/credential-ld/src/contexts/w3id.org_security_v2.json new file mode 100644 index 000000000..5f43a0c73 --- /dev/null +++ b/packages/credential-ld/src/contexts/w3id.org_security_v2.json @@ -0,0 +1,59 @@ +{ + "@context": [{ + "@version": 1.1 + }, "https://w3id.org/security/v1", { + "AesKeyWrappingKey2019": "sec:AesKeyWrappingKey2019", + "DeleteKeyOperation": "sec:DeleteKeyOperation", + "DeriveSecretOperation": "sec:DeriveSecretOperation", + "EcdsaSecp256k1Signature2019": "sec:EcdsaSecp256k1Signature2019", + "EcdsaSecp256r1Signature2019": "sec:EcdsaSecp256r1Signature2019", + "EcdsaSecp256k1VerificationKey2019": "sec:EcdsaSecp256k1VerificationKey2019", + "EcdsaSecp256r1VerificationKey2019": "sec:EcdsaSecp256r1VerificationKey2019", + "Ed25519Signature2018": "sec:Ed25519Signature2018", + "Ed25519VerificationKey2018": "sec:Ed25519VerificationKey2018", + "EquihashProof2018": "sec:EquihashProof2018", + "ExportKeyOperation": "sec:ExportKeyOperation", + "GenerateKeyOperation": "sec:GenerateKeyOperation", + "KmsOperation": "sec:KmsOperation", + "RevokeKeyOperation": "sec:RevokeKeyOperation", + "RsaSignature2018": "sec:RsaSignature2018", + "RsaVerificationKey2018": "sec:RsaVerificationKey2018", + "Sha256HmacKey2019": "sec:Sha256HmacKey2019", + "SignOperation": "sec:SignOperation", + "UnwrapKeyOperation": "sec:UnwrapKeyOperation", + "VerifyOperation": "sec:VerifyOperation", + "WrapKeyOperation": "sec:WrapKeyOperation", + "X25519KeyAgreementKey2019": "sec:X25519KeyAgreementKey2019", + + "allowedAction": "sec:allowedAction", + "assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"}, + "authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"}, + "capability": {"@id": "sec:capability", "@type": "@id"}, + "capabilityAction": "sec:capabilityAction", + "capabilityChain": {"@id": "sec:capabilityChain", "@type": "@id", "@container": "@list"}, + "capabilityDelegation": {"@id": "sec:capabilityDelegationMethod", "@type": "@id", "@container": "@set"}, + "capabilityInvocation": {"@id": "sec:capabilityInvocationMethod", "@type": "@id", "@container": "@set"}, + "caveat": {"@id": "sec:caveat", "@type": "@id", "@container": "@set"}, + "challenge": "sec:challenge", + "ciphertext": "sec:ciphertext", + "controller": {"@id": "sec:controller", "@type": "@id"}, + "delegator": {"@id": "sec:delegator", "@type": "@id"}, + "equihashParameterK": {"@id": "sec:equihashParameterK", "@type": "xsd:integer"}, + "equihashParameterN": {"@id": "sec:equihashParameterN", "@type": "xsd:integer"}, + "invocationTarget": {"@id": "sec:invocationTarget", "@type": "@id"}, + "invoker": {"@id": "sec:invoker", "@type": "@id"}, + "jws": "sec:jws", + "keyAgreement": {"@id": "sec:keyAgreementMethod", "@type": "@id", "@container": "@set"}, + "kmsModule": {"@id": "sec:kmsModule"}, + "parentCapability": {"@id": "sec:parentCapability", "@type": "@id"}, + "plaintext": "sec:plaintext", + "proof": {"@id": "sec:proof", "@type": "@id", "@container": "@graph"}, + "proofPurpose": {"@id": "sec:proofPurpose", "@type": "@vocab"}, + "proofValue": "sec:proofValue", + "referenceId": "sec:referenceId", + "unwrappedKey": "sec:unwrappedKey", + "verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"}, + "verifyData": "sec:verifyData", + "wrappedKey": "sec:wrappedKey" + }] +} diff --git a/packages/credential-ld/src/contexts/w3id.org_security_v3-unstable.json b/packages/credential-ld/src/contexts/w3id.org_security_v3-unstable.json new file mode 100644 index 000000000..647dc9089 --- /dev/null +++ b/packages/credential-ld/src/contexts/w3id.org_security_v3-unstable.json @@ -0,0 +1,720 @@ +{ + "@context": [{ + "@version": 1.1, + "id": "@id", + "type": "@type", + "@protected": true, + "JsonWebKey2020": { + "@id": "https://w3id.org/security#JsonWebKey2020" + }, + "JsonWebSignature2020": { + "@id": "https://w3id.org/security#JsonWebSignature2020", + "@context": { + "@version": 1.1, + "id": "@id", + "type": "@type", + "@protected": true, + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "jws": "https://w3id.org/security#jws", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "Ed25519VerificationKey2020": { + "@id": "https://w3id.org/security#Ed25519VerificationKey2020" + }, + "Ed25519Signature2020": { + "@id": "https://w3id.org/security#Ed25519Signature2020", + "@context": { + "@protected": true, + "id": "@id", + "type": "@type", + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": { + "@id": "https://w3id.org/security#proofValue", + "@type": "https://w3id.org/security#multibase" + }, + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "publicKeyJwk": { + "@id": "https://w3id.org/security#publicKeyJwk", + "@type": "@json" + }, + "ethereumAddress": { + "@id": "https://w3id.org/security#ethereumAddress" + }, + "publicKeyHex": { + "@id": "https://w3id.org/security#publicKeyHex" + }, + "blockchainAccountId": { + "@id": "https://w3id.org/security#blockchainAccountId" + }, + "MerkleProof2019": { + "@id": "https://w3id.org/security#MerkleProof2019" + }, + "Bls12381G1Key2020": { + "@id": "https://w3id.org/security#Bls12381G1Key2020" + }, + "Bls12381G2Key2020": { + "@id": "https://w3id.org/security#Bls12381G2Key2020" + }, + "BbsBlsSignature2020": { + "@id": "https://w3id.org/security#BbsBlsSignature2020", + "@context": { + "@protected": true, + "id": "@id", + "type": "@type", + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "BbsBlsSignatureProof2020": { + "@id": "https://w3id.org/security#BbsBlsSignatureProof2020", + "@context": { + "@protected": true, + "id": "@id", + "type": "@type", + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + + "EcdsaKoblitzSignature2016": "https://w3id.org/security#EcdsaKoblitzSignature2016", + "Ed25519Signature2018": { + "@id": "https://w3id.org/security#Ed25519Signature2018", + "@context": { + "@protected": true, + + "id": "@id", + "type": "@type", + + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "jws": "https://w3id.org/security#jws", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "EncryptedMessage": "https://w3id.org/security#EncryptedMessage", + "GraphSignature2012": "https://w3id.org/security#GraphSignature2012", + "LinkedDataSignature2015": "https://w3id.org/security#LinkedDataSignature2015", + "LinkedDataSignature2016": "https://w3id.org/security#LinkedDataSignature2016", + "CryptographicKey": "https://w3id.org/security#Key", + "authenticationTag": "https://w3id.org/security#authenticationTag", + "canonicalizationAlgorithm": "https://w3id.org/security#canonicalizationAlgorithm", + "cipherAlgorithm": "https://w3id.org/security#cipherAlgorithm", + "cipherData": "https://w3id.org/security#cipherData", + "cipherKey": "https://w3id.org/security#cipherKey", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "creator": { + "@id": "http://purl.org/dc/terms/creator", + "@type": "@id" + }, + "digestAlgorithm": "https://w3id.org/security#digestAlgorithm", + "digestValue": "https://w3id.org/security#digestValue", + "domain": "https://w3id.org/security#domain", + "encryptionKey": "https://w3id.org/security#encryptionKey", + "expiration": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "initializationVector": "https://w3id.org/security#initializationVector", + "iterationCount": "https://w3id.org/security#iterationCount", + "nonce": "https://w3id.org/security#nonce", + "normalizationAlgorithm": "https://w3id.org/security#normalizationAlgorithm", + "owner": "https://w3id.org/security#owner", + "password": "https://w3id.org/security#password", + "privateKey": "https://w3id.org/security#privateKey", + "privateKeyPem": "https://w3id.org/security#privateKeyPem", + "publicKey": "https://w3id.org/security#publicKey", + "publicKeyBase58": "https://w3id.org/security#publicKeyBase58", + "publicKeyPem": "https://w3id.org/security#publicKeyPem", + "publicKeyWif": "https://w3id.org/security#publicKeyWif", + "publicKeyService": "https://w3id.org/security#publicKeyService", + "revoked": { + "@id": "https://w3id.org/security#revoked", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "salt": "https://w3id.org/security#salt", + "signature": "https://w3id.org/security#signature", + "signatureAlgorithm": "https://w3id.org/security#signingAlgorithm", + "signatureValue": "https://w3id.org/security#signatureValue", + "proofValue": "https://w3id.org/security#proofValue", + + "AesKeyWrappingKey2019": "https://w3id.org/security#AesKeyWrappingKey2019", + "DeleteKeyOperation": "https://w3id.org/security#DeleteKeyOperation", + "DeriveSecretOperation": "https://w3id.org/security#DeriveSecretOperation", + "EcdsaSecp256k1Signature2019": { + "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019", + "@context": { + "@protected": true, + + "id": "@id", + "type": "@type", + + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "jws": "https://w3id.org/security#jws", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "EcdsaSecp256r1Signature2019": { + "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019", + "@context": { + "@protected": true, + + "id": "@id", + "type": "@type", + + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "jws": "https://w3id.org/security#jws", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "EcdsaSecp256k1VerificationKey2019": "https://w3id.org/security#EcdsaSecp256k1VerificationKey2019", + "EcdsaSecp256r1VerificationKey2019": "https://w3id.org/security#EcdsaSecp256r1VerificationKey2019", + "Ed25519VerificationKey2018": "https://w3id.org/security#Ed25519VerificationKey2018", + "EquihashProof2018": "https://w3id.org/security#EquihashProof2018", + "ExportKeyOperation": "https://w3id.org/security#ExportKeyOperation", + "GenerateKeyOperation": "https://w3id.org/security#GenerateKeyOperation", + "KmsOperation": "https://w3id.org/security#KmsOperation", + "RevokeKeyOperation": "https://w3id.org/security#RevokeKeyOperation", + "RsaSignature2018": { + "@id": "https://w3id.org/security#RsaSignature2018", + "@context": { + "@protected": true, + + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "jws": "https://w3id.org/security#jws", + "nonce": "https://w3id.org/security#nonce", + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "proofValue": "https://w3id.org/security#proofValue", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + } + } + }, + "RsaVerificationKey2018": "https://w3id.org/security#RsaVerificationKey2018", + "Sha256HmacKey2019": "https://w3id.org/security#Sha256HmacKey2019", + "SignOperation": "https://w3id.org/security#SignOperation", + "UnwrapKeyOperation": "https://w3id.org/security#UnwrapKeyOperation", + "VerifyOperation": "https://w3id.org/security#VerifyOperation", + "WrapKeyOperation": "https://w3id.org/security#WrapKeyOperation", + "X25519KeyAgreementKey2019": "https://w3id.org/security#X25519KeyAgreementKey2019", + + "allowedAction": "https://w3id.org/security#allowedAction", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capability": { + "@id": "https://w3id.org/security#capability", + "@type": "@id" + }, + "capabilityAction": "https://w3id.org/security#capabilityAction", + "capabilityChain": { + "@id": "https://w3id.org/security#capabilityChain", + "@type": "@id", + "@container": "@list" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "caveat": { + "@id": "https://w3id.org/security#caveat", + "@type": "@id", + "@container": "@set" + }, + "challenge": "https://w3id.org/security#challenge", + "ciphertext": "https://w3id.org/security#ciphertext", + "controller": { + "@id": "https://w3id.org/security#controller", + "@type": "@id" + }, + "delegator": { + "@id": "https://w3id.org/security#delegator", + "@type": "@id" + }, + "equihashParameterK": { + "@id": "https://w3id.org/security#equihashParameterK", + "@type": "http://www.w3.org/2001/XMLSchema#:integer" + }, + "equihashParameterN": { + "@id": "https://w3id.org/security#equihashParameterN", + "@type": "http://www.w3.org/2001/XMLSchema#:integer" + }, + "invocationTarget": { + "@id": "https://w3id.org/security#invocationTarget", + "@type": "@id" + }, + "invoker": { + "@id": "https://w3id.org/security#invoker", + "@type": "@id" + }, + "jws": "https://w3id.org/security#jws", + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + }, + "kmsModule": { + "@id": "https://w3id.org/security#kmsModule" + }, + "parentCapability": { + "@id": "https://w3id.org/security#parentCapability", + "@type": "@id" + }, + "plaintext": "https://w3id.org/security#plaintext", + "proof": { + "@id": "https://w3id.org/security#proof", + "@type": "@id", + "@container": "@graph" + }, + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab", + "@context": { + "@version": 1.1, + "@protected": true, + "id": "@id", + "type": "@type", + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + "@container": "@set" + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + "@container": "@set" + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + "@container": "@set" + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" + } + } + }, + "referenceId": "https://w3id.org/security#referenceId", + "unwrappedKey": "https://w3id.org/security#unwrappedKey", + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + }, + "verifyData": "https://w3id.org/security#verifyData", + "wrappedKey": "https://w3id.org/security#wrappedKey", + "x509CertificateChain": { + "@id": "https://w3id.org/security#x509CertificateChain", + "@type": "https://w3id.org/security#multibase", + "@container": "@list" + }, + "x509CertificateFingerprint": { + "@id": "https://w3id.org/security#x509CertificateFingerprint", + "@type": "https://w3id.org/security#multibase" + } + }] +} \ No newline at end of file diff --git a/packages/credential-ld/contexts/w3_2018_credentials_v1.json b/packages/credential-ld/src/contexts/www.w3.org_2018_credentials_v1.json similarity index 100% rename from packages/credential-ld/contexts/w3_2018_credentials_v1.json rename to packages/credential-ld/src/contexts/www.w3.org_2018_credentials_v1.json diff --git a/packages/credential-ld/contexts/security_context_v1.json b/packages/credential-ld/src/contexts/www.w3.org_ns_did_v1.json similarity index 100% rename from packages/credential-ld/contexts/security_context_v1.json rename to packages/credential-ld/src/contexts/www.w3.org_ns_did_v1.json diff --git a/packages/credential-ld/src/ld-credential-module.ts b/packages/credential-ld/src/ld-credential-module.ts index ad95bf9b3..9eb664377 100644 --- a/packages/credential-ld/src/ld-credential-module.ts +++ b/packages/credential-ld/src/ld-credential-module.ts @@ -10,7 +10,7 @@ import { import fetch from 'cross-fetch' import Debug from 'debug' import { extendContextLoader, purposes } from 'jsonld-signatures' -import * as vc from 'vc-js' +import * as vc from '@digitalbazaar/vc' import { LdContextLoader } from './ld-context-loader' import { LdSuiteLoader } from './ld-suite-loader' import { RequiredAgentMethods } from './ld-suites' diff --git a/packages/credential-ld/src/ld-default-contexts.ts b/packages/credential-ld/src/ld-default-contexts.ts index 31bd9adb9..c3dcb12b6 100644 --- a/packages/credential-ld/src/ld-default-contexts.ts +++ b/packages/credential-ld/src/ld-default-contexts.ts @@ -1,25 +1,28 @@ import { ContextDoc } from './types' async function _read(_path: string): Promise { - return await import('../contexts/' + _path); + return await import('./contexts/' + _path); } /** * Provides a hardcoded map of common context definitions */ export const LdDefaultContexts = new Map([ - ['https://www.w3.org/2018/credentials/v1', _read('w3_2018_credentials_v1.json')], - ['https://www.w3.org/ns/did/v1', _read('security_context_v1.json')], - ['https://w3id.org/did/v0.11', _read('did_v0.11.json')], - - ['https://veramo.io/contexts/socialmedia/v1', _read('socialmedia-v1.json')], - ['https://veramo.io/contexts/kyc/v1', _read('kyc-v1.json')], - ['https://veramo.io/contexts/profile/v1', _read('profile-v1.json')], - ['https://ns.did.ai/transmute/v1', _read('transmute_v1.json')], - [ - 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', - _read('lds-ecdsa-secp256k1-recovery2020-0.0.json'), - ], - ['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.json')], - ['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.json')], + ['https://www.w3.org/2018/credentials/v1', _read('www.w3.org_2018_credentials_v1.json')], + ['https://www.w3.org/ns/did/v1', _read('www.w3.org_ns_did_v1.json')], + ['https://w3id.org/security/v1', _read('w3id.org_security_v1.json')], + ['https://w3id.org/security/v2', _read('w3id.org_security_v2.json')], + ['https://w3id.org/security/v3-unstable', _read('w3id.org_security_v3-unstable.json')], + ['https://w3id.org/security/suites/ed25519-2018/v1', _read('w3id.org_security_suites_ed25519-2018_v1.json')], + ['https://w3id.org/security/suites/x25519-2019/v1', _read('w3id.org_security_suites_x25519-2019_v1.json')], + // ['https://w3id.org/did/v0.11', _read('did_v0.11.json')], + // ['https://veramo.io/contexts/socialmedia/v1', _read('socialmedia-v1.json')], + // ['https://veramo.io/contexts/kyc/v1', _read('kyc-v1.json')], + ['https://veramo.io/contexts/profile/v1', _read('veramo.io_contexts_profile_v1.json')], + // ['https://ns.did.ai/transmute/v1', _read('transmute_v1.json')], + ['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', _read('lds-ecdsa-secp256k1-recovery2020-0.0.json')], + ['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-2.0.jsonld', _read('w3id.org_security_suites_secp256k1recovery-2020_v2.json')], + ['https://w3id.org/security/suites/secp256k1recovery-2020/v2', _read('w3id.org_security_suites_secp256k1recovery-2020_v2.json')], + // ['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.json')], + // ['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.json')], ]) diff --git a/packages/credential-ld/src/ld-suites.ts b/packages/credential-ld/src/ld-suites.ts index 0236b4bf1..c5ab7b7b0 100644 --- a/packages/credential-ld/src/ld-suites.ts +++ b/packages/credential-ld/src/ld-suites.ts @@ -38,7 +38,7 @@ export abstract class VeramoLdSignature { // TODO: Remove invalid field 'verifiers' from Presentation. Needs to be adapted for LD credentials // Only remove empty array (vc.signPresentation will throw then) const sanitizedPresentation = presentation as any - if (sanitizedPresentation.verifier.length == 0) { + if (sanitizedPresentation.verifier?.length == 0) { delete sanitizedPresentation.verifier } } diff --git a/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts b/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts index dc5f1d67a..fe7f0b4ce 100644 --- a/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +++ b/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts @@ -1,5 +1,5 @@ import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites' -import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core' +import { CredentialPayload, DIDDocument, IAgentContext, IKey, PresentationPayload, TKeyType } from '@veramo/core' import { EcdsaSecp256k1RecoveryMethod2020, EcdsaSecp256k1RecoverySignature2020, @@ -64,18 +64,33 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature preSigningCredModification(credential: CredentialPayload): void { credential['@context'] = [ ...asArray(credential['@context'] || []), - 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', + 'https://w3id.org/security/suites/secp256k1recovery-2020/v2', + ] + } + + preSigningPresModification(presentation: PresentationPayload): void { + super.preSigningPresModification(presentation) + presentation['@context'] = [ + ...asArray(presentation['@context'] || []), + 'https://w3id.org/security/suites/secp256k1recovery-2020/v2', ] } preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void { - // did:ethr +// did:ethr + const idx = didDoc['@context']?.indexOf('https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld') || -1 + if (Array.isArray(didDoc['@context']) && idx !== -1) { + didDoc['@context'][idx] = "https://w3id.org/security/suites/secp256k1recovery-2020/v2" + } + if (didUrl.toLowerCase().startsWith('did:ethr')) { - // TODO: EcdsaSecp256k1RecoveryMethod2020 does not support blockchainAccountId - // blockchainAccountId to ethereumAddress + //EcdsaSecp256k1RecoveryMethod2020 does not support older format blockchainAccountId didDoc.verificationMethod?.forEach((x) => { if (x.blockchainAccountId) { - x.ethereumAddress = x.blockchainAccountId.substring(0, x.blockchainAccountId.lastIndexOf('@')) + if (x.blockchainAccountId.lastIndexOf('@eip155:') !== -1) { + const [ address, chain ] = x.blockchainAccountId.split("@eip155:") + x.blockchainAccountId = `eip155:${chain}:${address}` + } } }) } diff --git a/packages/credential-ld/types/jsonld/index.d.ts b/packages/credential-ld/types/jsonld/index.d.ts index 480a99c5d..51345c04c 100644 --- a/packages/credential-ld/types/jsonld/index.d.ts +++ b/packages/credential-ld/types/jsonld/index.d.ts @@ -1,4 +1,4 @@ declare module 'jsonld' declare module 'jsonld-signatures' -declare module 'vc-js' +declare module '@digitalbazaar/vc' declare module '@transmute/lds-ecdsa-secp256k1-recovery2020' diff --git a/packages/credential-w3c/contexts/X25519KeyAgreementKey2019.jsonld b/packages/credential-w3c/contexts/X25519KeyAgreementKey2019.jsonld deleted file mode 100644 index d01bac010..000000000 --- a/packages/credential-w3c/contexts/X25519KeyAgreementKey2019.jsonld +++ /dev/null @@ -1,26 +0,0 @@ -{ - "@context": { - "id": "@id", - "type": "@type", - "@protected": true, - "X25519KeyAgreementKey2019": { - "@id": "https://w3id.org/security#X25519KeyAgreementKey2019", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "controller": { - "@id": "https://w3id.org/security#controller", - "@type": "@id" - }, - "revoked": { - "@id": "https://w3id.org/security#revoked", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "publicKeyBase58": { - "@id": "https://w3id.org/security#publicKeyBase58" - } - } - } - } -} diff --git a/packages/credential-w3c/contexts/kyc-v1.jsonld b/packages/credential-w3c/contexts/kyc-v1.jsonld deleted file mode 100644 index 306d0174e..000000000 --- a/packages/credential-w3c/contexts/kyc-v1.jsonld +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "@protected": true, - "VerifiableKyc": "https://veramo.io/contexts/kyc#VerifiableKyc", - "name": "https://schema.org/name" - } -} diff --git a/packages/credential-w3c/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld b/packages/credential-w3c/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld deleted file mode 100644 index c79835e3c..000000000 --- a/packages/credential-w3c/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld +++ /dev/null @@ -1,60 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "id": "@id", - "type": "@type", - "esrs2020": "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020#", - - "EcdsaSecp256k1RecoverySignature2020": { - "@id": "https://w3id.org/security#EcdsaSecp256k1RecoverySignature2020", - "@context": { - "@version": 1.1, - "@protected": true, - - "id": "@id", - "type": "@type", - - "sec": "https://w3id.org/security#", - "xsd": "http://www.w3.org/2001/XMLSchema#", - - "challenge": "sec:challenge", - "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime"}, - "domain": "sec:domain", - "expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"}, - "jws": "sec:jws", - "nonce": "sec:nonce", - "proofPurpose": { - "@id": "sec:proofPurpose", - "@type": "@vocab", - "@context": { - "@version": 1.1, - "@protected": true, - - "id": "@id", - "type": "@type", - - "sec": "https://w3id.org/security#", - - "assertionMethod": {"@id": "sec:assertionMethod", "@type": "@id", "@container": "@set"}, - "authentication": {"@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set"} - } - }, - "proofValue": "sec:proofValue", - "verificationMethod": {"@id": "sec:verificationMethod", "@type": "@id"} - } - }, - - "EcdsaSecp256k1RecoveryMethod2020": "esrs2020:EcdsaSecp256k1RecoveryMethod2020", - "publicKeyJwk": { - "@id": "esrs2020:publicKeyJwk", - "@type": "@json" - }, - "privateKeyJwk": { - "@id": "esrs2020:privateKeyJwk", - "@type": "@json" - }, - "publicKeyHex": "esrs2020:publicKeyHex", - "privateKeyHex": "esrs2020:privateKeyHex", - "ethereumAddress": "esrs2020:ethereumAddress" - } -} diff --git a/packages/credential-w3c/contexts/profile-v1.jsonld b/packages/credential-w3c/contexts/profile-v1.jsonld deleted file mode 100644 index 925515f8a..000000000 --- a/packages/credential-w3c/contexts/profile-v1.jsonld +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "@protected": true, - "Profile": "https://veramo.io/contexts/profile#Profile", - "name": "https://schema.org/name" - } -} diff --git a/packages/credential-w3c/contexts/security_context_v1.jsonld b/packages/credential-w3c/contexts/security_context_v1.jsonld deleted file mode 100644 index b447d0108..000000000 --- a/packages/credential-w3c/contexts/security_context_v1.jsonld +++ /dev/null @@ -1,58 +0,0 @@ -{ - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - - "alsoKnownAs": { - "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs", - "@type": "@id" - }, - "assertionMethod": { - "@id": "https://w3id.org/security#assertionMethod", - "@type": "@id", - "@container": "@set" - }, - "authentication": { - "@id": "https://w3id.org/security#authenticationMethod", - "@type": "@id", - "@container": "@set" - }, - "capabilityDelegation": { - "@id": "https://w3id.org/security#capabilityDelegationMethod", - "@type": "@id", - "@container": "@set" - }, - "capabilityInvocation": { - "@id": "https://w3id.org/security#capabilityInvocationMethod", - "@type": "@id", - "@container": "@set" - }, - "controller": { - "@id": "https://w3id.org/security#controller", - "@type": "@id" - }, - "keyAgreement": { - "@id": "https://w3id.org/security#keyAgreementMethod", - "@type": "@id", - "@container": "@set" - }, - "service": { - "@id": "https://www.w3.org/ns/did#service", - "@type": "@id", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "serviceEndpoint": { - "@id": "https://www.w3.org/ns/did#serviceEndpoint", - "@type": "@id" - } - } - }, - "verificationMethod": { - "@id": "https://w3id.org/security#verificationMethod", - "@type": "@id" - } - } -} diff --git a/packages/credential-w3c/contexts/socialmedia-v1.jsonld b/packages/credential-w3c/contexts/socialmedia-v1.jsonld deleted file mode 100644 index 50e0ed8c4..000000000 --- a/packages/credential-w3c/contexts/socialmedia-v1.jsonld +++ /dev/null @@ -1,7 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "@protected": true, - "VerifableSocialMediaPosting": "https://veramo.io/contexts/socialmedia#VerifableSocialMediaPosting" - } -} diff --git a/packages/credential-w3c/contexts/transmute_v1.jsonld b/packages/credential-w3c/contexts/transmute_v1.jsonld deleted file mode 100644 index e51c050ad..000000000 --- a/packages/credential-w3c/contexts/transmute_v1.jsonld +++ /dev/null @@ -1,21 +0,0 @@ -{ - "@context": [ - { - "@version": 1.1 - }, - "https://www.w3.org/ns/did/v1", - { - "JsonWebKey2020": "https://w3id.org/security#JsonWebKey2020", - "Ed25519VerificationKey2018": "https://w3id.org/security#Ed25519VerificationKey2018", - "X25519KeyAgreementKey2019": "https://w3id.org/security#X25519KeyAgreementKey2019", - - "publicKeyJwk": { - "@id": "https://w3id.org/security#publicKeyJwk", - "@type": "@json" - }, - "publicKeyBase58": { - "@id": "https://w3id.org/security#publicKeyBase58" - } - } - ] -} diff --git a/packages/did-resolver/src/__tests__/integration.test.ts b/packages/did-resolver/src/__tests__/integration.test.ts index 56de80842..6bc7fd99b 100644 --- a/packages/did-resolver/src/__tests__/integration.test.ts +++ b/packages/did-resolver/src/__tests__/integration.test.ts @@ -4,6 +4,8 @@ import { getResolver as getEthrResolver } from 'ethr-did-resolver' import { getResolver as getWebDidResolver } from 'web-did-resolver' import { getUniversalResolverFor } from '../universal-resolver' +jest.setTimeout(30000) + const providerConfig = { networks: [ { name: 'rinkeby', rpcUrl: 'https://rinkeby.infura.io/v3/6b734e0b04454df8a6ce234023c04f26' }, diff --git a/packages/remote-client/package.json b/packages/remote-client/package.json index f261d1ad7..f786523c4 100644 --- a/packages/remote-client/package.json +++ b/packages/remote-client/package.json @@ -29,12 +29,7 @@ }, "repository": "git@github.com:uport-project/veramo.git", "author": "Simonas Karuzas ", - "contributors": [ - { - "name": "Mircea Nistor", - "email": "mircea.nistor@mesh.xyz" - } - ], + "contributors": ["Mircea Nistor "], "license": "Apache-2.0", "keywords": [] } diff --git a/packages/tsconfig.settings.json b/packages/tsconfig.settings.json index 0d3a45d48..6637d2405 100644 --- a/packages/tsconfig.settings.json +++ b/packages/tsconfig.settings.json @@ -13,7 +13,11 @@ "composite": true, "emitDecoratorMetadata": true, "useUnknownInCatchVariables": false, - "experimentalDecorators": true + "experimentalDecorators": true, + "resolveJsonModule": true }, - "exclude": ["**/__tests__/**/*", "**/build/**/*"] + "exclude": [ + "**/__tests__/**/*", + "**/build/**/*" + ] } diff --git a/packages/url-handler/package.json b/packages/url-handler/package.json index 8a97a842a..87d96cd69 100644 --- a/packages/url-handler/package.json +++ b/packages/url-handler/package.json @@ -30,12 +30,7 @@ }, "repository": "git@github.com:uport-project/veramo.git", "author": "Simonas Karuzas ", - "contributors": [ - { - "name": "Mircea Nistor", - "email": "mircea.nistor@mesh.xyz" - } - ], + "contributors": ["Mircea Nistor