beckn / protocol-specifications

Core protocol specification for peer-to-peer consumer-provider interaction
Other
375 stars 101 forks source link

Add creds attribute to Item, Payments, Fulfillment, and other relevant schemas #457

Open ravi-prakash-v opened 1 week ago

rajaneeshk90 commented 1 week ago

Status

Date: 17/10/2024

  1. Went through this verifiable credentials documentation to get some context: https://www.w3.org/TR/vc-data-model-2.0/
  2. Updated the existing Credential object in the specification schema, added field relevant to the verifiable credential schema
  3. Added the updated Credential object in the Agent, Customer, Organisation, Payment, Provider, Subscriber, Fulfillment, Item, Order objects
  4. Added 2 new endpoints cred/ and on_cred/
  5. The Changes are here as of now, but will move it to beckn repository once I have a discussion with Ravi.
  6. https://github.com/rajaneeshk90/protocol-specifications-rk/tree/hyperbeckn-changes me
rajaneeshk90 commented 1 week ago

The following considerations were made while making the changes. This is just a summary of the thoughts we had:

  1. Credential schema should support a normal credential as well as a verifiable credential
  2. There already is a Credential schema in the Protocol Specification, it is referenced in the Person object only as of now.
  3. Some example JSONs in DHP use case are using fulfillment.agent.person.creds to show the Doctor credentials.
  4. Keeping the above 2 points in mind, decided to update the existing Credential schema only.
  5. One though was to attach a Credential object inside Agent object instead of a Person object. Agent, Customer etc are an abstraction of a Person, attaching credentials to these abstractions make more sense I think.
  6. Gave a though to include Person object in the Credential schema as a "subject", but that is not possible now because the Person object already has the credential schema in it, it will induce a circular dependency.
rajaneeshk90 commented 6 days ago

Status

Date: 22/10/2024

  1. During a call on 21st Ravi had a brief look at the cred/ and on_cred/ APIs.
  2. Based on the suggestions from Sujith, Ravi instructed to keep the cred/ api simple and purpose specific.
  3. Have a field which can be used to convey the purpose. And another field to provide examples of documents that can be used for that purpose.
  4. Suggestions were to change the "creds" to "proofs".
  5. These change are made and pushed in here: https://github.com/beckn/protocol-specifications/blob/Credentials-Schema-Draft/api/transaction/build/transaction.yaml
  6. Decided to schedule a one on one call to discuss the changes for cred/ and on_cred/ apis with Ravi.
rajaneeshk90 commented 6 days ago

There was also a suggestion to check if there already exists a specification for verifiable credential. If yes, that can be implemented by NPs along with the Beckn protocol and we don't need to add cred/ and on_cred/ API endpoints.

rajaneeshk90 commented 5 days ago

Actions on previous points

one on one call to discuss the changes for cred/ and on_cred/ apis with Ravi: The whole team was busy with Ravi discussing the overall architecture, could not have the discussion on Tuesday.

Existing specification for verifiable credential which can be used by NPs instead on adding cred/ on_cred/ in the protocol specification:: Tried to check the existing specification, went through one document: https://openid.net/specs/openid-4-verifiable-presentations-1_0.html. had a brief look, could not get in enough details to propose a solution using this.

rajaneeshk90 commented 5 days ago

Status

22/10/2024

Made some changes in the credential schema Created example jsons for the cred/ and on_cred/ api endpoints on request from the development team: https://github.com/rajaneeshk90/Unified-Energy-Interface-rk/tree/l2-config-with-cred/examples/ev-charging/cred Added cred/ and on_cred/ rules in the UEI p2p layer 2 configuration: https://github.com/rajaneeshk90/Unified-Energy-Interface-rk/blob/l2-config-with-cred/api/uei%3Ap2p_trading.yaml Created a JSONSchema to define the structure of the beckn.json: https://github.com/rajaneeshk90/protocol-specifications-rk/tree/beckn-json/api/about-endpoint