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

feat: verification methods with blockchainAccountId field populated cannot be added in a DID Document if they already exists in some registered DID Document #359

Merged
merged 5 commits into from
Jun 29, 2023

Conversation

arnabghose997
Copy link
Contributor

In the current implementation, there isn't any restriction imposed on addition of a Verification Method to a DID Document, even if its present in some other registered DID Document. However, one of our Customers have raised concern related to this.

A Reputation Score is given to a DID Document based on the number of wallet addresses (Verification Methods with blockchainAccountId populated) it carries. The problem is that the user of a DID Document can take one of the Verification Methods can add it to multiple DIDs and can claim score on those DID Documents which is not desirable.

This PR intends to solve the issue by restricting the movement of those Verification Methods whose blockchainAccountId field is populated, by not letting them being added to a new DID Document if they already exists in some DID Document. Only if the Verification Method is removed from the existing DID Document or the DID Document is deactivated, the Verification Method is available to be added a new DID Document.

This also ensures that those Verification Methods which doesn't have blockchainAccountId field populated are free to be added anywhere, thereby not hampering those scenarios where this functionality is deseriable.

Following test cases are added:

  1. FAIL: Alice Creates a DID Doc. Bob attempts to create a DID Document by adding one of Alice's VM.

  2. FAIL: Charlie creates a DID Document. After that, Charlie attempts to update its DID Document by adding one of Alice's VM for which valid signature is passed.

  3. PASS: Alice deactivates her DID Document. Charlie attempts to update its DID Document by adding one of Alice's VM for which valid signature is passed.

  4. PASS: Charlie removes one of its Verification Methods. George creates a didDoc for himself. He then proceed to update his DID Document by adding the Verification method removed by Charlie

arnabghose997 and others added 5 commits April 20, 2023 10:03
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](golang/net@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…/golang.org/x/net-0.7.0

build(deps): bump golang.org/x/net from 0.6.0 to 0.7.0
…annot be added in a DID Document if it already exists in some registered DID Document
@arnabghose997 arnabghose997 added enhancement New feature or request did labels Jun 27, 2023
@arnabghose997 arnabghose997 self-assigned this Jun 27, 2023
@arnabghose997 arnabghose997 changed the title feat: verification methods with blockchainAccountId field populated cannot be added in a DID Document if it already exists in some registered DID Document feat: verification methods with blockchainAccountId field populated cannot be added in a DID Document if they already exists in some registered DID Document Jun 27, 2023
Copy link
Contributor

@Vishwas1 Vishwas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@arnabghose997 arnabghose997 merged commit bb5fe7e into develop Jun 29, 2023
2 checks passed
@arnabghose997 arnabghose997 deleted the unique-blockchain-account-id branch June 29, 2023 05:36
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants