You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Credential EIP712 plugin is not compatible with every DID method. It works fine with did:ethr, but when tried to use did:key it did not work. Same error happens during verification of VPs where holder is did:key.
To Reproduce
Steps to reproduce the behaviour
Generating VP:
Import a did:key did using agent.didManagerImport(...) (Provider of keys is MetaMask)
createVerifiablePresentation (EIP712) with said did
"Recovered address does not match issuer" error is thrown.
Observed behaviour
I think the error comes from the getEthereumAddress function. This function is trying to find blockchainAccountId, which is missing from the verificationMethods of did:key did document (and potentially documents generated by other did methods).
Another issue might come from the fact that compareBlockchainAccountId function from did-utils has hardcoded EcdsaSecp256k1RecoveryMethod2020, while did:key resolver uses EcdsaSecp256k1VerificationMethod2019 and from my understanding, those two methods should be interchangeable/compatible.
I was able to bypass the issue when generating a VP, by generating a custom DID document for did:key, that adds an additional property blockchainAccountId: + address + '@eip155:4', to the verification method.
getEthereumAddress function 'could' be fixed by adding various methods that transform publicKeyHex/publicKeyBase58 into blockchainAddress.
Expected behaviour
Credential EIP712 should work with every DID method capable of expressing secp256k1/Ethereum address
Additional context
This error was observed in a MetaMask snaps application, where a very lightweight implementation of did-key-resolver and did-key-provider was used instead of @veramo/did-provider-key. Resulting did document is identical to the one generated with @veramo/did-provider-key.
Versions (please complete the following information):
Veramo: next
Node Version: 16
The text was updated successfully, but these errors were encountered:
We could either export that method from did-jwt and bubble up a new release from there or duplicate the relevant bits of it here until it becomes available from there.
Bug severity
3
Describe the bug
Credential EIP712 plugin is not compatible with every DID method. It works fine with did:ethr, but when tried to use did:key it did not work. Same error happens during verification of VPs where holder is did:key.
To Reproduce
Steps to reproduce the behaviour
Generating VP:
Verifying VP:
Observed behaviour
I think the error comes from the
getEthereumAddress
function. This function is trying to findblockchainAccountId
, which is missing from theverificationMethods
of did:key did document (and potentially documents generated by other did methods).Another issue might come from the fact that
compareBlockchainAccountId
function fromdid-utils
has hardcodedEcdsaSecp256k1RecoveryMethod2020
, while did:key resolver usesEcdsaSecp256k1VerificationMethod2019
and from my understanding, those two methods should be interchangeable/compatible.I was able to bypass the issue when generating a VP, by generating a custom DID document for did:key, that adds an additional property
blockchainAccountId: + address + '@eip155:4',
to the verification method.getEthereumAddress
function 'could' be fixed by adding various methods that transform publicKeyHex/publicKeyBase58 into blockchainAddress.Expected behaviour
Credential EIP712 should work with every DID method capable of expressing secp256k1/Ethereum address
Additional context
This error was observed in a MetaMask snaps application, where a very lightweight implementation of did-key-resolver and did-key-provider was used instead of
@veramo/did-provider-key
. Resulting did document is identical to the one generated with@veramo/did-provider-key
.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: