Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: createDID, deactivateDID, updateDID RPCs #338

Merged
merged 3 commits into from
Mar 15, 2023

Conversation

arnabghose997
Copy link
Contributor

This PR intends to refactor createDID, deactivateDID, updateDID RPCs. Following are some of the major changes:

  • While Registering a DID Document, signature of every controller and verification methods present in the DID Doc must be verified.

  • While Updating a DID Document

    • Addition of a new controller or VM: At least one valid signature from any of the existing controllers or VMs are needed and valid signatures of all new controllers and VMs are required.
    • Removal of an existing or VM: At least one valid signature from any of the existing controllers or VMs are needed
    • Any Verification Method whose controller is not part of the prime Controller list (upper level controller attribute of DID Document), cannot perform any Update Operations of the DID Document
  • While Deactivating a DID Document, at least one valid signature from any of the existing controllers or VMs are needed.

  • Verification method relationship field authentication is completely disassociated from Update operations of a DID Document.

@arnabghose997 arnabghose997 added enhancement New feature or request ssi did labels Feb 28, 2023
@arnabghose997 arnabghose997 self-assigned this Feb 28, 2023
@arnabghose997 arnabghose997 linked an issue Feb 28, 2023 that may be closed by this pull request
@arnabghose997
Copy link
Contributor Author

@Vishwas1

The RPCs were tested on following test cases:

Create DID Tests

  1. FAIL: Alice has a registered DID Document where Alice is the controller. Bob tries to register their DID Document by keeping both Alice and Bob as controllers, and by sending only his signature.

  2. PASS: Alice has a registered DID Document where Alice is the controller. Bob tries to register their DID Document by keeping both Alice and Bob as controllers, and by sending only both Alice's and Bob's signatures.

  3. PASS: Alice has a registered DID Document where Alice is the controller. She tries to create an organization DID, in which Alice is the only controller and it's verification method field is empty.

  4. FAIL: Alice has a registered DID Document where Alice is the controller. Alice tries to register an Org DID Document where Alice is the sole controller, and there are two verification Methods, of type EcdsaSecp256k1RecoveryMethod2020, and Alice is the controller for each one of them. Signature is provided by only one of the VMs.

  5. PASS: Alice has a registered DID Document where Alice is the controller. Alice tries to register an Org DID Document where Alice is the sole controller, and there are two verification Methods, of type EcdsaSecp256k1RecoveryMethod2020, and Alice is the controller for each one of them. Signature is provided by both VMs.

  6. FAIL: Alice creates an Org DID where Alice is the controller, and she adds a verification method of her friend Eve. Only Alice sends the singature.

  7. PASS: Alice creates an Org DID where Alice is the controller, and she adds a verification method of her friend Eve. Both Alice and Eve send their singatures.

Update DID Tests

  1. FAIL: Alice creates an Org DID where alice is the controller, and Bob's VM is added to its VM List only. Bob attempts to update Org DID by sending his signature.

  2. PASS: Alice creates an Org DID where alice is the controller, and Bob's VM is added to its VM List only. Alice attempts to update Org DID by sending her signature.

  3. FAIL: Alice attempts to add George as controller of Org ID. Only George's Signature is sent.

  4. FAIL: Alice attempts to add George as controller of Org ID. Only Alice's Signature is sent.

  5. PASS: Alice attempts to add George as controller of Org ID. Both Alice's and George's Signatures are sent.

  6. PASS: Alice attempts to remove George as controller of Org ID. Only Alice's Signature is sent.

  7. PASS: Addition of George as a controller and simultaneous removal of Alice as a controller. Both alice's and george's signature are passed.

  8. FAIL: Alice has already created two didDocs, each representing a wallet. Now, she creates a DID where she is the controller, and the VMs from two DIDDocs are just added in the VM List. Each of these VMs have different controllers. One of the VMs attempts to update DIDDoc.

  9. PASS: Alice has already created two didDocs, each representing a wallet. Now, she creates a DID where she is the controller, and the VMs from two DIDDocs are just added in the VM List. Each of these VMs have different controllers. Alice attempts to update DIDDoc.

  10. Alice tries to update her DID, be she doesn't bother changing anything in her DID.

  11. PASS: Jenny creates herself a DID with empty Controller list. She then attempts to update the DIDDoc by changing the context field and passes her signature only

Deactivate DID

  1. PASS: Alice creates an Org DID with herself and Bob being the Controller. Alice attempts to deactivate it.

  2. PASS: Mike creates a DID for himself, but the controller list is empty. Mike attempts to deactivate it.

@Vishwas1 Vishwas1 merged commit 45ee7b2 into develop Mar 15, 2023
@arnabghose997 arnabghose997 deleted the did-rpc-refactor branch March 21, 2023 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
did enhancement New feature or request ssi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: CreateDID, UpdateDID and Deactivate DID RPCs
2 participants