Skip to content

DID-Create tyronZIL transaction

It generates a brand new Decentralized Identifier, its DID-Document and DIDC state, and stores these data in a new DID smart contract (DIDC).

On the DID-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 DIDC.
  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 DIDC-template from the init.tyron smart contract.

  8. Instantiate the DIDC 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 DIDC.
  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 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:

  1. First, it verifies that the DID-Status is initialized by executing the IsRightStatus procedure.
  2. Executes the Payment procedure to make the DIDC 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 DIDC 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 DIDC deployment and initialization) consumes approximately 2,200 units of GAS (4.4 ZIL, currently less than 0.09 USD).