Root Identity is the foundation of the DID system, which provides three generation methods. Firstly, generate Root Identity object according to mnemonic and passphrase. Secondly, generate Root Identity object according to the extended root private key/ Thirdly, generate a Root Identity object according to that derive root public key.
The SDK provides two methods to generate Root Identity - the first is to obtain it through mnemonic and passphrase, and the second is to get it by expanding the root private key.
mnemonic currently supports mnemonics in nine languages: Simplified Chinese, Traditional Chinese, English, French, Italian, Korean, Japanese, Spanish, and Czech.
passphrase may not be provided, or it can be an empty string.
extendedprvkey is the base58 string of the 82-bit extended root private key, which is convenient to handle and does not need to expose the naked private key.
overwrite indicates whether it is necessary to overwrite the existing Root Identity locally. When overwrite is true, the existing Root Identity needs to be overwritten and the newly generated Root Identity object is returned. When overwrite is false, if Root Identity already exists, an exception will be thrown, and NULL will be returned.