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:

  1. Initialize with the Zilliqa network (mainnet or testnet), the user's private key and the gas limit.
  2. Get the user's input regarding cryptographic keys and service endpoints for the DID Document.
  3. Verification methods: With the public key input generate an array of keys, generated using the operation key pair.
  4. Services: An array of endpoints.
  5. With the verification methods and service endpoints, generate a List Document to send to the DID smart contract.
  6. Generate the DID Keys using the KEY_ALGORITH: The update key-pair (necessary for the following Update operation) & the recovery key-pair (needed for any future Recover or Deactivate operation).

    All private keys MUST be in control of the user.

  7. Download, decode (Base64) & decompress the DID-smart-contract code from the INIT.tyron smart contract.

  8. Instantiate the DID contract with the user's Zilliqa address as the contract owner and deploy it on the blockchain.
  9. Call the init transition of the user's DID contract.
  10. 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.
  11. 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:

  1. First, it verifies that the DID Status is initialized by executing the IsRightStatus procedure.
  2. Executes the Payment procedure to make the Self-Sovereign Identity work only if the payment is correct.
  3. Executes the IsRightCaller procedure to verify that the call comes from the user (contract owner address).
  4. 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.
  5. Executes the UpdateDocument procedure to initialize the verification_methods and services map fields.
  6. Applies the IsValidKey procedure to verify that all DID Keys are unique, and then sets the fields did_update_key & did_recovery_key.
  7. Sets the DID Status to Created and saves the blocknumber into the created field.
  8. 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).