DID Recover 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 DID smart contract.

On the SSI 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 DID contract.
  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 DID smart contract.
  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 DID smart contract 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 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. 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 DID contract 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).