Hi guys,
How do I create an instance of DID and authenticate it if I have the did string (e.g: did:key:z6Mkf6nQra6iJRC1p345uXfgnPUwm6Jgxj4yFrZ6DPxGwzcp)
this code from the documentation works, but how do I authenticate it? Thank you
// `seed` must be a 32-byte long Uint8Array
import { DID } from 'dids'
import { getResolver } from 'key-did-resolver'
// See https://github.com/decentralized-identity/did-resolver
const did = new DID({ resolver: getResolver() })
// Resolve a DID document
await did.resolve('did:key:...')
I’m new to this kind of stuff. Could you suggest which library or function I should use for this line? I checked the getAuthMethod , but the first parameter type is ‘any,’ so I have no direction on where to look. I’m using node-express environment. Thanks again!
// import/get your web3 eth provider
const ethProvider =...
You might also find our Walletconnect tutorial useful if you’re looking to work with did:pkh and user sessions and use the wallet client provided by web3modal.
In your case, you could simply use window.ethereum for your ethProvider.