openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
273 stars 200 forks source link

LedgerService to AnonCredsResource Service #977

Closed TimoGlastra closed 1 year ago

TimoGlastra commented 2 years ago

As we want to support other ledger types with AnonCreds credentials we need to generalize the IndyLedgerService. #971 already extracts the indy ledger service methods into a ledger service interface. To fully make it generic I propose we also take the following steps:

This is the first ticket for generalizing services for anon creds, the indy issuer/holder/verifier services will follow afterwards.

Thoughts?

swcurran commented 2 years ago

Good to see this initiated. Please make sure as you progress on this that you let the AnonCreds Specification Working Group know what you discover (see the in progress AnonCreds Specification, and the associated repository ). We're having a number of conversations there, and in the ACA-Py User Group about this, and folks in the ACA-Py community are building a similar capability. I hope to get an AnonCreds Objects RFC into the Aries RFC repo Real Soon Now to make sure we're all going down the same path. AATH also needs to add tests for this across Aries Frameworks.

As part of that work, we're defining an "AnonCreds Objects Methods" registry -- that is comparable to the DID Method registry -- for now, there is a pull request that has an example of the registry (I'll update this when the repo for the registry is created). The registry entries link to definitions of how to register AnonCreds objects to a given Verifiable Data Registry (VDR), and how to resolve AnonCreds objects, given an identifier for those objects. As you note, those registration/resolution MAY be part of a DID Method, but they don't have to be.

We've already proposed 4 AnonCreds Objects Methods, each with different forms of identifiers that should be relatively easy to at least resolve (writing/registering may be more interesting):

I think did:web would be relatively easy to add, but I don't know the spec well enough yet.

Comments welcome!!

berendsliedrecht commented 2 years ago

Definitely in favour of this separation. In regards to point 4, I think we should do that if it does not cause too much overhead. Making a new resourceService should be as easy as possible. A couple of AFJWG calls back we saw an integration with Fabric. They did a lot of custom work around and it if we really want to see more support for different resources we should definitely put some work in the interface.

genaris commented 2 years ago

Absolutely agree on going on with this generalization now, especially considering that we are not so far away from starting integration with Indy shared components.

In Aries world I'm more familiar to the term Verifiable Data Registry as a generic replacement of Ledger, so I'd prefer the service rename to AnonCredsVDRService or AnonCredsRegistryService. I think other Aries frameworks (such as the Go) are using this naming also.

berendsliedrecht commented 2 years ago

In Aries world I'm more familiar to the term Verifiable Data Registry as a generic replacement of Ledger, so I'd prefer the service rename to AnonCredsVDRService or AnonCredsRegistryService. I think other Aries frameworks (such as the Go) are using this naming also.

I would also give my preference to either of those. Maybe I would lean slightly towards AnonCredsVDRService as the Verifiable is an important part. If we would allow "non-verifiable", not sure on the use case, then AnonCredsRegistryService would be better.

TimoGlastra commented 2 years ago

As you can see in this PR to the AnonCreds spec: https://github.com/AnonCreds-WG/anoncreds-spec/pull/64

there will be support for fetching anon creds objects from an http server in which case it won't be verifiable. So we should probably go with AnonCredsRegistryService then. This will be the generic service that allow to work with multiple AnonCredsRegistry implementations (like we have DidResolverService and then multiple DidResolver implementations for the different did methods.