I'm encountering an issue where the publicKey field is not processed correctly during the signing of a W3C JSON-LD Credential. The signing process fails with an error indicating that the verification method is missing the publicKeyBase58. Below are the logs and relevant code snippets:
Error Logs:
Error signing credential: CredoError: verification method is missing publicKeyBase58
at getKeyFromEd25519VerificationKey2018 (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/dids/domain/verificationMethod/Ed25519VerificationKey2018.ts:42:2)
at Object.getKeyFromVerificationMethod (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/dids/domain/key-type/ed25519.ts:36:50)
at getKeyFromVerificationMethod (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/dids/domain/key-type/keyDidMapping.ts:101:17)
at W3cJsonLdCredentialService.getPublicKeyFromVerificationMethod (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/vc/data-integrity/W3cJsonLdCredentialService.ts:346:45)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at W3cJsonLdCredentialService.signCredential (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/vc/data-integrity/W3cJsonLdCredentialService.ts:57:24)
at W3cCredentialService.signCredential (/home/ubu/Escritorio/Workeito/node_modules/@credo-ts/core/src/modules/vc/W3cCredentialService.ts:65:22)
at isscred (/home/ubu/Escritorio/Workeito/src/App/controllers/maincontroller.ts:140:7) {
[cause]: undefined
}
DEBUG: Closing wallet Issuer_Wallet
Even though the publicKey is present in the input DID document, it seems to be missing when the signing function attempts to retrieve it. The issue arises in the following function where it fails to retrieve the public key:
I'm encountering an issue where the
publicKey
field is not processed correctly during the signing of a W3C JSON-LD Credential. The signing process fails with an error indicating that the verification method is missing thepublicKeyBase58
. Below are the logs and relevant code snippets:Error Logs:
Code for Signing the Credential:
Verification Method:
Even though the
publicKey
is present in the input DID document, it seems to be missing when the signing function attempts to retrieve it. The issue arises in the following function where it fails to retrieve the public key:Here is the value of
verificationMethodObject
when running this function, and as you can see, thepublicKey
is missing:Expected Behavior:
The
publicKey
should be included in the verification method object and used in the signing process.Actual Behavior:
The
publicKey
is missing, which causes the signing process to fail with the error message:verification method is missing publicKeyBase58
.