From fb192e72a0bcd38d97b14e9d584c1770961d88df Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 27 Sep 2023 22:53:28 +0200 Subject: [PATCH] fix(utils): bump did-jwt to 7.4.1 and reuse key conversion code from it (#1261) fixes #1248 closes #1245 --- __tests__/localJsonStoreAgent.test.ts | 9 +- __tests__/localMemoryStoreAgent.test.ts | 5 + __tests__/restAgent.test.ts | 5 + __tests__/shared/utils.ts | 23 +++ package.json | 4 +- packages/core-types/package.json | 2 +- packages/core-types/src/plugin.schema.json | 6 +- packages/core-types/src/types/IIdentifier.ts | 4 +- .../src/suites/Ed25519Signature2020.ts | 4 +- packages/credential-status/package.json | 2 +- packages/credential-w3c/package.json | 4 +- packages/data-store-json/package.json | 2 +- packages/data-store/package.json | 2 +- packages/did-comm/package.json | 2 +- packages/did-jwt/package.json | 2 +- packages/did-provider-key/package.json | 4 +- .../did-provider-key/src/key-did-provider.ts | 13 +- packages/did-provider-peer/package.json | 4 +- .../src/peer-did-provider.ts | 18 +-- packages/did-provider-peer/src/resolver.ts | 5 + packages/did-provider-pkh/src/resolver.ts | 5 + packages/key-manager/package.json | 2 +- packages/kms-local/package.json | 2 +- packages/kv-store/src/key-value-types.ts | 2 +- .../remote-server/src/web-did-doc-router.ts | 4 +- packages/selective-disclosure/package.json | 2 +- packages/test-react-app/package.json | 1 + packages/test-react-app/src/veramo/setup.ts | 5 + packages/test-react-app/tsconfig.json | 1 + packages/utils/package.json | 4 +- .../utils/src/__tests__/did-utils.test.ts | 8 +- packages/utils/src/credential-utils.ts | 2 +- packages/utils/src/did-utils.ts | 37 +---- packages/utils/src/encodings.ts | 139 +++--------------- packages/utils/src/type-utils.ts | 1 + pnpm-lock.yaml | 124 +++++----------- 36 files changed, 161 insertions(+), 298 deletions(-) diff --git a/__tests__/localJsonStoreAgent.test.ts b/__tests__/localJsonStoreAgent.test.ts index 2bdb9c341..68feaab23 100644 --- a/__tests__/localJsonStoreAgent.test.ts +++ b/__tests__/localJsonStoreAgent.test.ts @@ -16,9 +16,7 @@ import { IResolver, TAgent, } from '../packages/core-types/src' -import { - createAgent -} from '../packages/core/src' +import { createAgent } from '../packages/core/src' import { MessageHandler } from '../packages/message-handler/src' import { KeyManager } from '../packages/key-manager/src' import { DIDManager } from '../packages/did-manager/src' @@ -53,6 +51,7 @@ import { PrivateKeyStoreJson, } from '../packages/data-store-json/src' import { FakeDidProvider, FakeDidResolver } from '../packages/test-utils/src' +import { PeerDIDProvider, getResolver as getDidPeerResolver } from '../packages/did-provider-peer/src' import { Resolver } from 'did-resolver' import { getResolver as ethrDidResolver } from 'ethr-did-resolver' @@ -162,6 +161,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:key': new KeyDIDProvider({ defaultKms: 'local', }), + 'did:peer': new PeerDIDProvider({ + defaultKms: 'local', + }), 'did:pkh': new PkhDIDProvider({ defaultKms: 'local', }), @@ -176,6 +178,7 @@ const setup = async (options?: IAgentOptions): Promise => { ...ethrDidResolver({ infuraProjectId }), ...webDidResolver(), ...getDidKeyResolver(), + ...getDidPeerResolver(), ...getDidPkhResolver(), ...getDidJwkResolver(), ...new FakeDidResolver(() => agent).getDidFakeResolver(), diff --git a/__tests__/localMemoryStoreAgent.test.ts b/__tests__/localMemoryStoreAgent.test.ts index e22eb4d37..80b9a77e5 100644 --- a/__tests__/localMemoryStoreAgent.test.ts +++ b/__tests__/localMemoryStoreAgent.test.ts @@ -49,6 +49,7 @@ import { KeyManagementSystem } from '../packages/kms-local/src' import { Web3KeyManagementSystem } from '../packages/kms-web3/src' import { DataStore, DataStoreORM, Entities, migrations } from '../packages/data-store/src' import { FakeDidProvider, FakeDidResolver } from '../packages/test-utils/src' +import { PeerDIDProvider, getResolver as getDidPeerResolver } from "../packages/did-provider-peer/src"; import { getResolver as ethrDidResolver } from 'ethr-did-resolver' import { getResolver as webDidResolver } from 'web-did-resolver' @@ -159,6 +160,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:key': new KeyDIDProvider({ defaultKms: 'local', }), + 'did:peer': new PeerDIDProvider({ + defaultKms: 'local' + }), 'did:pkh': new PkhDIDProvider({ defaultKms: 'local', }), @@ -172,6 +176,7 @@ const setup = async (options?: IAgentOptions): Promise => { ...ethrDidResolver({ infuraProjectId }), ...webDidResolver(), ...getDidKeyResolver(), + ...getDidPeerResolver(), ...getDidPkhResolver(), ...getDidJwkResolver(), ...new FakeDidResolver(() => agent).getDidFakeResolver(), diff --git a/__tests__/restAgent.test.ts b/__tests__/restAgent.test.ts index d326f6201..f5f68dcd5 100644 --- a/__tests__/restAgent.test.ts +++ b/__tests__/restAgent.test.ts @@ -47,6 +47,7 @@ import { WebDIDProvider } from '../packages/did-provider-web/src' import { getDidKeyResolver, KeyDIDProvider } from '../packages/did-provider-key/src' import { getDidPkhResolver, PkhDIDProvider } from '../packages/did-provider-pkh/src' import { getDidJwkResolver, JwkDIDProvider } from '../packages/did-provider-jwk/src' +import { getResolver as getDidPeerResolver, PeerDIDProvider } from "../packages/did-provider-peer/src"; import { DIDComm, DIDCommHttpTransport, DIDCommMessageHandler, IDIDComm } from '../packages/did-comm/src' import { ISelectiveDisclosure, @@ -189,6 +190,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:key': new KeyDIDProvider({ defaultKms: 'local', }), + 'did:peer': new PeerDIDProvider({ + defaultKms: 'local' + }), 'did:pkh': new PkhDIDProvider({ defaultKms: 'local', }), @@ -204,6 +208,7 @@ const setup = async (options?: IAgentOptions): Promise => { ...webDidResolver(), // key: getUniversalResolver(), // resolve using remote resolver... when uniresolver becomes more stable, ...getDidKeyResolver(), + ...getDidPeerResolver(), ...getDidPkhResolver(), ...getDidJwkResolver(), ...new FakeDidResolver(() => serverAgent as TAgent).getDidFakeResolver(), diff --git a/__tests__/shared/utils.ts b/__tests__/shared/utils.ts index f5e7f7a16..fdf3c9c97 100644 --- a/__tests__/shared/utils.ts +++ b/__tests__/shared/utils.ts @@ -59,5 +59,28 @@ export default (testContext: { `eip155:1:${account}`, ) }) + + it('should verify JWT credential signed by did:peer (multibase + multicodec) (github #1248)', async () => { + // did:peer uses publicKeyMultibase + const issuer = await agent.didManagerCreate({ + provider: 'did:peer', + options: { + num_algo: 0 + } + }) + const payload = { + issuer: issuer.did, + credentialSubject: { + nothing: 'else matters', + }, + } + const credential = await agent.createVerifiableCredential({ + credential: payload, + proofFormat: 'jwt', + }) + + const verifyResult = await agent.verifyCredential({ credential }) + expect(verifyResult.verified).toBeTruthy() + }) }) } diff --git a/package.json b/package.json index b2b595eb4..0ae136dd2 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,8 @@ "caip": "1.1.0", "credential-status": "2.0.6", "cross-env": "7.0.3", - "did-jwt": "7.3.0", - "did-jwt-vc": "3.2.9", + "did-jwt": "7.4.1", + "did-jwt-vc": "3.2.10", "did-resolver": "4.1.0", "ethr-did-resolver": "8.1.2", "express": "4.18.2", diff --git a/packages/core-types/package.json b/packages/core-types/package.json index e24f83124..a8ec0edc1 100644 --- a/packages/core-types/package.json +++ b/packages/core-types/package.json @@ -35,7 +35,7 @@ "dependencies": { "credential-status": "^2.0.5", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.5", + "did-jwt-vc": "^3.2.10", "did-resolver": "^4.1.0" }, "devDependencies": { diff --git a/packages/core-types/src/plugin.schema.json b/packages/core-types/src/plugin.schema.json index 4cca79edd..586a2a175 100644 --- a/packages/core-types/src/plugin.schema.json +++ b/packages/core-types/src/plugin.schema.json @@ -557,7 +557,7 @@ }, "TAlg": { "type": "string", - "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta.algorithms } property to see what is possible for a particular managed key." + "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta | IKey.meta.algorithms } property to see what is possible for a particular managed key." }, "ManagedKeyInfo": { "type": "object", @@ -1131,7 +1131,7 @@ }, "TAlg": { "type": "string", - "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta.algorithms } property to see what is possible for a particular managed key." + "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta | IKey.meta.algorithms } property to see what is possible for a particular managed key." }, "IDIDManagerAddServiceArgs": { "type": "object", @@ -2812,7 +2812,7 @@ }, "TAlg": { "type": "string", - "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta.algorithms } property to see what is possible for a particular managed key." + "description": "Known algorithms supported by some of the above key types defined by {@link TKeyType } .\n\nActual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems } can support more. One should check the {@link IKey.meta | IKey.meta.algorithms } property to see what is possible for a particular managed key." }, "IService": { "type": "object", diff --git a/packages/core-types/src/types/IIdentifier.ts b/packages/core-types/src/types/IIdentifier.ts index e73606de4..eadf8ba39 100644 --- a/packages/core-types/src/types/IIdentifier.ts +++ b/packages/core-types/src/types/IIdentifier.ts @@ -57,8 +57,8 @@ export type TKeyType = 'Ed25519' | 'Secp256k1' | 'Secp256r1' | 'X25519' | 'Bls12 * Known algorithms supported by some of the above key types defined by {@link TKeyType}. * * Actual implementations of {@link @veramo/key-manager#AbstractKeyManagementSystem | Key Management Systems} can - * support more. One should check the {@link IKey.meta.algorithms} property to see what is possible - * for a particular managed key. + * support more. One should check the {@link IKey.meta | IKey.meta.algorithms} property to see what is possible for a + * particular managed key. * * @public */ diff --git a/packages/credential-ld/src/suites/Ed25519Signature2020.ts b/packages/credential-ld/src/suites/Ed25519Signature2020.ts index 191687b72..40f1a8170 100644 --- a/packages/credential-ld/src/suites/Ed25519Signature2020.ts +++ b/packages/credential-ld/src/suites/Ed25519Signature2020.ts @@ -66,7 +66,7 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature { const verificationKey = new Ed25519VerificationKey2020({ id, controller, - publicKeyMultibase: bytesToMultibase(hexToBytes(key.publicKeyHex), 'Ed25519'), + publicKeyMultibase: bytesToMultibase(hexToBytes(key.publicKeyHex), 'base58btc', 'ed25519-pub'), // signer: () => signer, // type: this.getSupportedVerificationType(), }) @@ -139,7 +139,7 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature { // publicKeyMultibase is required by this suite if (!vm.publicKeyMultibase) { const publicKeyHex = extractPublicKeyHex(vm) - vm.publicKeyMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'Ed25519') + vm.publicKeyMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'base58btc', 'ed25519-pub') } } return vm diff --git a/packages/credential-status/package.json b/packages/credential-status/package.json index b7e911c81..5cf674b94 100644 --- a/packages/credential-status/package.json +++ b/packages/credential-status/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "credential-status": "^2.0.5", - "did-jwt": "^7.2.5", + "did-jwt": "^7.4.1", "did-resolver": "^4.1.0" }, "devDependencies": { diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index 8e78cc953..aa54f6dc7 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -18,8 +18,8 @@ "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "debug": "^4.3.3", - "did-jwt": "^7.2.5", - "did-jwt-vc": "^3.2.5", + "did-jwt": "^7.4.1", + "did-jwt-vc": "^3.2.10", "did-resolver": "^4.1.0", "uuid": "^9.0.0" }, diff --git a/packages/data-store-json/package.json b/packages/data-store-json/package.json index 0e41063c4..db6da0337 100644 --- a/packages/data-store-json/package.json +++ b/packages/data-store-json/package.json @@ -16,7 +16,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.5", + "did-jwt-vc": "^3.2.10", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/data-store/package.json b/packages/data-store/package.json index 62c778c7d..25515b69a 100644 --- a/packages/data-store/package.json +++ b/packages/data-store/package.json @@ -15,7 +15,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.5", + "did-jwt-vc": "^3.2.10", "typeorm": "^0.3.17", "uuid": "^9.0.0" }, diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index ab9b003fc..3dd831f5a 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -29,7 +29,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^4.0.0", "debug": "^4.3.3", - "did-jwt": "^7.2.5", + "did-jwt": "^7.4.1", "did-resolver": "^4.1.0", "isomorphic-webcrypto": "^2.3.8", "uuid": "^9.0.0" diff --git a/packages/did-jwt/package.json b/packages/did-jwt/package.json index e3ab6047b..b0b2432ce 100644 --- a/packages/did-jwt/package.json +++ b/packages/did-jwt/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.2.5", + "did-jwt": "^7.4.1", "did-resolver": "^4.1.0" }, "devDependencies": { diff --git a/packages/did-provider-key/package.json b/packages/did-provider-key/package.json index 3b2ed34f1..d14630d0a 100644 --- a/packages/did-provider-key/package.json +++ b/packages/did-provider-key/package.json @@ -18,9 +18,7 @@ "@veramo/did-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-resolver": "^4.1.0", - "multicodec": "^3.2.1", - "multiformats": "^12.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-key/src/key-did-provider.ts b/packages/did-provider-key/src/key-did-provider.ts index 2c42df506..afab45a5f 100644 --- a/packages/did-provider-key/src/key-did-provider.ts +++ b/packages/did-provider-key/src/key-did-provider.ts @@ -1,9 +1,7 @@ import { IAgentContext, IIdentifier, IKey, IKeyManager, IService, RequireOnly } from '@veramo/core-types' import { AbstractIdentifierProvider } from '@veramo/did-manager' -import { hexToBytes } from '@veramo/utils' +import { bytesToMultibase, hexToBytes } from '@veramo/utils' import { computePublicKey } from '@ethersproject/signing-key' -import { base58btc } from 'multiformats/bases/base58' -import Multicodec from 'multicodec' import Debug from 'debug' @@ -11,11 +9,11 @@ const debug = Debug('veramo:did-key:identifier-provider') type IContext = IAgentContext type CreateKeyDidOptions = { - keyType?: keyof typeof keyOptions + keyType?: keyof typeof keyCodecs privateKeyHex?: string } -const keyOptions = { +const keyCodecs = { Ed25519: 'ed25519-pub', X25519: 'x25519-pub', Secp256k1: 'secp256k1-pub', @@ -38,7 +36,7 @@ export class KeyDIDProvider extends AbstractIdentifierProvider { { kms, options }: { kms?: string; options?: CreateKeyDidOptions }, context: IContext, ): Promise> { - const keyType = (options?.keyType && keyOptions[options?.keyType] && options.keyType) || 'Ed25519' + const keyType = (options?.keyType && keyCodecs[options?.keyType] && options.keyType) || 'Ed25519' const key = await this.importOrGenerateKey( { kms: kms || this.defaultKms, @@ -51,8 +49,7 @@ export class KeyDIDProvider extends AbstractIdentifierProvider { ) const publicKeyHex = key.type === 'Secp256k1' ? computePublicKey('0x' + key.publicKeyHex, true) : key.publicKeyHex - const multicodecEncoded = Multicodec.addPrefix(keyOptions[keyType], hexToBytes(publicKeyHex)) - const methodSpecificId: string = base58btc.encode(multicodecEncoded) + const methodSpecificId: string = bytesToMultibase(hexToBytes(publicKeyHex), 'base58btc', keyCodecs[keyType]) const identifier: Omit = { did: 'did:key:' + methodSpecificId, diff --git a/packages/did-provider-peer/package.json b/packages/did-provider-peer/package.json index 4cae53447..97f3e752e 100644 --- a/packages/did-provider-peer/package.json +++ b/packages/did-provider-peer/package.json @@ -15,9 +15,7 @@ "@veramo/did-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-resolver": "^4.1.0", - "multicodec": "^3.2.1", - "multiformats": "^12.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-peer/src/peer-did-provider.ts b/packages/did-provider-peer/src/peer-did-provider.ts index 87d63bc7d..c59ad16fc 100644 --- a/packages/did-provider-peer/src/peer-did-provider.ts +++ b/packages/did-provider-peer/src/peer-did-provider.ts @@ -1,8 +1,6 @@ import { IAgentContext, IIdentifier, IKey, IKeyManager, IService } from '@veramo/core-types' import { AbstractIdentifierProvider } from '@veramo/did-manager' -import { base58btc } from 'multiformats/bases/base58' -import Multicodec from 'multicodec' -import { bytesToBase64url, hexToBytes, stringToUtf8Bytes } from '@veramo/utils' +import { bytesToBase64url, bytesToMultibase, hexToBytes, stringToUtf8Bytes } from '@veramo/utils' import Debug from 'debug' @@ -45,9 +43,7 @@ export class PeerDIDProvider extends AbstractIdentifierProvider { ): Promise> { if (options.num_algo == 0) { const key = await context.agent.keyManagerCreate({ kms: kms || this.defaultKms, type: 'Ed25519' }) - const methodSpecificId = base58btc.encode( - Multicodec.addPrefix('ed25519-pub', hexToBytes(key.publicKeyHex)), - ) + const methodSpecificId = bytesToMultibase(hexToBytes(key.publicKeyHex), 'base58btc', 'ed25519-pub') const identifier: Omit = { did: 'did:peer:0' + methodSpecificId, @@ -67,12 +63,12 @@ export class PeerDIDProvider extends AbstractIdentifierProvider { type: 'X25519', }) - const authKeyText = base58btc.encode( - Multicodec.addPrefix('ed25519-pub', hexToBytes(authKey.publicKeyHex)), - ) + const authKeyText = bytesToMultibase(hexToBytes(authKey.publicKeyHex), 'base58btc', 'ed25519-pub') - const agreementKeyText = base58btc.encode( - Multicodec.addPrefix('x25519-pub', hexToBytes(agreementKey.publicKeyHex)), + const agreementKeyText = bytesToMultibase( + hexToBytes(agreementKey.publicKeyHex), + 'base58btc', + 'x25519-pub', ) const ServiceEncoded = encodeService(options.service) diff --git a/packages/did-provider-peer/src/resolver.ts b/packages/did-provider-peer/src/resolver.ts index ec9c66860..099029b38 100644 --- a/packages/did-provider-peer/src/resolver.ts +++ b/packages/did-provider-peer/src/resolver.ts @@ -2,6 +2,11 @@ import { DIDDocument, DIDResolutionResult, DIDResolver, ParsedDID } from 'did-re import { resolve } from '@aviarytech/did-peer' import { IDIDDocumentServiceDescriptor } from '@aviarytech/did-peer/interfaces.js' +/** + * Creates a DID Resolver that can resolve Peer DIDs (for the 0 and 2 num_algo values) + * + * @public + */ export function getResolver(): Record { async function resolveInner(did: string, parsed: ParsedDID): Promise { const didDocumentMetadata = {} diff --git a/packages/did-provider-pkh/src/resolver.ts b/packages/did-provider-pkh/src/resolver.ts index 4647ee6eb..90d31fe5d 100644 --- a/packages/did-provider-pkh/src/resolver.ts +++ b/packages/did-provider-pkh/src/resolver.ts @@ -49,6 +49,11 @@ function toDidDoc(did: string, blockchainAccountId: string): any { return doc; } +/** + * Creates a DID resolver that resolves PKH DIDs + * + * @public + */ export function getResolver(): ResolverRegistry { return { pkh: async ( diff --git a/packages/key-manager/package.json b/packages/key-manager/package.json index 38f798903..337107a9b 100644 --- a/packages/key-manager/package.json +++ b/packages/key-manager/package.json @@ -17,7 +17,7 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.4", - "did-jwt": "^7.2.5", + "did-jwt": "^7.4.1", "uint8arrays": "^4.0.6", "uuid": "^9.0.0" }, diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index 76684addc..e77dc8b6d 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -24,7 +24,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.2.5" + "did-jwt": "^7.4.1" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/kv-store/src/key-value-types.ts b/packages/kv-store/src/key-value-types.ts index 8b3f5b6c2..361e4bdaf 100644 --- a/packages/kv-store/src/key-value-types.ts +++ b/packages/kv-store/src/key-value-types.ts @@ -121,7 +121,7 @@ export interface IKeyValueStore { /** * Determine whether the store has the value belonging to the provided key * - * @param key The key to search for + * @param key - The key to search for */ has(key: string): Promise diff --git a/packages/remote-server/src/web-did-doc-router.ts b/packages/remote-server/src/web-did-doc-router.ts index a8a51d53d..cc17f9110 100644 --- a/packages/remote-server/src/web-did-doc-router.ts +++ b/packages/remote-server/src/web-did-doc-router.ts @@ -68,12 +68,12 @@ export const WebDidDocRouter = (options: WebDidDocRouterOptions): Router => { break case 'Ed25519VerificationKey2020': contexts.add('https://w3id.org/security/suites/ed25519-2020/v1') - vm.publicKeyMultibase = bytesToMultibase(hexToBytes(key.publicKeyHex), 'Ed25519') + vm.publicKeyMultibase = bytesToMultibase(hexToBytes(key.publicKeyHex), 'base58btc', 'ed25519-pub') delete(vm.publicKeyHex) break case 'X25519KeyAgreementKey2020': contexts.add('https://w3id.org/security/suites/x25519-2020/v1') - vm.publicKeyMultibase = bytesToMultibase(hexToBytes(key.publicKeyHex), 'Ed25519') + vm.publicKeyMultibase = bytesToMultibase(hexToBytes(key.publicKeyHex), 'base58btc', 'x25519-pub') delete(vm.publicKeyHex) break case 'EcdsaSecp256r1VerificationKey2019': diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index e827e445b..2b5df0d44 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -22,7 +22,7 @@ "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.2.5", + "did-jwt": "^7.4.1", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/test-react-app/package.json b/packages/test-react-app/package.json index 4ad4cb51e..a8faac611 100644 --- a/packages/test-react-app/package.json +++ b/packages/test-react-app/package.json @@ -16,6 +16,7 @@ "@veramo/did-provider-ethr": "workspace:*", "@veramo/did-provider-jwk": "workspace:*", "@veramo/did-provider-key": "workspace:*", + "@veramo/did-provider-peer": "workspace:^", "@veramo/did-provider-pkh": "workspace:*", "@veramo/did-provider-web": "workspace:*", "@veramo/did-resolver": "workspace:*", diff --git a/packages/test-react-app/src/veramo/setup.ts b/packages/test-react-app/src/veramo/setup.ts index b84714033..628ea4500 100644 --- a/packages/test-react-app/src/veramo/setup.ts +++ b/packages/test-react-app/src/veramo/setup.ts @@ -29,6 +29,7 @@ import { VeramoEd25519Signature2018, } from '@veramo/credential-ld' import { getDidKeyResolver, KeyDIDProvider } from '@veramo/did-provider-key' +import { getResolver as getDidPeerResolver, PeerDIDProvider } from '@veramo/did-provider-peer' import { getDidPkhResolver, PkhDIDProvider } from '@veramo/did-provider-pkh' import { getDidJwkResolver, JwkDIDProvider } from '@veramo/did-provider-jwk' import { DIDComm, DIDCommMessageHandler, IDIDComm } from '@veramo/did-comm' @@ -74,6 +75,7 @@ export function getAgent(options?: IAgentOptions): TAgent { ...ethrDidResolver({ infuraProjectId: INFURA_PROJECT_ID }), ...webDidResolver(), ...getDidKeyResolver(), + ...getDidPeerResolver(), ...getDidPkhResolver(), ...getDidJwkResolver(), ...new FakeDidResolver(() => agent as TAgent).getDidFakeResolver(), @@ -118,6 +120,9 @@ export function getAgent(options?: IAgentOptions): TAgent { 'did:key': new KeyDIDProvider({ defaultKms: 'local', }), + 'did:peer': new PeerDIDProvider({ + defaultKms: 'local', + }), 'did:pkh': new PkhDIDProvider({ defaultKms: 'local', }), diff --git a/packages/test-react-app/tsconfig.json b/packages/test-react-app/tsconfig.json index aebebc273..0acc3953b 100644 --- a/packages/test-react-app/tsconfig.json +++ b/packages/test-react-app/tsconfig.json @@ -32,6 +32,7 @@ { "path": "../did-provider-ethr" }, { "path": "../did-provider-jwk" }, { "path": "../did-provider-key" }, + { "path": "../did-provider-peer" }, { "path": "../did-provider-pkh" }, { "path": "../did-provider-web" }, { "path": "../did-resolver" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 28b3b05d7..3ba6b53ca 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,8 +18,8 @@ "credential-status": "^2.0.5", "cross-fetch": "^4.0.0", "debug": "^4.3.3", - "did-jwt": "^7.2.5", - "did-jwt-vc": "^3.2.5", + "did-jwt": "^7.4.1", + "did-jwt-vc": "^3.2.10", "did-resolver": "^4.1.0", "ipfs-unixfs": "^11.1.0", "multiformats": "^12.0.1", diff --git a/packages/utils/src/__tests__/did-utils.test.ts b/packages/utils/src/__tests__/did-utils.test.ts index 743beaad3..3726261ea 100644 --- a/packages/utils/src/__tests__/did-utils.test.ts +++ b/packages/utils/src/__tests__/did-utils.test.ts @@ -70,7 +70,7 @@ describe('@veramo/utils did utils', () => { it('should convert to multibase and back', async () => { const publicKeyHex = '6bb3f30242ac89bb6baa169fd5d1fea5adb61ce5b3cfee9e157e699a51983869' - const computedMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'Ed25519') + const computedMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'base58btc', 'ed25519-pub') // // multibase // let expectedMultibase = `z8FRmkyRH9xAsLCk51yXN2Qy6uq4eN4iAesa3v3Hv889v`; @@ -91,16 +91,16 @@ describe('@veramo/utils did utils', () => { it('should convert to multibase and back', async () => { const publicKeyHex = '6bb3f30242ac89bb6baa169fd5d1fea5adb61ce5b3cfee9e157e699a51983869' - const computedMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'Ed25519') + const computedMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'base58btc', 'ed25519-pub') // // multibase + multicodec let expectedMultibase = `z6MkmhgpMDfiVVfLShamhYVCsWX6jQLVmwxXLtUykKFw3LwJ`; expect(computedMultibase).toEqual(expectedMultibase) - const computedXMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'X25519') + const computedXMultibase = bytesToMultibase(hexToBytes(publicKeyHex), 'base58btc', 'x25519-pub') let expectedXMultibase = `z6LSivbwHHE9FQtcRb7qYd3KM1Bakybm4ftKXrHjQVwSqVvg`; - + expect(computedXMultibase).toEqual(expectedXMultibase) const computedHex = extractPublicKeyHex({ diff --git a/packages/utils/src/credential-utils.ts b/packages/utils/src/credential-utils.ts index 1e3aef53b..4af63d415 100644 --- a/packages/utils/src/credential-utils.ts +++ b/packages/utils/src/credential-utils.ts @@ -115,7 +115,7 @@ export function computeEntryHash( * `iss` from a JWT or `issuer`/`issuer.id` from a VC or `holder` from a VP * * @param input - the credential or presentation whose issuer/holder needs to be extracted. - * @param options + * @param options - options for the extraction * removeParameters - Remove all DID parameters from the issuer ID * * @beta This API may change without a BREAKING CHANGE notice. diff --git a/packages/utils/src/did-utils.ts b/packages/utils/src/did-utils.ts index 7e4d52294..24a9d3a97 100644 --- a/packages/utils/src/did-utils.ts +++ b/packages/utils/src/did-utils.ts @@ -2,6 +2,7 @@ import { computePublicKey } from '@ethersproject/signing-key' import { computeAddress } from '@ethersproject/transactions' import { DIDDocumentSection, IAgentContext, IIdentifier, IKey, IResolver } from '@veramo/core-types' import { DIDDocument, VerificationMethod } from 'did-resolver' +import { extractPublicKeyBytes } from 'did-jwt' import { _ExtendedIKey, _ExtendedVerificationMethod, @@ -9,9 +10,8 @@ import { } from './types/utility-types.js' import { isDefined } from './type-utils.js' import Debug from 'debug' -import { base58ToBytes, base64ToBytes, bytesToHex, hexToBytes, multibaseKeyToBytes } from './encodings.js' +import { bytesToHex, hexToBytes } from './encodings.js' import { ed25519 } from '@noble/curves/ed25519' -import { secp256k1 } from '@noble/curves/secp256k1' const debug = Debug('veramo:utils') @@ -162,39 +162,6 @@ export function getEthereumAddress(verificationMethod: VerificationMethod): stri return vmEthAddr } -interface LegacyVerificationMethod extends VerificationMethod { - publicKeyBase64: string -} - -function extractPublicKeyBytes(pk: VerificationMethod): Uint8Array { - if (pk.publicKeyBase58) { - return base58ToBytes(pk.publicKeyBase58) - } else if (pk.publicKeyMultibase) { - return multibaseKeyToBytes(pk.publicKeyMultibase) - } else if ((pk).publicKeyBase64) { - return base64ToBytes((pk).publicKeyBase64) - } else if (pk.publicKeyHex) { - return hexToBytes(pk.publicKeyHex) - } else if ( - pk.publicKeyJwk && - pk.publicKeyJwk.crv === 'secp256k1' && - pk.publicKeyJwk.x && - pk.publicKeyJwk.y - ) { - return secp256k1.ProjectivePoint.fromAffine({ - x: BigInt('0x' + bytesToHex(base64ToBytes(pk.publicKeyJwk.x))), - y: BigInt('0x' + bytesToHex(base64ToBytes(pk.publicKeyJwk.y))), - }).toRawBytes(false) - } else if ( - pk.publicKeyJwk && - (pk.publicKeyJwk.crv === 'Ed25519' || pk.publicKeyJwk.crv === 'X25519') && - pk.publicKeyJwk.x - ) { - return base64ToBytes(pk.publicKeyJwk.x) - } - return new Uint8Array() -} - /** * Extracts the chain ID from a {@link did-resolver#VerificationMethod | verification method} supporting legacy * representations as well. diff --git a/packages/utils/src/encodings.ts b/packages/utils/src/encodings.ts index 3e505f8ad..67d21f7fb 100644 --- a/packages/utils/src/encodings.ts +++ b/packages/utils/src/encodings.ts @@ -1,33 +1,24 @@ import { fromString, toString, concat as concatArrays } from 'uint8arrays' -import { base64, base64url } from 'multiformats/bases/base64' -import { base16, base16upper } from 'multiformats/bases/base16' -import { base10 } from 'multiformats/bases/base10' -import { base58btc } from 'multiformats/bases/base58' +import { + hexToBytes as hexToBytesRaw, + bytesToHex as bytesToHexRaw, + bytesToBase58, + base58ToBytes, + base64ToBytes, + bytesToBase64url, + bytesToMultibase, + multibaseToBytes, +} from 'did-jwt' const u8a = { toString, fromString, concatArrays } -/** - * Converts a Uint8Array to a base64url string - * @param b - the array to be converted - * - * @public - */ -export function bytesToBase64url(b: Uint8Array): string { - return u8a.toString(b, 'base64url') -} - -/** - * Converts a base64url string to the Uint8Array it represents. - * - * @param s - the string to be converted - * - * @throws if the string is not formatted correctly. - * - * @public - */ -export function base64ToBytes(s: string): Uint8Array { - const inputBase64Url = s.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') - return u8a.fromString(inputBase64Url, 'base64url') +export { + bytesToBase58, + base58ToBytes, + bytesToBase64url, + base64ToBytes, + multibaseToBytes, + bytesToMultibase } /** @@ -119,9 +110,7 @@ export function hexToBytes(hexString: string): Uint8Array { if (typeof hexString !== 'string') { throw new Error('illegal_argument: a string must be provided for a hex-string to byte array conversion') } - const noPrefix = hexString.startsWith('0x') ? hexString.substring(2) : hexString - const padded = noPrefix.length % 2 !== 0 ? `0${noPrefix}` : noPrefix - return u8a.fromString(padded.toLowerCase(), 'base16') + return hexToBytesRaw(hexString) } /** @@ -140,100 +129,10 @@ export function bytesToHex(byteArray: Uint8Array, prefix: boolean = false): stri if (!(byteArray instanceof Uint8Array)) { throw new Error('illegal_argument: only byte arrays can be converted to hex encoding') } - const result = u8a.toString(byteArray, 'base16') + const result = bytesToHexRaw(byteArray) return prefix ? `0x${result}` : result } -/** - * Converts a base58 string to the Uint8Array it represents. - * - * @param s - the string to be converted - * - * @throws if the string is not formatted correctly. - * - * @public - */ -export function base58ToBytes(s: string): Uint8Array { - return u8a.fromString(s, 'base58btc') -} - -/** - * Converts a base58 string to the Uint8Array it represents. - * - * @param s - the string to be converted - * - * @throws if the string is not formatted correctly. - * - * @public - */ -export function bytesToBase58(byteArray: Uint8Array): string { - return u8a.toString(byteArray, 'base58btc') -} - -/** - * Converts a multibase string to the Uint8Array it represents. - * - * @param s - the string to be converted - * - * @throws if the string is not formatted correctly. - * - * @public - */ -export function multibaseKeyToBytes(s: string): Uint8Array { - if (s.charAt(0) !== 'z') { - throw new Error('invalid multibase string: string is not base58 encoded (does not start with "z")') - } - const baseDecoder = base58btc.decoder - .or(base10.decoder) - .or(base16.decoder) - .or(base16upper.decoder) - .or(base64.decoder) - .or(base64url.decoder) - const bytes = baseDecoder.decode(s) - - if (bytes.length !== 34) { - throw new Error('invalid multibase string: length is not 34 bytes') - } - - // only ed25519-pub and x25519-pub multicodecs supported now - if (bytes[0] !== 0xed && bytes[0] !== 0xec) { - throw new Error('invalid multibase string: first byte is not 0xed') - } - - if (bytes[1] !== 0x01) { - throw new Error('invalid multibase string: second byte is not 0x01') - } - - return bytes.slice(2) -} - -/** - * Converts a Uint8Array to a multibase string. - * - * @param b - the array to be converted - * @param type - the type of the key to be represented - * - * @throws if the array is not formatted correctly. - * - * @public - */ -export function bytesToMultibase(byteArray: Uint8Array, type: string): string { - if (byteArray.length !== 32) { - throw new Error('invalid byte array: length is not 32 bytes') - } - - const bytes = new Uint8Array(34) - if (type === 'Ed25519') { - bytes[0] = 0xed - } else if (type === 'X25519') { - bytes[0] = 0xec - } - bytes[1] = 0x01 - bytes.set(byteArray, 2) - - return base58btc.encode(bytes) -} - /** * Concatenates a bunch of arrays into one Uint8Array * @param arrays - the arrays to be concatenated diff --git a/packages/utils/src/type-utils.ts b/packages/utils/src/type-utils.ts index 231e409f5..7efa4c190 100644 --- a/packages/utils/src/type-utils.ts +++ b/packages/utils/src/type-utils.ts @@ -42,6 +42,7 @@ export function isIterable(obj: any): obj is Iterable { * @param b - second array * @returns The intersection of the two arrays. * + * @public */ export function intersect(a: T[] | any, b: any[] | any): T[] { const setB = new Set(asArray(b)); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5f7861c9..6c2968951 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,11 +76,11 @@ importers: specifier: 7.0.3 version: 7.0.3 did-jwt: - specifier: 7.3.0 - version: 7.3.0 + specifier: 7.4.1 + version: 7.4.1 did-jwt-vc: - specifier: 3.2.9 - version: 3.2.9 + specifier: 3.2.10 + version: 3.2.10 did-resolver: specifier: 4.1.0 version: 4.1.0 @@ -408,8 +408,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.2.10 + version: 3.2.10 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -513,8 +513,8 @@ importers: specifier: ^2.0.5 version: 2.0.5 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -544,11 +544,11 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 did-jwt-vc: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.2.10 + version: 3.2.10 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -591,8 +591,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.2.10 + version: 3.2.10 typeorm: specifier: ^0.3.17 version: 0.3.17(pg@8.11.2)(sqlite3@5.1.6)(ts-node@10.9.1) @@ -634,8 +634,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.2.10 + version: 3.2.10 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -689,8 +689,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -739,8 +739,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -947,12 +947,6 @@ importers: did-resolver: specifier: ^4.1.0 version: 4.1.0 - multicodec: - specifier: ^3.2.1 - version: 3.2.1 - multiformats: - specifier: ^12.0.1 - version: 12.0.1 devDependencies: '@types/debug': specifier: 4.1.8 @@ -981,12 +975,6 @@ importers: did-resolver: specifier: ^4.1.0 version: 4.1.0 - multicodec: - specifier: ^3.2.1 - version: 3.2.1 - multiformats: - specifier: ^12.0.1 - version: 12.0.1 devDependencies: '@types/debug': specifier: 4.1.8 @@ -1106,8 +1094,8 @@ importers: specifier: ^4.3.4 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 uint8arrays: specifier: ^4.0.6 version: 4.0.6 @@ -1173,8 +1161,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 devDependencies: '@types/debug': specifier: 4.1.8 @@ -1377,8 +1365,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -1431,6 +1419,9 @@ importers: '@veramo/did-provider-key': specifier: workspace:* version: link:../did-provider-key + '@veramo/did-provider-peer': + specifier: workspace:^ + version: link:../did-provider-peer '@veramo/did-provider-pkh': specifier: workspace:* version: link:../did-provider-pkh @@ -1657,11 +1648,11 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^7.2.5 - version: 7.2.5 + specifier: ^7.4.1 + version: 7.4.1 did-jwt-vc: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.2.10 + version: 3.2.10 did-resolver: specifier: ^4.1.0 version: 4.1.0 @@ -7513,7 +7504,6 @@ packages: /@noble/ciphers@0.3.0: resolution: {integrity: sha512-ldbrnOjmNRwFdXcTM6uXDcxpMIFrbzAWNnpBPp4oTJTFF0XByGD6vf45WrehZGXRQTRVV+Zm8YP+EgEf+e4cWA==} - dev: true /@noble/curves@1.1.0: resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} @@ -8496,7 +8486,6 @@ packages: /@scure/base@1.1.3: resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} - dev: true /@scure/bip32@1.3.1: resolution: {integrity: sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==} @@ -13188,21 +13177,12 @@ packages: resolution: {integrity: sha512-KKC7IGwdOr7u9kTGgjUvGTov/z1s2H7oHi3zKCdR9eSDyCPia5CBi4aRhtp7d8uR7l0GS5UTDw3TjKGu5CqINg==} dev: true - /did-jwt-vc@3.2.5: - resolution: {integrity: sha512-FPVW9fRMqQZmDCgoJkj1ZN4v0esLg1BlZRHHqKwTKW8Dg3n1eWvTOxrQlGys8BDlWGDALBw+N2SCM6LYyj7qZg==} + /did-jwt-vc@3.2.10: + resolution: {integrity: sha512-fX4WBcsjwQ3OWj98t6p5iR4bqSS8wgCt1rVJXeL/ZRy4ij4Y+SJOUpwBoMF/t2ziQMwd47XLCCHYfvKerALZjQ==} engines: {node: '>=18'} dependencies: - did-jwt: 7.2.5 + did-jwt: 7.4.1 did-resolver: 4.1.0 - dev: false - - /did-jwt-vc@3.2.9: - resolution: {integrity: sha512-BCBW1hUGb76WY+4ylc0KWQ64HlPQIF5zRKKV/BicikQWm9dbqGMWzPbxvzxdtQ8BHkN4TJmKNR/VmscfbpP0cg==} - engines: {node: '>=18'} - dependencies: - did-jwt: 7.3.0 - did-resolver: 4.1.0 - dev: true /did-jwt@6.11.6: resolution: {integrity: sha512-OfbWknRxJuUqH6Lk0x+H1FsuelGugLbBDEwsoJnicFOntIG/A4y19fn0a8RLxaQbWQ5gXg0yDq5E2huSBiiXzw==} @@ -13220,21 +13200,8 @@ packages: multiformats: 9.9.0 uint8arrays: 3.1.1 - /did-jwt@7.2.5: - resolution: {integrity: sha512-bbkRurNmIOvr9F8cmgOg1oaXEoGUCmi4UttADCFG//JRdN4EhPnvGVfpp3HGnvhw1vIAvhm0rCLPG9HBgQIM4Q==} - dependencies: - '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 - '@stablelib/xchacha20poly1305': 1.0.1 - bech32: 2.0.0 - canonicalize: 2.0.0 - did-resolver: 4.1.0 - multiformats: 12.0.1 - uint8arrays: 4.0.6 - dev: false - - /did-jwt@7.3.0: - resolution: {integrity: sha512-5uZieA76TsrmWRE67qh1JyaRW6GopZxVTlKNy+rBROH7ca214VkLnFfgoxc9sguZkONvDTbUPfiP1xF0+Lckbw==} + /did-jwt@7.4.1: + resolution: {integrity: sha512-gYDbY6KKuKxmcmJvI1u4zS7QDQGz4B4Ak/T/biMMOHNYZZDGDMKXdZYhiCsphqrBvd7j0OZTFK7iAvMgSpB2aw==} dependencies: '@noble/ciphers': 0.3.0 '@noble/curves': 1.1.0 @@ -13244,7 +13211,6 @@ packages: did-resolver: 4.1.0 multiformats: 12.0.1 uint8arrays: 4.0.6 - dev: true /did-resolver@4.1.0: resolution: {integrity: sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==} @@ -14137,7 +14103,7 @@ packages: '@ethersproject/strings': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/wallet': 5.7.0 - did-jwt: 7.2.5 + did-jwt: 7.4.1 did-resolver: 4.1.0 ethr-did-resolver: 8.1.2 transitivePeerDependencies: @@ -19570,14 +19536,6 @@ packages: thunky: 1.1.0 dev: true - /multicodec@3.2.1: - resolution: {integrity: sha512-+expTPftro8VAW8kfvcuNNNBgb9gPeNYV9dn+z1kJRWF2vih+/S79f2RVeIwmrJBUJ6NT9IUPWnZDQvegEh5pw==} - deprecated: This module has been superseded by the multiformats module - dependencies: - uint8arrays: 3.1.1 - varint: 6.0.0 - dev: false - /multiformats@12.0.1: resolution: {integrity: sha512-s01wijBJoDUqESWSzePY0lvTw7J3PVO9x2Cc6ASI5AMZM2Gnhh7BC17+nlFhHKU7dDzaCaRfb+NiqNzOsgPUoQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -25068,10 +25026,6 @@ packages: resolution: {integrity: sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==} dev: false - /varint@6.0.0: - resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} - dev: false - /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'}