Skip to content

Extract getting verification key for proof signing into VerificationKeyStrategy class #2348

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

Conversation

mkempa
Copy link
Contributor

@mkempa mkempa commented Jul 25, 2023

Following the logic in PR 2235 it is also beneficial to have the strategy for getting verification key itself overridable by plugins.

Such a use case would be to use the universal resolver to get a DID Document and fetch a verkey identified by the key ID. Then search the wallet by the verkey to obtain DIDInfo.

mkempa added 2 commits July 25, 2023 13:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…strategy class

Signed-off-by: Matus Kempa <[email protected]>
@mkempa mkempa marked this pull request as ready for review July 25, 2023 12:48
@dbluhm
Copy link
Contributor

dbluhm commented Jul 25, 2023

@mkempa I'm finding this change a bit confusing. The added method is get_verification_key_for_did but the value actually returned is a DIDInfo rather than a representation of a verkey. This strikes at a deeper problem we have right now in ACA-Py: the 1:1 relationship between DIDs and keys. I think it would be better for code like the LD Proof handler to take an object representing a "verification method" rather than a DID Info object and then for the keys to be stored by verification method ID so they're easily recalled from the wallet. If we can achieve that construction, I don't think there would be a need to make the verkey retrieval pluggable.

There are details there that would need to be worked out still though. Thoughts, @swcurran @andrewwhitehead @usingtechnology?

@mkempa
Copy link
Contributor Author

mkempa commented Jul 25, 2023

The added method is get_verification_key_for_did but the value actually returned is a DIDInfo rather than a representation of a verkey.

My first intention was to return the verkey or None, hence the method name. Then I went on the path of the least resistence. Otherwise I would have to modify signature of _get_suite and fix more unit tests, etc.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@swcurran swcurran removed the request for review from usingtechnology March 19, 2024 15:17
@dbluhm
Copy link
Contributor

dbluhm commented Mar 19, 2024

@PatStLouis is going to a take another look at this

@swcurran swcurran marked this pull request as draft March 25, 2024 15:05
@swcurran
Copy link
Contributor

@PatStLouis -- any update on this? Thanks!

@PatStLouis
Copy link
Contributor

The issue with using the verificationMethod object to find the keypair is that there could be different verificationMethod.types adding complexity.

When I create a did in the wallet, the current method of encoding the verkey is using the ED25519VerificationKey2018 encoding algorithm. I might want to represent this verkey using ED25519VerificationKey2020 in my did document, so finding the key from the verificationMethod might not always lead to a match.

I could also have multiple verificationMethod.id I want to link to the same keypair (like publishing the verkey with 2 different web did)

Since the did and the verkey value are used to find the matching keypair, they act as a label for this keypair. The simplest approach would be to have an optional issuance options field proofKey where I can provide the verkey as it's registered in the wallet and this would then take priority over using the issuer did value if present. This is how it worked with the /jsonld/sign endpoint and adds value to a controller.

However there is already an existing function get_local_did_for_verkey function available for this.

I'm not convinced in the added value of making this pluggable. I would rather have an optional field in the issuance options for now.

@swcurran
Copy link
Contributor

@dbluhm — thoughts on this? I’m sort of getting this, but don’t know the data flow — what is/could be where in the DID and proof.

@dbluhm
Copy link
Contributor

dbluhm commented Jun 18, 2024

@PatStLouis is this superseded by having the keys in the wallet identifiable by kid/verification method id?

@PatStLouis
Copy link
Contributor

@dbluhm it looks like it, identifying the wallet keys by verificationMethod.id seems like a more elegant way of achieving what is depicted in the use case. Regardless this PR is about to be a year old and the file structure changed. I'm okay with closing this PR unless @mkempa has objections.

@dbluhm dbluhm closed this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants