Closed francesco-plt closed 1 year ago
Try to use 1337
instead of "0x539"
for chainId in your providerConfig:
const providerConfig = {
"networks": [{
name: '0x539',
chainId: 1337,
rpcUrl: 'http://127.0.0.1:8545',
registry: contractAddress // address printed by hardhat when I deployed EthereumDIDRegistry.sol
}]
}
const issuerDid = "did:ethr:0x539:..."
const resolver = new Resolver(getResolver(providerConfig))
const issuerDoc = await didResolver.resolve(issuerDid)
Try to use
1337
instead of"0x539"
for chainId in your providerConfig:const providerConfig = { "networks": [{ name: '0x539', chainId: 1337, rpcUrl: 'http://127.0.0.1:8545', registry: contractAddress // address printed by hardhat when I deployed EthereumDIDRegistry.sol }] } const issuerDid = "did:ethr:0x539:..." const resolver = new Resolver(getResolver(providerConfig)) const issuerDoc = await didResolver.resolve(issuerDid)
I get the same error. From the issue message:
Expected Behavior
The verification function should go ahead and perform the verification without issues. The error related to the resolution of the DID document makes no sense because the resolver is able to correctly resolve the DID and retrieve the document. If I run the following:
const providerConfig = { "networks": [{ name: '0x539', chainId: 0x539, rpcUrl: 'http://127.0.0.1:8545', registry: contractAddress // address printed by hardhat when I deployed EthereumDIDRegistry.sol }] } const issuerDid = "did:ethr:0x539:..." const resolver = new Resolver(getResolver(providerConfig)) const issuerDoc = await didResolver.resolve(issuerDid)
The document is retrieved correctly. Moreover, if I break at the line specified by the error, and I modify the calling funcion inside
did-jwt/lib/index.module.js
atresolveAuthenticator
as follows:const resolveAuthenticator = function (resolver, alg, issuer, proofPurpose) { // custom code to test resolver behaviour let result; resolver.resolve("did:ethr:0x539:...").then((data) => { result = data; console.log(JSON.stringify(result)); }).catch((error) => { console.error(error); }); // actual code of the function
The correct document is printed in the console. I suspect that this is a bug in the library.
The actual line in the library is the following one: https://github.com/decentralized-identity/did-jwt/blob/d898aa613a856cc7d3b2f2cc70ce4d8452b4e667/src/JWT.ts#L440
The error you posted is coming from ethr-did-resolver
.
If the document is printed it means it was already resolved by the ethr-did-resolver
so if you're getting the same error it means that your new configuration is not the one throwing the error.
Please rebuild your project.
The error you posted is coming from
ethr-did-resolver
.If the document is printed it means it was already resolved by the
ethr-did-resolver
so if you're getting the same error it means that your new configuration is not the one throwing the error.Please rebuild your project.
I can confirm that by rebuilding and switching library versions I got it to verify succesfully without verification issues.
Note: this error happens when I use the
did-jwt-vc
library, but since the error itself happens inside thedid-jwt
library I opened the same issue in both repositories. I am trying to issue and verify VCs usingEthrDID
objects anddid-jwt-vc
library to sign and verify. I have create anissuer
and asub
object as follows:The chain ID is
0x539
because I am deploying a local network with hardhat. Then I issue a VC:And I verify it:
Current Behavior
The library crashes with error:
Expected Behavior
The verification function should go ahead and perform the verification without issues. The error related to the resolution of the DID document makes no sense because the resolver is able to correctly resolve the DID and retrieve the document. If I run the following:
The document is retrieved correctly. Moreover, if I break at the line specified by the error, and I modify the calling funcion inside
did-jwt/lib/index.module.js
atresolveAuthenticator
as follows:The correct document is printed in the console. I suspect that this is a bug in the library.
Failure Information
I am using those versions of the libraries: