Skip to content

DID-Recover tyronZIL transaction

It fully resets the user's DID state, so they can keep using the same DID with a brand new public-key-infrastructure (PKI). To be able to execute this operation, the user MUST possess the private did_recovery_key.

Once the operation request is processed, the user as the contract owner MUST call the DidRecover transition of the user's DIDC.

On the DID-Client's side:

  1. Initialize with the Zilliqa network (mainnet or testnet) & the user's domain name.did to fetch the DID contract from the blockchain.
  2. Utilize the user's private did_recovery_key to verify that it corresponds to the public did_recovery_key stored in the DIDC.
  3. Verification methods: With the public key input generate an array of keys, generated using the operation key pair.
  4. Service endpoints: An array of endpoints for the recovered DID.
  5. With the verification methods and service endpoints, generate a new List Document to send to the DIDC.
  6. Hash the document with the HASH_ALGORITHM and sign the hash with the SIGNATURE_ALGORITHM using the did_recovery_keys.
  7. Generate new 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).
  8. Return the new document, Schnorr signature & public DID-Keys.

    All private keys MUST be in control of the user.

  9. Submit the DidRecover tyronZIL transaction with its transition parameters (agent, newDocument, docHash, signature, newUpdateKey and newRecoveryKey). The contract owner MUST call this transition for it to be successful.

On the DID-Smart-Contract's side

When the DidRecover transition gets called, the DIDC proceeds as follows:

  1. First, it verifies that the DID-Status is operational 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. Performs the IsRightSignature procedure to verify that the signature got produced with the did_recovery_keys by applying the Schnorr signature algorithm. For this verification, the DIDC utilizes the public key that it has stored in the did_recovery_key mutable field.
  5. Executes the UpdateDocument procedure to re-initialize the verification_methods and services map fields.
  6. Applies the IsValidKey procedure to verify that all new DID-Keys are unique (and different from before), and then sets the fields did_update_key & did_recovery_key with the new values.
  7. Sets the DID-Status to Recovered.
  8. Emits a "DID_recovered" event & executes the Timestamp procedure.

A DID-Recover tyronZIL transaction consumes approximately 700 units of GAS (1.4 ZIL, currently less than 0.03 USD).