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) Implement AnoncredsLedgerRead for cheqd #1306 #1308

Merged
merged 57 commits into from
Dec 17, 2024

Conversation

gmulhearn
Copy link
Contributor

@gmulhearn gmulhearn commented Dec 4, 2024

Closes #1306

Additions

  • Adds a Cheqd implementation of the AnoncredsLedgerRead trait to the aries_vcx_ledger crate (hidden behind a feature flag) CheqdAnoncredsLedgerRead. This implementation uses cheqd resource resolution, and is largely inspired by credo-ts https://github.com/openwallet-foundation/credo-ts/blob/main/packages/cheqd/src/anoncreds/services/CheqdAnonCredsRegistry.ts
  • Adds a resolve_resource method to the cheqd DID resolver, allowing DLRs to be resolved directly or via a name+type+time? DLR query. The implementation is largely inspired by credo-ts https://github.com/openwallet-foundation/credo-ts/blob/main/packages/cheqd/src/dids/CheqdDidResolver.ts#L69 . Note that the implementation for resolving DLR by name+type+time? query is not very efficient - it involves resolves the full set of DLR metadatas for a DID (collection) and then filtering in memory. This is a current limitation of the cheqd gRPC as pagination is not functioning as expected - this will need to be fixed once the gRPC is updated, however for now we ignore pagination (like credo)
  • Adds a MultiLedgerAnoncredsRead implementation of the AnoncredsLedgerRead trait. This is similar to the DID resolver registry, it allows you to add multiple AnoncredsLedgerRead implementations and automatically switch between them depending on the requested schema/cred-def/rev-reg ID.
  • add new attachment types for anoncreds attachments in issue-cred-v2 & present-proof-v2

Refactors

Testing

Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
…er than generate at build time)

Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
@gmulhearn gmulhearn changed the title [feat] Implement AnoncredsLedgerRead for cheqd #1306 (feat) Implement AnoncredsLedgerRead for cheqd #1306 Dec 10, 2024
@gmulhearn gmulhearn marked this pull request as ready for review December 10, 2024 00:34
@gmulhearn gmulhearn added skip-ci and removed skip-ci labels Dec 10, 2024
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
@gmulhearn
Copy link
Contributor Author

@JamesKEbert pls forgive me for some rust sins i committed in latest commit: 06f9afd

particularly in aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs, there is a several lack of typing, so everything is JSON strings and passed around in tuples. This needs a good re-evaluation, as it's way behind the rest of the VCX codebase in terms of type safety

@JamesKEbert
Copy link
Contributor

@JamesKEbert pls forgive me for some rust sins i committed in latest commit: 06f9afd

particularly in aries/aries_vcx/src/protocols/issuance/holder/state_machine.rs, there is a several lack of typing, so everything is JSON strings and passed around in tuples. This needs a good re-evaluation, as it's way behind the rest of the VCX codebase in terms of type safety

Oh yeah that is gross, but I approve of your approach in this commit given it's already not good and IMO should be addressed in a separate PR entirely anyways.

JamesKEbert
JamesKEbert previously approved these changes Dec 17, 2024
Copy link
Contributor

@JamesKEbert JamesKEbert left a comment

Choose a reason for hiding this comment

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

Really great stuff--LOTS in here! Great to see further implementation on the Cheqd integration. Love the addition of the multi ledger read and the cleanup to use status lists.

Thanks for your hard work here @gmulhearn!

Signed-off-by: George Mulhearn <[email protected]>
Copy link
Contributor

@JamesKEbert JamesKEbert left a comment

Choose a reason for hiding this comment

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

LGTM

@gmulhearn gmulhearn merged commit 0cf717c into hyperledger:main Dec 17, 2024
16 checks passed
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.

[feat] Implement AnoncredsLedgerRead for cheqd
3 participants