decentralized-identity / veramo

A JavaScript Framework for Verifiable Data
https://veramo.io
Apache License 2.0
415 stars 129 forks source link

[bug] did-provider-key is creating unusual DIDs for Secp256k1 keys #1213

Closed mirceanis closed 11 months ago

mirceanis commented 11 months ago

Bug severity 3

Describe the bug The @veramo/did-provider-key package is creating unusual keys, starting with did:key:z7r8... instead of did:key:zQ3s...

To Reproduce

const identifier = agent.didManagerCreate({provider: 'did:key', options: { keyType: 'Secp256k1'}})
console.log(identifier.did)
// prints did:key:z7r8...

agent.resolveDid({didUrl: identifier.did})
// throws unsupported key type

Details Some DID resolvers, including the one provided in @veramo/did-provider-key fail to resolve these DIDs since they match by prefix. This seems to be caused by the fact that the Secp256k1 keys internally managed by Veramo (in kms-local) are uncompressed.

Versions (please complete the following information):