DID-Create tyronZIL transaction
On the DID-Client's side:
- Initialize with the Zilliqa network (mainnet or testnet), the user's private key and the gas limit.
- Get the user's input regarding cryptographic keys and service endpoints for the DID-Document.
- Verification methods: With the public key input generate an array of keys, generated using the operation key pair.
- Services: An array of endpoints.
- With the verification methods and service endpoints, generate a List Document to send to the DIDC.
All private keys MUST be in control of the user.
Download, decode (Base64) & decompress the DIDC-template from the init.tyron smart contract.
- Instantiate the DIDC with the user's Zilliqa address as the contract owner and deploy it on the blockchain.
- Call the Init transition of the user's DIDC.
- Submit the DidCreate tyronZIL transaction with its transition parameters (agent, document, updateKey and recoveryKey). The contract owner MUST call this transition for it to be successful.
- Ask which domain name.did the user would like for their DIDC address and execute the SetSsiDomain transition.
On the DID smart contract's side
When the DidCreate transition gets called, the DIDC proceeds as follows:
- First, it verifies that the DID-Status is initialized by executing the IsRightStatus procedure.
- Executes the Payment procedure to make the DIDC work only if the payment is correct.
- Executes the IsRightCaller procedure to verify that the call comes from the user (contract owner address).
- Executes the DidScheme procedure, which generates the user's Decentralized Identifier according to the DID-Scheme with the DIDC address as the DID-Suffix. This procedure also produces the tyron_hash by applying the HASH_ALGORITH to the DID.
- Executes the UpdateDocument procedure to initialize the verification_methods and services map fields.
- Applies the IsValidKey procedure to verify that all DID-Keys are unique, and then sets the fields did_update_key & did_recovery_key.
- Sets the DID-Status to Created and saves the blocknumber into the created field.
- Executes the Timestamp procedure.
A DID-Create tyronZIL transaction (incl. the DIDC deployment and initialization) consumes approximately 2,200 units of GAS (4.4 ZIL, currently less than 0.09 USD).