Animo Solutions
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # W3C AnonCreds in Aries Framework JavaScript This document outlines the design of integrating W3C VC data model compliant AnonCreds credentials into Aries Framework JavaScript and Bifold. Opportunity: https://marketplace.digital.gov.bc.ca/opportunities/code-with-us/6f08d6d5-7e3d-489a-a98f-d7c607309dc9 ## Aries Framework JavaScript The following lists all the planned changes and areas of complexities we see in Aries Framework JavaScript. **Overview:** The first step will be to update AFJ to store all credentials in the new W3C format and not break current flows. Next, we will focus on issuing credentials in the W3C format using the W3C Verifiable Credential Data Integrity Attachment format. The third step is to allow requesting and presenting presentations of verifiable credentials (`anoncredsvc-2023`) in W3C format. After creating a release in AFJ containing the previously mentioned changes, during the last part, we will update Bifold's AFJ version and integrate the newly created functionality. The implementation parts are driven by test vectors defined in [this](https://github.com/TimoGlastra/anoncreds-w3c-test-vectors) Github repo. ### Storage - Update Afj to use the latest version of anoncreds-rs. - Store AnonCreds credentials in W3C format, transforming them to the (legacy) AnonCreds format when needed during an exchange. This allows them to be used interchangeably for exchanges in W3C format and AnonCreds format. - When converting credentials from the W3C format to the legacy format, it will be taken into account whether the credential or metadata requires qualified or unqualified identifiers. - W3C Records are updated to store additional metadata required for anoncreds flows. - The W3C CredentialSubject implementation is updated to allow defining arbitrary claims, which is required to create W3C credentials containing the claims of arbitrary credential schemas. - Write a migration that re-stores all credentials stored in the legacy anoncreds format in the new w3c format. - Because credentials are stored in W3C format, the PEX presentation definition querying logic can be used to find matching AnonCreds credentials (in addition to also querying matching non-AnonCreds W3C credentials) ### W3C Credential Issuance Issuance of W3C credentials with an AnonCreds signature are handled using the new [W3C Verifiable Credential Data Integrity Attachment format](https://github.com/hyperledger/aries-rfcs/blob/2dfe5a1046aead12f66d3c68e2a7366cabb0621b/features/0809-w3c-data-integrity-credential-attachment/README.md). The DataIntegrity attachment implementation will be part of AFJ's core. For simplicity reasons, we may keep the implementation in the anoncreds package for now. Otherwise, we need to create a way to dynamically register the link-secret binding method, which requires dependencies that are not a part of the core, or move the required dependencies to the core. A credential using the new attachment format can be issued in AFJ like this: ```typescript await issuer.credentials.offerCredential({ connectionId: '<connectionId>', credentialFormats: { dataIntegrity: { // specify if the holder can request the credential without binding method bindingRequired: true, credential: { ... }, // the W3cCredential which is offered to the holder linkSecretBinding: { credentialDefinitionId: string }, didCommSignedAttachmentBinding: { // no properties required } } } }) ``` ```typescript await holder.credentials.acceptOffer({ credentialRecordId: holderRecord.id, credentialFormats: { // The holder can accept the offer with the binding // methods offered to him. Or no binding method // at all, if this is permitted. dataIntegrity: { linkSecretBinding: { linkSecretId: 'linkSecretId', }, didCommSignedAttachment: { kid: 'did:example:1234', } }, }, }) ``` ```typescript await issuer.credentials.acceptRequest({ // The issuer can accept the offer with // no additional information needed, // as the binding method(s) is implicitly specified // through the request. credentialRecordId: issuerRecord.id, credentialFormats: { dataIntegrity: { }, }, }) ``` ```typescript await holder.credentials.acceptCredential({ // the holder accepts storing the received credential in his wallet credentialRecordId: holderRecord.id, }) ``` ### W3C Credential Presentation Presentation of W3C credentials with an AnonCreds signature is handled using [Aries RFC 0510: Presentation-Exchange Attachment format for requesting and presenting proofs](https://github.com/hyperledger/aries-rfcs/blob/main/features/0510-dif-pres-exch-attach/README.md) The base integration of PEX has already been completed an is [merged into AFJ main on January 10th 2024](https://github.com/openwallet-foundation/credo-ts/pull/1676). Updates are now being made to the implementation in AFJ, as well as the [Sphereon PEX library](https://github.com/sphereon-Opensource/pex) to support the new `DataIntegrityProof` and `di_vc` proof formats as described [here](https://github.com/decentralized-identity/claim-format-registry/issues/8) and in the test vectors. Selective disclosure and predicates will are handled by the AnonCreds RS implementation. A proof request is handled like this in AFJ: ```typescript await holder.proofs.proposeProof({ protocolVersion: 'v2', connectionId: holderConnectionId, proofFormats: { presentationExchange: { presentationDefinition: { ... }, }, }, }) ``` ```typescript await verifier.proofs.acceptProposal({ proofRecordId: issuerProofExchangeRecord.id, }) ``` ```typescript const credentialsForRequest = await holder.proofs.getCredentialsForRequest({ proofExchangeId: '<proofExchangeId>' }) // object containing the credentials that satisfy the different input descriptors from the request credentialsForRequest.presentationExchange // You can then either let the framework auto-select const credentialsForRequest = await holder.proofs.selectCredentialsForRequest({ proofExchangeId: '<proofExchangeId>' }) // Or you can let the user (e.g. in a mobile wallet) select credentials based // on the credentialsForRequest structure. This is already implemented in the Paradym Wallet UI // Then finally you accept it: await holder.proofs.acceptRequest({ proofExchangeId: '<proofExchangeId>' proofFormats: { presentationExchange: { credentials: // credentials selected by user (or keep empty to auto-select) } } }) ``` ```typescript // Accept a presentation (by sending a presentation acknowledgement message) // to the connection associated with the proof record if validation succeeded. await issuer.proofs.acceptPresentation({ proofRecordId: proofExchangeRecord.id }) ``` ## Bifold The bifold work consists of integrating the added features from AFJ and adding support for rendering W3C and DIF PE models. - A new release in AFJ containing the abovementioned changes is created. - Support for rendering W3C credentials in the Bifold wallet is added. We will re-use the existing rendering logic but also allow the credential offer and credential detail screens to support W3C-encoded AnonCreds credentials - Support for rendering and selecting DIF PE presentation requests and AnonCreds proof requests. The implementation will be based on an existing implementation in our Paradym Wallet. ## Test Vectors The implementation in AFJ is based on the defined test vectors in https://github.com/TimoGlastra/anoncreds-w3c-test-vectors

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully