Identity Management
Identities represent users via DIDs on the SELF network.
Ensure that Keymaster is installed, initialized, and started as described in the Keymaster installation documentation before creating a schema.
Create a new identity with an initialized keymaster by simply passing in a name. The name is public on the SELF network:
await Keymaster.createId({ name: "Paul Revere" });
The identity is stored in the keymaster and is saved via the keymaster wallet config's saveWallet function.
Select an identity
To select an identity, use the selectId function with the DID of the identity you want to select.
const identityDID =
"did:test:z3v8AuagJiXARFGw3B8Mc6DrLBC2thMzjgeUZWQvHcyPVBxAYZv";
await Keymaster.selectId(identityDID);
The selected identity will be used for all subsequent operations until another identity is selected.
Get a DID Document
To get the DID document of an identity, use the resolveDID function with the DID of the identity you want to resolve.
const identityDID =
"did:test:z3v8AuagJiXARFGw3B8Mc6DrLBC2thMzjgeUZWQvHcyPVBxAYZv";
const didDocument = await Keymaster.resolveDID(identityDID);
Delete an Identity
To delete an identity, use the removeId function with the DID of the identity you want to delete.
const identityDID =
"did:test:z3v8AuagJiXARFGw3B8Mc6DrLBC2thMzjgeUZWQvHcyPVBxAYZv";
await Keymaster.removeId(identityDID);
This will remove the identity from the keymaster and delete the associated DID document from the SELF network.