diff --git a/examples/CHANGELOG.md b/examples/CHANGELOG.md index 76ad79dbb..c7d4b8091 100644 --- a/examples/CHANGELOG.md +++ b/examples/CHANGELOG.md @@ -1,5 +1,18 @@ # @docknetwork/sdk-examples +## 0.10.0 + +### Minor Changes + +- Legacy documents support for `testnet` + +### Patch Changes + +- Updated dependencies + - @docknetwork/dock-blockchain-modules@0.16.0 + - @docknetwork/dock-blockchain-api@0.12.0 + - @docknetwork/credential-sdk@0.27.0 + ## 0.9.0 ### Minor Changes diff --git a/examples/package.json b/examples/package.json index 6e8f4f302..f92ee578d 100644 --- a/examples/package.json +++ b/examples/package.json @@ -2,7 +2,7 @@ "name": "@docknetwork/sdk-examples", "private": true, "type": "module", - "version": "0.9.0", + "version": "0.10.0", "scripts": { "bbs-dock-example": "babel-node ./bbs-dock.js", "claim-deduction-example": "babel-node ./claim-deduction.js", @@ -19,9 +19,9 @@ "lint": "eslint \"*.js\"" }, "dependencies": { - "@docknetwork/credential-sdk": "0.26.0", - "@docknetwork/dock-blockchain-api": "0.11.0", - "@docknetwork/dock-blockchain-modules": "0.15.0" + "@docknetwork/credential-sdk": "0.27.0", + "@docknetwork/dock-blockchain-api": "0.12.0", + "@docknetwork/dock-blockchain-modules": "0.16.0" }, "devDependencies": { "babel-eslint": "^10.1.0", diff --git a/packages/cheqd-blockchain-api/CHANGELOG.md b/packages/cheqd-blockchain-api/CHANGELOG.md index 1aa5598f7..bb4cb8ec3 100644 --- a/packages/cheqd-blockchain-api/CHANGELOG.md +++ b/packages/cheqd-blockchain-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/cheqd-blockchain-api +## 0.21.0 + +### Minor Changes + +- Legacy documents support for `testnet` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.27.0 + ## 0.20.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-api/package.json b/packages/cheqd-blockchain-api/package.json index 407346ba3..b641745da 100644 --- a/packages/cheqd-blockchain-api/package.json +++ b/packages/cheqd-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-api", - "version": "0.20.0", + "version": "0.21.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -34,7 +34,7 @@ }, "dependencies": { "@cheqd/sdk": "cjs", - "@docknetwork/credential-sdk": "0.26.0" + "@docknetwork/credential-sdk": "0.27.0" }, "devDependencies": { "@babel/cli": "^7.24.1", diff --git a/packages/cheqd-blockchain-modules/CHANGELOG.md b/packages/cheqd-blockchain-modules/CHANGELOG.md index 693293fbe..0e7813a33 100644 --- a/packages/cheqd-blockchain-modules/CHANGELOG.md +++ b/packages/cheqd-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/cheqd-blockchain-modules +## 0.18.0 + +### Minor Changes + +- Legacy documents support for `testnet` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.27.0 + ## 0.17.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-modules/package.json b/packages/cheqd-blockchain-modules/package.json index 9987f788d..3e2fe6b30 100644 --- a/packages/cheqd-blockchain-modules/package.json +++ b/packages/cheqd-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-modules", - "version": "0.17.0", + "version": "0.18.0", "type": "module", "license": "MIT", "main": "./dist/esm/index.js", @@ -33,7 +33,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.26.0" + "@docknetwork/credential-sdk": "0.27.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -42,7 +42,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/cheqd-blockchain-api": "0.20.0", + "@docknetwork/cheqd-blockchain-api": "0.21.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0", diff --git a/packages/cheqd-blockchain-modules/tests/accumulator-module.test.js b/packages/cheqd-blockchain-modules/tests/accumulator-module.test.js index fcf066528..15b766fa1 100644 --- a/packages/cheqd-blockchain-modules/tests/accumulator-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/accumulator-module.test.js @@ -15,7 +15,7 @@ describe("AccumulatorModule", () => { beforeAll(async () => { await cheqd.init({ - url: url, + url, wallet: await faucet.wallet(), network, }); diff --git a/packages/cheqd-blockchain-modules/tests/constants.js b/packages/cheqd-blockchain-modules/tests/constants.js index 5deabea67..441c6d851 100644 --- a/packages/cheqd-blockchain-modules/tests/constants.js +++ b/packages/cheqd-blockchain-modules/tests/constants.js @@ -1,14 +1,17 @@ -import { DirectSecp256k1HdWallet } from '@docknetwork/cheqd-blockchain-api/wallet'; -import { CheqdNetwork } from '@docknetwork/cheqd-blockchain-api'; +import { DirectSecp256k1HdWallet } from "@docknetwork/cheqd-blockchain-api/wallet"; +import { CheqdNetwork } from "@docknetwork/cheqd-blockchain-api"; export const faucet = { prefix: "cheqd", minimalDenom: "ncheq", - mnemonic: process.env.CHEQD_MNEMONIC || + mnemonic: + process.env.CHEQD_MNEMONIC || "steak come surprise obvious remain black trouble measure design volume retreat float coach amused match album moment radio stuff crack orphan ranch dose endorse", async wallet() { - return await DirectSecp256k1HdWallet.fromMnemonic(this.mnemonic, { prefix: this.prefix }) - } + return await DirectSecp256k1HdWallet.fromMnemonic(this.mnemonic, { + prefix: this.prefix, + }); + }, }; export const url = process.env.CHEQD_RPC_URL || "http://localhost:26657"; diff --git a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js index d985a8ff0..bb3fc0508 100644 --- a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js @@ -1,8 +1,4 @@ import { CheqdAPI } from "@docknetwork/cheqd-blockchain-api"; -import { - CheqdTestnetDid, - CheqdOffchainSignatureParamsRef, -} from "@docknetwork/credential-sdk/types"; import generateOffchainSignaturesModuleTests from "@docknetwork/credential-sdk/modules/tests/offchain-signatures-module"; import { MultiApiCoreModules } from "@docknetwork/credential-sdk/modules"; import { faucet, url, network } from "./constants"; diff --git a/packages/cheqd-blockchain-modules/tests/status-list-credential-module.test.js b/packages/cheqd-blockchain-modules/tests/status-list-credential-module.test.js index 74e9daa6e..c80adf36e 100644 --- a/packages/cheqd-blockchain-modules/tests/status-list-credential-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/status-list-credential-module.test.js @@ -1,9 +1,4 @@ import { CheqdAPI } from "@docknetwork/cheqd-blockchain-api"; -import { - CheqdTestnetDid, - CheqdStatusListCredentialId, -} from "@docknetwork/credential-sdk/types"; -import { StatusList2021Credential } from "@docknetwork/credential-sdk/vc"; import { MultiApiStatusListCredentialModule } from "@docknetwork/credential-sdk/modules"; import generateStatusListCredentialModuleTests from "@docknetwork/credential-sdk/modules/tests/status-list-credential-module"; import CheqdDIDModule from "../src/did/module"; diff --git a/packages/credential-sdk/CHANGELOG.md b/packages/credential-sdk/CHANGELOG.md index 3ebd074a6..545479117 100644 --- a/packages/credential-sdk/CHANGELOG.md +++ b/packages/credential-sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/credential-sdk +## 0.27.0 + +### Minor Changes + +- Legacy documents support for `testnet` + ## 0.26.0 ### Minor Changes diff --git a/packages/credential-sdk/package.json b/packages/credential-sdk/package.json index 21ff8d31b..3fb5e063c 100644 --- a/packages/credential-sdk/package.json +++ b/packages/credential-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/credential-sdk", - "version": "0.26.0", + "version": "0.27.0", "license": "MIT", "type": "module", "files": [ diff --git a/packages/credential-sdk/src/types/did/document/verification-method-ref-or-cheqd-verification-method.js b/packages/credential-sdk/src/types/did/document/verification-method-ref-or-cheqd-verification-method.js index c6b2649ff..a60360b97 100644 --- a/packages/credential-sdk/src/types/did/document/verification-method-ref-or-cheqd-verification-method.js +++ b/packages/credential-sdk/src/types/did/document/verification-method-ref-or-cheqd-verification-method.js @@ -2,37 +2,54 @@ import { CheqdVerificationMethodAssertion, CheqdMainnetVerificationMethodAssertion, CheqdTestnetVerificationMethodAssertion, + CheqdVerificationMethodAssertionLegacy, + CheqdTestnetVerificationMethodAssertionLegacy, } from './verification-method'; -import { - CheqdMainnetVerificationMethodRef, - CheqdTestnetVerificationMethodRef, - CheqdVerificationMethodRef, -} from './verification-method-ref'; +import { CheqdVerificationMethodRef } from './verification-method-ref'; import { withFrom } from '../../generic'; export class CheqdVerificationMethodRefOrCheqdVerificationMethod extends withFrom( CheqdVerificationMethodRef, function from(value) { try { - return this.Base.from(value); - } catch (err) { - return this.Or.from(value); + return this.First.from(value); + } catch (firstErr) { + try { + return this.Second.from(value); + } catch (secondErr) { + secondErr.message = `${firstErr.message}; ${secondErr.message}`; + + if (this.Third == null) { + throw secondErr; + } + try { + return this.Third.from(value); + } catch (thirdErr) { + thirdErr.message = `${secondErr.message}; ${thirdErr.message}`; + + throw thirdErr; + } + } } }, ) { - static Base = CheqdVerificationMethodAssertion; + static First = CheqdVerificationMethodAssertion; + + static Second = CheqdVerificationMethodAssertionLegacy; - static Or = CheqdVerificationMethodRef; + static Third = CheqdVerificationMethodRef; } export class CheqdVerificationMethodRefOrCheqdTestnetVerificationMethod extends CheqdVerificationMethodRefOrCheqdVerificationMethod { - static Base = CheqdTestnetVerificationMethodAssertion; + static First = CheqdTestnetVerificationMethodAssertion; + + static Second = CheqdTestnetVerificationMethodAssertionLegacy; - static Or = CheqdTestnetVerificationMethodRef; + static Third = CheqdVerificationMethodRef; } export class CheqdVerificationMethodRefOrCheqdMainnetVerificationMethod extends CheqdVerificationMethodRefOrCheqdVerificationMethod { - static Base = CheqdMainnetVerificationMethodAssertion; + static First = CheqdMainnetVerificationMethodAssertion; - static Or = CheqdMainnetVerificationMethodRef; + static Second = CheqdVerificationMethodRef; } diff --git a/packages/credential-sdk/src/types/did/document/verification-method.js b/packages/credential-sdk/src/types/did/document/verification-method.js index 31c6c9e13..8d665c87b 100644 --- a/packages/credential-sdk/src/types/did/document/verification-method.js +++ b/packages/credential-sdk/src/types/did/document/verification-method.js @@ -337,20 +337,8 @@ export class CheqdTestnetVerificationMethodAssertion extends withProp( option(CheqdTestnetPublicKeyMetadata), ) {} -export class CheqdMainnetVerificationMethodAssertion extends withFrom( - withProp( - withProp( - withProp( - CheqdVerificationMethod, - 'id', - CheqdMainnetVerificationMethodRef, - ), - 'controller', - CheqdMainnetDid, - ), - 'metadata', - option(CheqdMainnetPublicKeyMetadata), - ), +export class CheqdVerificationMethodAssertionLegacy extends withFrom( + CheqdVerificationMethod, (value, from) => { const self = from(value); const verMethod = self.toVerificationMethod(); @@ -397,3 +385,31 @@ export class CheqdMainnetVerificationMethodAssertion extends withFrom( : super.from(obj); } } + +export class CheqdMainnetVerificationMethodAssertion extends withProp( + withProp( + withProp( + CheqdVerificationMethodAssertionLegacy, + 'id', + CheqdMainnetVerificationMethodRef, + ), + 'controller', + CheqdMainnetDid, + ), + 'metadata', + option(CheqdMainnetPublicKeyMetadata), +) {} + +export class CheqdTestnetVerificationMethodAssertionLegacy extends withProp( + withProp( + withProp( + CheqdVerificationMethodAssertionLegacy, + 'id', + CheqdTestnetVerificationMethodRef, + ), + 'controller', + CheqdTestnetDid, + ), + 'metadata', + option(CheqdTestnetPublicKeyMetadata), +) {} diff --git a/packages/credential-sdk/src/types/generic/typed-uuid.js b/packages/credential-sdk/src/types/generic/typed-uuid.js index 0f2776eeb..c851d5273 100644 --- a/packages/credential-sdk/src/types/generic/typed-uuid.js +++ b/packages/credential-sdk/src/types/generic/typed-uuid.js @@ -27,7 +27,14 @@ export default class TypedUUID extends TypedBytes { } static fromDockIdent(dockIdent, prefix = []) { - const prefixBytes = normalizeOrConvertStringToU8a(prefix); + const { CHEQD_MIGRATION_PREFIX } = process.env; + + let prefixBytes = normalizeOrConvertStringToU8a(prefix); + if (CHEQD_MIGRATION_PREFIX) { + prefixBytes = prefixBytes.concat( + normalizeOrConvertStringToU8a(CHEQD_MIGRATION_PREFIX), + ); + } const identBytes = valueNumberOrBytes(dockIdent); const hash = sha256.digest([...prefixBytes, ...identBytes]); diff --git a/packages/credential-sdk/tests/__snapshots__/document.test.js.snap b/packages/credential-sdk/tests/__snapshots__/document.test.js.snap index c998b4ea9..d4efdb084 100644 --- a/packages/credential-sdk/tests/__snapshots__/document.test.js.snap +++ b/packages/credential-sdk/tests/__snapshots__/document.test.js.snap @@ -20,6 +20,25 @@ exports[`DID document workflow \`CheqdDIDDocument\` 1`] = ` `; exports[`DID document workflow \`CheqdDIDDocument\` 2`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [], + "authentication": [], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:testnet:6ec66297-f55e-4744-b8cd-bd043bc45767", + "keyAgreement": [], + "service": [], + "verificationMethod": [], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdDIDDocument\` 3`] = ` { "alsoKnownAs": [], "assertionMethod": [ @@ -64,7 +83,42 @@ exports[`DID document workflow \`CheqdDIDDocument\` 2`] = ` } `; -exports[`DID document workflow \`CheqdDIDDocument\` 3`] = ` +exports[`DID document workflow \`CheqdDIDDocument\` 4`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:testnet:00acfa7c-ba73-4e6d-89d2-80c157b5e25c/resources/00000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + ], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "28edc043-872b-4ab7-9cb8-b01d1bd677c5", +} +`; + +exports[`DID document workflow \`CheqdDIDDocument\` 5`] = ` { "alsoKnownAs": [], "assertionMethod": [ @@ -88,7 +142,7 @@ exports[`DID document workflow \`CheqdDIDDocument\` 3`] = ` "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-5", "metadata": { "curveType": "Bls12381", - "paramsRef": "did:cheqd:testnet:01853a2e-866e-4b66-9965-326c019f039b/resources/01000000-0000-4000-8000-000000000000", + "paramsRef": "did:cheqd:mainnet:01853a2e-866e-4b66-9965-326c019f039b/resources/01000000-0000-4000-8000-000000000000", "participantId": null, }, "publicKeyBase58": "9y4gScRXDQJahd1gKbf1pYf9mwcRKnUqzstR3Bn7ydYz", @@ -110,7 +164,7 @@ exports[`DID document workflow \`CheqdDIDDocument\` 3`] = ` "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-12", "metadata": { "curveType": "Bls12381", - "paramsRef": "did:cheqd:testnet:03c9b4c2-2c2f-4738-b0ad-af605a8233cd/resources/03000000-0000-4000-8000-000000000000", + "paramsRef": "did:cheqd:mainnet:03c9b4c2-2c2f-4738-b0ad-af605a8233cd/resources/03000000-0000-4000-8000-000000000000", "participantId": null, }, "publicKeyBase58": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", @@ -150,49 +204,435 @@ exports[`DID document workflow \`CheqdDIDDocument\` 3`] = ` "verificationMethodType": "Ed25519VerificationKey2018", }, { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-3", - "verificationMaterial": "GxmaKA52SZGQtZS3Usa6Az48gky2AZRKzRKxsXM6ystc", - "verificationMethodType": "Ed25519VerificationKey2018", - }, - { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-4", - "verificationMaterial": "5FBSa4xAs54osiMs75JcepL695v1XhccQmQePBZQaad9", - "verificationMethodType": "Ed25519VerificationKey2018", - }, - { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-6", - "verificationMaterial": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", - "verificationMethodType": "Ed25519VerificationKey2018", + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-3", + "verificationMaterial": "GxmaKA52SZGQtZS3Usa6Az48gky2AZRKzRKxsXM6ystc", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-4", + "verificationMaterial": "5FBSa4xAs54osiMs75JcepL695v1XhccQmQePBZQaad9", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-6", + "verificationMaterial": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-7", + "verificationMaterial": "A462rFkYENhY6kf9zLVPg6qvtQhXJ6RuL8CNdHTWzNqa", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-8", + "verificationMaterial": "Amb3kf4if5Av1sz6UdYtEw2iy6DzufRAtch6hiXEWHcw", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", + "verificationMaterial": "FwUvnTThdnNPv23Rbq2SXtxxYAT21Atvdd1cZBHPYue4", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-10", + "verificationMaterial": "BaGbEav6KzvWhgBWPyZK2vWX5EDDFc4a8rfUwAZ3x8Jn", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "47b4d97b-1ebe-4d81-a3ed-12eb63baaeb9", +} +`; + +exports[`DID document workflow \`CheqdDIDDocument\` 6`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-3", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-6", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-8", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:testnet:00acfa7c-ba73-4e6d-89d2-80c157b5e25c/resources/00000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-5\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"9y4gScRXDQJahd1gKbf1pYf9mwcRKnUqzstR3Bn7ydYz\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:mainnet:01853a2e-866e-4b66-9965-326c019f039b/resources/01000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-11\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"BBF5rtFSaWt4s4PxMEswkothcPJNLhdsQpggZyUozSdZ\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:testnet:0297349a-1977-4401-a947-2587c2f81473/resources/02000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-12\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:mainnet:03c9b4c2-2c2f-4738-b0ad-af605a8233cd/resources/03000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-6", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-7", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", + ], + "capabilityDelegation": [], + "capabilityInvocation": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-4", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-7", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-8", + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", + ], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [ + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "did:cheqd:testnet:df3ba823-c1e2-46e0-bb54-056f9c506e90", + ], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-10", + ], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-3", + "verificationMaterial": "GxmaKA52SZGQtZS3Usa6Az48gky2AZRKzRKxsXM6ystc", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-4", + "verificationMaterial": "5FBSa4xAs54osiMs75JcepL695v1XhccQmQePBZQaad9", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-6", + "verificationMaterial": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-7", + "verificationMaterial": "A462rFkYENhY6kf9zLVPg6qvtQhXJ6RuL8CNdHTWzNqa", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-8", + "verificationMaterial": "Amb3kf4if5Av1sz6UdYtEw2iy6DzufRAtch6hiXEWHcw", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", + "verificationMaterial": "FwUvnTThdnNPv23Rbq2SXtxxYAT21Atvdd1cZBHPYue4", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-10", + "verificationMaterial": "BaGbEav6KzvWhgBWPyZK2vWX5EDDFc4a8rfUwAZ3x8Jn", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "47b4d97b-1ebe-4d81-a3ed-12eb63baaeb9", +} +`; + +exports[`DID document workflow \`CheqdMainnetDIDDocument\` 1`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "metadata": { + "curveType": "Bls12381", + "paramsRef": "did:cheqd:mainnet:00acfa7c-ba73-4e6d-89d2-80c157b5e25c/resources/00000000-0000-4000-8000-000000000000", + "participantId": null, + }, + "verificationMaterial": "CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP", + "verificationMethodType": "Bls12381BBSVerificationKeyDock2023", + }, + ], + "authentication": [ + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "verificationMaterial": "11111111111111111111111111111111", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdMainnetDIDDocument\` 2`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + ""{\\"id\\":\\"did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"controller\\":\\"did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"verificationMethodType\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"verificationMaterial\\":\\"Px8b9bKxU5BC8RxPofE4eUMze5uUMnYg4ib1QLw7oPKTDX9nFeVE9tmHLNCfneuzWFoTB5kfy2YpC8tmNY9AQxwsGujLwE3Rb39pkXCYp6e8jMANnNTmzMQBvhr4wxcwrTcAHUGH1PX8tYoqZbQhMvvC1PrevPqV7MbKaGvhm5mL3WJVMYQkNNhzxeo1wVBZmwH3DzGgGoJ9CfWFVwVLFZ7HT45siEAWpiNGdue3MkuYeM2tW2h2HCXex8SdBBKrbvhFqJtnH6c1z26Hte47kWELTJVmKEoTKLgjLATeeoXnF7TvRh3RSQPNASEQJMAKPiXHyYsgey1yL2np\\"}"", + ], + "authentication": [ + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "verificationMaterial": "11111111111111111111111111111111", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 1`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "metadata": { + "curveType": "Bls12381", + "paramsRef": "did:cheqd:testnet:00acfa7c-ba73-4e6d-89d2-80c157b5e25c/resources/00000000-0000-4000-8000-000000000000", + "participantId": null, + }, + "publicKeyBase58": "CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 2`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP\\",\\"metadata\\":{\\"paramsRef\\":\\"did:cheqd:testnet:00acfa7c-ba73-4e6d-89d2-80c157b5e25c/resources/00000000-0000-4000-8000-000000000000\\",\\"curveType\\":\\"Bls12381\\",\\"participantId\\":null}}"", + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 3`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "publicKeyBase58": "CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 4`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + ""{\\"id\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"type\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"controller\\":\\"did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"publicKeyBase58\\":\\"CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP\\"}"", + ], + "authentication": [ + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ + { + "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "verificationMethodType": "Ed25519VerificationKey2018", + }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 5`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + { + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "verificationMaterial": "CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP", + "verificationMethodType": "Bls12381BBSVerificationKeyDock2023", }, + ], + "authentication": [ + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-7", - "verificationMaterial": "A462rFkYENhY6kf9zLVPg6qvtQhXJ6RuL8CNdHTWzNqa", + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", "verificationMethodType": "Ed25519VerificationKey2018", }, { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-8", - "verificationMaterial": "Amb3kf4if5Av1sz6UdYtEw2iy6DzufRAtch6hiXEWHcw", + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "verificationMaterial": "11111111111111111111111111111111", "verificationMethodType": "Ed25519VerificationKey2018", }, + ], + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", +} +`; + +exports[`DID document workflow \`CheqdTestnetDIDDocument\` 6`] = ` +{ + "alsoKnownAs": [], + "assertionMethod": [ + ""{\\"id\\":\\"did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2\\",\\"controller\\":\\"did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54\\",\\"verificationMethodType\\":\\"Bls12381BBSVerificationKeyDock2023\\",\\"verificationMaterial\\":\\"CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP\\"}"", + ], + "authentication": [ + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + ], + "capabilityDelegation": [], + "capabilityInvocation": [], + "context": [ + "https://www.w3.org/ns/did/v1", + ], + "controller": [], + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "keyAgreement": [], + "service": [], + "verificationMethod": [ { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-9", - "verificationMaterial": "FwUvnTThdnNPv23Rbq2SXtxxYAT21Atvdd1cZBHPYue4", + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-1", + "verificationMaterial": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", "verificationMethodType": "Ed25519VerificationKey2018", }, { - "controller": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", - "id": "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-10", - "verificationMaterial": "BaGbEav6KzvWhgBWPyZK2vWX5EDDFc4a8rfUwAZ3x8Jn", + "controller": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + "id": "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54#keys-2", + "verificationMaterial": "11111111111111111111111111111111", "verificationMethodType": "Ed25519VerificationKey2018", }, ], - "versionId": "47b4d97b-1ebe-4d81-a3ed-12eb63baaeb9", + "versionId": "0557d7da-8dea-45cb-8f30-7370b59eab71", } `; @@ -244,6 +684,25 @@ exports[`DID document workflow \`DIDDocument\` 1`] = ` `; exports[`DID document workflow \`DIDDocument\` 2`] = ` +{ + "@context": [ + "https://www.w3.org/ns/did/v1", + ], + "alsoKnownAs": [], + "assertionMethod": [], + "authentication": [], + "capabilityDelegation": [], + "capabilityInvocation": [], + "controller": [], + "https://rdf.dock.io/alpha/2021#attestsDocumentContents": null, + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "keyAgreement": [], + "service": [], + "verificationMethod": [], +} +`; + +exports[`DID document workflow \`DIDDocument\` 3`] = ` { "@context": [ "https://www.w3.org/ns/did/v1", @@ -399,7 +858,174 @@ exports[`DID document workflow \`DIDDocument\` 2`] = ` } `; -exports[`DID document workflow \`DIDDocument\` 3`] = ` +exports[`DID document workflow \`DIDDocument\` 4`] = ` +{ + "@context": [ + "https://www.w3.org/ns/did/v1", + ], + "alsoKnownAs": [], + "assertionMethod": [ + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-2", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-3", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-5", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-6", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-8", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-9", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-11", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-12", + ], + "authentication": [ + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-1", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-6", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-7", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-9", + ], + "capabilityDelegation": [], + "capabilityInvocation": [ + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-4", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-7", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-8", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-9", + ], + "controller": [ + "did:key:z6MktvqCyLxTsXUH1tUZncNdVeEZ7hNh7npPRbUU27GTrYb8", + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + ], + "https://rdf.dock.io/alpha/2021#attestsDocumentContents": null, + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "keyAgreement": [ + "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-10", + ], + "service": [], + "verificationMethod": [ + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-1", + "publicKeyBase58": "Bt5Mafvpcqou1pBF8SnW1BJMvpkSzZnPEgWunTUFwHZm", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-2", + "metadata": { + "curveType": "Bls12381", + "paramsRef": [ + "did:dock:5GdBBJdo3EWbbVpehRMUkGqfyEm7TJ7ugGCoPKNXzqrgPQqT", + 0, + ], + "participantId": null, + }, + "publicKeyBase58": "CeEf4Q1kvLo66eSbTSujuasf2mv1rTQEpK8rnuyqMxpP", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-3", + "publicKeyBase58": "GxmaKA52SZGQtZS3Usa6Az48gky2AZRKzRKxsXM6ystc", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-4", + "publicKeyBase58": "5FBSa4xAs54osiMs75JcepL695v1XhccQmQePBZQaad9", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-5", + "metadata": { + "curveType": "Bls12381", + "paramsRef": [ + "did:dock:5GdBBJdo3EWbbVpehRMUkGqfyEm7TJ7ugGCoPKNXzqrgPQqT", + 1, + ], + "participantId": null, + }, + "publicKeyBase58": "9y4gScRXDQJahd1gKbf1pYf9mwcRKnUqzstR3Bn7ydYz", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-6", + "publicKeyBase58": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-7", + "publicKeyBase58": "A462rFkYENhY6kf9zLVPg6qvtQhXJ6RuL8CNdHTWzNqa", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-8", + "publicKeyBase58": "Amb3kf4if5Av1sz6UdYtEw2iy6DzufRAtch6hiXEWHcw", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-9", + "publicKeyBase58": "FwUvnTThdnNPv23Rbq2SXtxxYAT21Atvdd1cZBHPYue4", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-10", + "publicKeyBase58": "BaGbEav6KzvWhgBWPyZK2vWX5EDDFc4a8rfUwAZ3x8Jn", + "type": "Ed25519VerificationKey2018", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-11", + "metadata": { + "curveType": "Bls12381", + "paramsRef": [ + "did:dock:5GdBBJdo3EWbbVpehRMUkGqfyEm7TJ7ugGCoPKNXzqrgPQqT", + 2, + ], + "participantId": null, + }, + "publicKeyBase58": "BBF5rtFSaWt4s4PxMEswkothcPJNLhdsQpggZyUozSdZ", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + { + "controller": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk#keys-12", + "metadata": { + "curveType": "Bls12381", + "paramsRef": [ + "did:dock:5GdBBJdo3EWbbVpehRMUkGqfyEm7TJ7ugGCoPKNXzqrgPQqT", + 3, + ], + "participantId": null, + }, + "publicKeyBase58": "EaNp37NGpe8KViTKxAdknyvUP44doH1fHnFpYqEcfUjE", + "type": "Bls12381BBSVerificationKeyDock2023", + }, + ], +} +`; + +exports[`DID document workflow \`DIDDocument\` 5`] = ` +{ + "@context": [ + "overriden", + ], + "alsoKnownAs": [], + "assertionMethod": [], + "authentication": [], + "capabilityDelegation": [], + "capabilityInvocation": [], + "controller": [], + "https://rdf.dock.io/alpha/2021#attestsDocumentContents": null, + "id": "did:dock:5DEHasvC9G3eVF3qCsN2VQvEbHYdQtsv74ozZ1ngQQj39Luk", + "keyAgreement": [], + "service": [], + "verificationMethod": [], +} +`; + +exports[`DID document workflow \`DIDDocument\` 6`] = ` { "@context": [ "overriden", diff --git a/packages/credential-sdk/tests/document.test.js b/packages/credential-sdk/tests/document.test.js index b83a565f7..a947037b6 100644 --- a/packages/credential-sdk/tests/document.test.js +++ b/packages/credential-sdk/tests/document.test.js @@ -2,11 +2,15 @@ import { VerificationRelationship, DidKey, CheqdTestnetDid, - DockDid, DockDidValue, CheqdTestnetDidValue, + CheqdMainnetDidValue, } from "../src/types/did"; -import { DIDDocument } from "../src/types/did/document"; +import { + CheqdMainnetDIDDocument, + CheqdTestnetDIDDocument, + DIDDocument, +} from "../src/types/did/document"; import { PublicKeyEd25519, BBSPublicKey, @@ -15,7 +19,7 @@ import { CheqdOffchainSignatureParamsRef, } from "../src/types"; import { TypedUUID } from "../src/types/generic"; -import { hexToU8a } from "../src/utils"; +import { hexToU8a, maybeToCheqdPayloadOrJSON } from "../src/utils"; const RANDOM_PKS = [ "0xa1aa6a2058dd190e284a64e72adaf4e16a9ae9fbf0673d7575924e6aca3b21dc", @@ -49,7 +53,7 @@ const DOCK_OFFCHAIN_PKS = RANDOM_OFFCHAIN_PKS.map( ) ); -const CHEQD_OFFCHAIN_PKS = RANDOM_OFFCHAIN_PKS.map( +const CHEQD_TESTNET_OFFCHAIN_PKS = RANDOM_OFFCHAIN_PKS.map( (bytes, idx) => new BBSPublicKey( new BBSPublicKeyValue( @@ -62,6 +66,19 @@ const CHEQD_OFFCHAIN_PKS = RANDOM_OFFCHAIN_PKS.map( ) ); +const CHEQD_MAINNET_OFFCHAIN_PKS = RANDOM_OFFCHAIN_PKS.map( + (bytes, idx) => + new BBSPublicKey( + new BBSPublicKeyValue( + bytes, + new CheqdOffchainSignatureParamsRef( + CheqdMainnetDidValue.fromBytesAdapt([idx, ...hexToU8a(bytes)]), + TypedUUID.fromBytesAdapt([idx]) + ) + ) + ) +); + const catchErrorWith = (fn, message) => { try { return fn(); @@ -86,6 +103,14 @@ const checkDoc = (doc) => { () => expect(newDoc.toJSON()).toEqual(jsonDoc), "Failed equality check" ); + const cheqdPayloadDoc = catchErrorWith( + () => maybeToCheqdPayloadOrJSON(doc), + "Failed `toCheqdPayload` conversion" + ); + catchErrorWith( + () => expect(cheqdPayloadDoc).toMatchSnapshot(), + "Failed cheqd payload snapshot check" + ); }; const checkDocs = (...docs) => { @@ -179,14 +204,14 @@ describe("DID document workflow", () => { const doc2 = DIDDocument.create( cheqdDid, - [new DidKey(RANDOM_PKS[0]), new DidKey(CHEQD_OFFCHAIN_PKS[0])], + [new DidKey(RANDOM_PKS[0]), new DidKey(CHEQD_TESTNET_OFFCHAIN_PKS[0])], [cheqdDid], [] ).toCheqd(void 0, "28edc043-872b-4ab7-9cb8-b01d1bd677c5"); const doc2DIDDocument = DIDDocument.create( cheqdDid, - [new DidKey(RANDOM_PKS[0]), new DidKey(CHEQD_OFFCHAIN_PKS[0])], + [new DidKey(RANDOM_PKS[0]), new DidKey(CHEQD_TESTNET_OFFCHAIN_PKS[0])], [cheqdDid], [] ); @@ -196,17 +221,17 @@ describe("DID document workflow", () => { "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", [ new DidKey(RANDOM_PKS[0], AUTH), - new DidKey(CHEQD_OFFCHAIN_PKS[0]), + new DidKey(CHEQD_TESTNET_OFFCHAIN_PKS[0]), new DidKey(RANDOM_PKS[1], ASSERT), new DidKey(RANDOM_PKS[2], CAP_INV), - new DidKey(CHEQD_OFFCHAIN_PKS[1]), + new DidKey(CHEQD_MAINNET_OFFCHAIN_PKS[1]), new DidKey(RANDOM_PKS[3], AUTH | ASSERT), new DidKey(RANDOM_PKS[4], AUTH | CAP_INV), new DidKey(RANDOM_PKS[5], ASSERT | CAP_INV), new DidKey(RANDOM_PKS[6], AUTH | ASSERT | CAP_INV), new DidKey(RANDOM_PKS[7], KEY_AGR), - new DidKey(CHEQD_OFFCHAIN_PKS[2]), - new DidKey(CHEQD_OFFCHAIN_PKS[3]), + new DidKey(CHEQD_TESTNET_OFFCHAIN_PKS[2]), + new DidKey(CHEQD_MAINNET_OFFCHAIN_PKS[3]), ], [ "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", @@ -217,4 +242,43 @@ describe("DID document workflow", () => { checkDocs(doc1, doc2, doc3); }); + + test(`\`CheqdTestnetDIDDocument\``, () => { + const testnetDoc = DIDDocument.create( + "did:cheqd:testnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + [ + new DidKey(RANDOM_PKS[0], AUTH), + new DidKey(CHEQD_TESTNET_OFFCHAIN_PKS[0]), + ] + ).toCheqd(CheqdTestnetDIDDocument, "0557d7da-8dea-45cb-8f30-7370b59eab71"); + + const legacyDoc = DIDDocument.create( + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + [ + new DidKey(RANDOM_PKS[0], AUTH), + new DidKey( + new BBSPublicKey(new BBSPublicKeyValue(RANDOM_OFFCHAIN_PKS[0])) + ), + ] + ).toCheqd(CheqdMainnetDIDDocument, "0557d7da-8dea-45cb-8f30-7370b59eab71"); + const strLegacyDoc = JSON.stringify( + maybeToCheqdPayloadOrJSON(legacyDoc) + ).replace(/mainnet/g, "testnet"); + + const fromLegacy = CheqdTestnetDIDDocument.from(JSON.parse(strLegacyDoc)); + + checkDocs(testnetDoc, fromLegacy, legacyDoc); + }); + + test(`\`CheqdMainnetDIDDocument\``, () => { + const mainnetDoc = DIDDocument.create( + "did:cheqd:mainnet:f1749383-d9dd-479f-82aa-e52fe8f59c54", + [ + new DidKey(RANDOM_PKS[0], AUTH), + new DidKey(CHEQD_MAINNET_OFFCHAIN_PKS[0]), + ] + ).toCheqd(CheqdMainnetDIDDocument, "0557d7da-8dea-45cb-8f30-7370b59eab71"); + + checkDoc(mainnetDoc); + }); }); diff --git a/packages/dock-blockchain-api/CHANGELOG.md b/packages/dock-blockchain-api/CHANGELOG.md index 709fa2ab8..a44f7c9cc 100644 --- a/packages/dock-blockchain-api/CHANGELOG.md +++ b/packages/dock-blockchain-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-api +## 0.12.0 + +### Minor Changes + +- Legacy documents support for `testnet` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.27.0 + ## 0.11.0 ### Minor Changes diff --git a/packages/dock-blockchain-api/package.json b/packages/dock-blockchain-api/package.json index 763857242..d761d598b 100644 --- a/packages/dock-blockchain-api/package.json +++ b/packages/dock-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-api", - "version": "0.11.0", + "version": "0.12.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -89,7 +89,7 @@ "@polkadot/api": "10.12.4" }, "dependencies": { - "@docknetwork/credential-sdk": "0.26.0", + "@docknetwork/credential-sdk": "0.27.0", "@docknetwork/node-types": "^0.17.0", "@juanelas/base64": "^1.0.5", "@polkadot/api": "10.12.4", diff --git a/packages/dock-blockchain-modules/CHANGELOG.md b/packages/dock-blockchain-modules/CHANGELOG.md index ec0d45e04..83e2d5749 100644 --- a/packages/dock-blockchain-modules/CHANGELOG.md +++ b/packages/dock-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-modules +## 0.16.0 + +### Minor Changes + +- Legacy documents support for `testnet` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.27.0 + ## 0.15.0 ### Minor Changes diff --git a/packages/dock-blockchain-modules/package.json b/packages/dock-blockchain-modules/package.json index 5526de7f7..5cec4ac3b 100644 --- a/packages/dock-blockchain-modules/package.json +++ b/packages/dock-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-modules", - "version": "0.15.0", + "version": "0.16.0", "license": "MIT", "type": "module", "main": "./dist/esm/index.js", @@ -33,7 +33,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.26.0" + "@docknetwork/credential-sdk": "0.27.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -42,7 +42,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/dock-blockchain-api": "0.11.0", + "@docknetwork/dock-blockchain-api": "0.12.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0",