Create identity
Important
Before you create identity please ensure you have defined the functions to implement data storage, credential wallet, and identity wallet.
First an Issuer must create their own Identity from which they can issue credentials to others. We do this through the initialisation step below.
Initialisation¶
const { identityWallet, credentialWallet, dataStorage } =
await initInMemoryDataStorageAndWallets();
const { did } = await identityWallet.createIdentity({
method: core.DidMethod.Iden3,
blockchain: core.Blockchain.Polygon,
networkId: core.NetworkId.Mumbai,
revocationOpts: {
type: CredentialStatusType.Iden3ReverseSparseMerkleTreeProof,
id: process.env.RHS_URL as string,
},
});
Sample Issuer DID
{
"payload": {
"method": "iden3",
"id": "polygon:mumbai:x32x9zKVv8mxno2EE6DiP7YeKSxhQbeHL4p7GbDAM",
"idStrings": [
"polygon",
"mumbai",
"x32x9zKVv8mxno2EE6DiP7YeKSxhQbeHL4p7GbDAM"
],
"params": [],
"path": "",
"pathSegments": [],
"query": "",
"fragment": ""
}
}