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

PEX & DWN helper methods #128

Open
6 of 19 tasks
bnonni opened this issue Aug 29, 2024 · 0 comments · Fixed by #133
Open
6 of 19 tasks

PEX & DWN helper methods #128

bnonni opened this issue Aug 29, 2024 · 0 comments · Fixed by #133
Assignees
Labels
enhancement New feature or request P0 priority level 0, urgent and important => do (now) package: applicant Directly impacts the applicant package package: issuer Directly impacts the issuer package

Comments

@bnonni
Copy link
Contributor

bnonni commented Aug 29, 2024

Summary

Presentation Exchange (PEX) requires constructing multiple objects that conform to specific object patterns on both sides of the exchange. The DcxIssuer and DcxApplicant classes need additional PEX helper methods that abstract the complexity of the PEX process. Both classes have helpers for interacting with the DWN. Need to rework these completely.

Applicant

  • PEX Methods
    • Create presentation submission (embedded into credential application)
    • Create credential application (embedded into verifiable presentation)
  • DWN Methods
    • Read application responses from applicant remote dwn
    • Create applications in issuer dwn

Issuer

  • PEX Methods
    • Create presentation definition (embedded into credential manifest)
    • Create credential manifest (embedded into verifiable presentation)
    • Create fulfillment and denial (embedded into credential response)
    • Create credential response (embedded into verifiable presentation)
  • DWN Methods
    • Read applications from issuer remote dwn
    • Read and create manifests from issuer remote dwn
    • Create application responses in applicant dwn
    • Create invoices in applicant dwn

Common

  • PEX Methods
    • Create verifiable credential (embedded into verifiable presentation)
    • Create verifiable presentation (creates VP structure using dcx application/manifest/response record schemas)
    • Verify presentation (checks VP structure against dcx application/manifest/response record schemas)
    • Submit verifiable presentation
  • PEX Types
    • Verifiable Presentation Credential Manifest
      • Credential Manifest
      • Presentation Definition
    • Verifiable Presentation Credential Application
      • Credential Application
      • Presentation Submission
    • Verifiable Presentation Credential Response
      • Credential Response
      • Fulfillment
      • Denial

Basic PEX Steps

  1. Create Unsigned Verifiable Credential
{
    "@context": [
      "https: //www.w3.org/2018/credentials/v1",
      "https: //w3id.org/vc/status-list/2021/v1"
    ],
    "type": [
      "VerifiableCredential",
      "SomeCustomCredential"
    ],
    "id": "urn:uuid:d79e8c94-eb48-4700-9a6c-845ddf1e566d",
    "issuer": "did:dht:applicant",
    "issuanceDate": "2024-08-29T23: 41: 00Z",
    "credentialSubject": {
      "id": "did:dht:applicant",
      "holderClaim1": "claim1",
      "holderClaim2": "claim2",
    }
}
  1. Create Self-Signed Verifiable Credential JWT
eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6enczNndxY204OXl1ZG02aDc1M2h4YWZydHVnOHVvNXprcWV5ejViYjhlN2U0NHJiNWo2byMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vdzNpZC5vcmcvdmMvc3RhdHVzLWxpc3QvMjAyMS92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiUGhvbmVOdW1iZXJDcmVkZW50aWFsIl0sImlkIjoidXJuOnV1aWQ6ZDc5ZThjOTQtZWI0OC00NzAwLTlhNmMtODQ1ZGRmMWU1NjZkIiwiaXNzdWVyIjoiZGlkOmRodDpheDExaW9zbWgxcG5oMWJlaXJ5ZjR1aTM0aXdzM2o4bno1d3N0cjNlMW43NHo4ZTlncmdvIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOVQyMzo0MTowMFoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6YXgxMWlvc21oMXBuaDFiZWlyeWY0dWkzNGl3czNqOG56NXdzdHIzZTFuNzR6OGU5Z3JnbyIsInBob25lTnVtYmVyIjoiNTU1NTU1NTU1NSIsIm90cCI6IiJ9fSwibmJmIjoxNzI0OTc0ODYwLCJqdGkiOiJ1cm46dXVpZDpkNzllOGM5NC1lYjQ4LTQ3MDAtOWE2Yy04NDVkZGYxZTU2NmQiLCJpc3MiOiJkaWQ6ZGh0Onp3MzZ3cWNtODl5dWRtNmg3NTNoeGFmcnR1Zzh1bzV6a3FleXo1YmI4ZTdlNDRyYjVqNm8iLCJzdWIiOiJkaWQ6ZGh0OmF4MTFpb3NtaDFwbmgxYmVpcnlmNHVpMzRpd3MzajhuejV3c3RyM2Uxbjc0ejhlOWdyZ28iLCJpYXQiOjE3MjQ5NzQ4NjB9.aujOU5e_ReEhl1jThW8io7m6AJquqZ7tmlhT2s9Q8KMGKBuColYWaWC1R6FOE_OrdBdMxpCepKXj7zyRRBQ8Cg
  1. Create Presentation Submission
{
  "id": "c185cfb9-7362-4849-8c6a-cc681df6a3ce",
  "definition_id": "presentation-definition-id-from-matching-manifest",
  "descriptor_map": [
    {
      "id": "presentation-definition-input-descriptor-0-id-from-matching-manifest",
      "format": "jwt",
      "path": "$.verifiableCredential[0]"
    }
  ]
}
  1. Create Credential Application
{
  "id": "11d9cbdf-dd3b-416d-9cde-babbe6486676",
  "spec_version": "https://identity.foundation/credential-manifest/#versioning",
  "applicant": "did:dht:applicant",
  "manifest_id": "id-from-matching-manifest",
  "format": {
    "jwt": {
      "alg": [
        "EdDSA"
      ]
    }
  },
  "presentation_submission": {
    "id": "c185cfb9-7362-4849-8c6a-cc681df6a3ce",
    "definition_id": "presentation-definition-id-from-matching-manifest",
    "descriptor_map": [
      {
        "id": "presentation-definition-input-descriptor-0-id-from-matching-manifest",
        "format": "jwt",
        "path": "$.verifiableCredential[0]"
      }
    ]
  }
}
  1. Create Verifiable Presentation (Credential Application)
{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://identity.foundation/credential-manifest/application/v1"
  ],
  "type": [
    "VerifiablePresentation",
    "CredentialApplication"
  ],
  "credential_application": {
    "id": "11d9cbdf-dd3b-416d-9cde-babbe6486676",
    "spec_version": "https://identity.foundation/credential-manifest/#versioning",
    "applicant": "did:dht:applicant",
    "manifest_id": "id-from-matching-manifest",
    "format": {
      "jwt": {
        "alg": [
          "EdDSA"
        ]
      }
    },
    "presentation_submission": {
      "id": "c185cfb9-7362-4849-8c6a-cc681df6a3ce",
      "definition_id": "presentation-definition-id-from-matching-manifest",
      "descriptor_map": [
        {
          "id": "presentation-definition-input-descriptor-0-id-from-matching-manifest",
          "format": "jwt",
          "path": "$.verifiableCredential[0]"
        }
      ]
    }
  },
  "verifiableCredential": [
    "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6enczNndxY204OXl1ZG02aDc1M2h4YWZydHVnOHVvNXprcWV5ejViYjhlN2U0NHJiNWo2byMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vdzNpZC5vcmcvdmMvc3RhdHVzLWxpc3QvMjAyMS92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiUGhvbmVOdW1iZXJDcmVkZW50aWFsIl0sImlkIjoidXJuOnV1aWQ6MWI5ZTljODEtOWJlYi00YjNlLWJhMGQtZDUxZWUxMDFhMDE3IiwiaXNzdWVyIjoiZGlkOmRodDpheDExaW9zbWgxcG5oMWJlaXJ5ZjR1aTM0aXdzM2o4bno1d3N0cjNlMW43NHo4ZTlncmdvIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxNzozMTowMVoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6YXgxMWlvc21oMXBuaDFiZWlyeWY0dWkzNGl3czNqOG56NXdzdHIzZTFuNzR6OGU5Z3JnbyIsInBob25lTnVtYmVyIjoiNTU1NTU1NTU1NSIsIm90cCI6IiJ9fSwibmJmIjoxNzI1MDM5MDYxLCJqdGkiOiJ1cm46dXVpZDoxYjllOWM4MS05YmViLTRiM2UtYmEwZC1kNTFlZTEwMWEwMTciLCJpc3MiOiJkaWQ6ZGh0Onp3MzZ3cWNtODl5dWRtNmg3NTNoeGFmcnR1Zzh1bzV6a3FleXo1YmI4ZTdlNDRyYjVqNm8iLCJzdWIiOiJkaWQ6ZGh0OmF4MTFpb3NtaDFwbmgxYmVpcnlmNHVpMzRpd3MzajhuejV3c3RyM2Uxbjc0ejhlOWdyZ28iLCJpYXQiOjE3MjUwMzkwNjF9.wPxmdf5YFnuNlPBknst6Ir5Q9iYtxCOQsElgPyh9KDO3XoWrRNJZa4iJAcMTuOW-oWFaqRNx7AQMjy5NwqoxBg"
  ]
}
@bnonni bnonni self-assigned this Aug 30, 2024
@bnonni bnonni added enhancement New feature or request P2 priority level 2, important not urgent => schedule (long term) or delegate it package: applicant Directly impacts the applicant package labels Aug 30, 2024
@bnonni bnonni changed the title dcx-protocol/applicant pex helper methods PEX helper methods - applicant and issuer Aug 30, 2024
@bnonni bnonni added package: issuer Directly impacts the issuer package P0 priority level 0, urgent and important => do (now) level: advanced Issues for developers with an advanced knowledge level and subject matter expertise and removed P2 priority level 2, important not urgent => schedule (long term) or delegate it labels Sep 3, 2024
@bnonni bnonni changed the title PEX helper methods - applicant and issuer PEX & DWN helper methods - applicant and issuer Sep 3, 2024
@bnonni bnonni changed the title PEX & DWN helper methods - applicant and issuer Applicant and issuer helper methods for pex & dwn Sep 5, 2024
@bnonni bnonni removed the level: advanced Issues for developers with an advanced knowledge level and subject matter expertise label Sep 5, 2024
@bnonni bnonni changed the title Applicant and issuer helper methods for pex & dwn PEX & DWN helper methods - applicant and issuer Sep 5, 2024
@bnonni bnonni reopened this Sep 5, 2024
@bnonni bnonni changed the title PEX & DWN helper methods - applicant and issuer PEX & DWN helper methods Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P0 priority level 0, urgent and important => do (now) package: applicant Directly impacts the applicant package package: issuer Directly impacts the issuer package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant