DID Create transaction
It generates a brand new Self-Sovereign Identity out of the DID smart contract code. It defines the Decentralized Identifier, its DID Document and DID State.
On the SSI 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 DID smart contract.
All private keys MUST be in control of the user.
Download, decode (Base64) & decompress the DID-smart-contract code from the INIT.tyron smart contract.
- Instantiate the DID contract with the user's Zilliqa address as the contract owner and deploy it on the blockchain.
- Call the Init transition of the user's DID contract.
- 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 DID contract address and execute the SetSsiDomain transition.
On the DID smart contract's side
When the DidCreate transition gets called, the DID smart contract proceeds as follows:
- First, it verifies that the DID Status is initialized by executing the IsRightStatus procedure.
- Executes the Payment procedure to make the Self-Sovereign Identity 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 DID contract 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 DID smart contract deployment and initialization) consumes approximately 2,200 units of GAS (4.4 ZIL).