As the foundation of the DID system, RootIdentity provides three generation methods:
First, generate the RootIdentity object according to mnemonic and passphrase. Second, generate the RootIdentity object per the extended root private key. Third, generate the RootIdentity object according to that derived root public key.
public static createFromPreDerivedPublicKey( preDerivedPublicKey: string, index: number): RootIdentity;
Mnemonic currently supports mnemonics in nine languages, namely Simplified Chinese, Traditional Chinese, English, French, Italian, Korean, Japanese, Spanish, and Czech.
ExtendedPrivateKey is the base58 string of 82-bit extended root private key, which is convenient for processing without having to expose the private key.
PreDerivedPublicKey is a base58 string of 82-bit derived root public key.
Overwrite indicates whether it's necessary to overwrite the RootIdentity that is already on the local machine. When overwrite is true, then overwrite the existing RootIdentity and return the newly generated RootIdentity object; when overwrite is false, if RootIdentity already exists, throw an exception and return NULL.