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

Add Context-Based Validation To VC & VP Creation #105

Open
fkim7 opened this issue Dec 13, 2022 · 9 comments · Fixed by #111
Open

Add Context-Based Validation To VC & VP Creation #105

fkim7 opened this issue Dec 13, 2022 · 9 comments · Fixed by #111
Assignees
Labels
enhancement New feature or request

Comments

@fkim7
Copy link
Collaborator

fkim7 commented Dec 13, 2022

Similar to how VCs get their schema from a URL ex https://w3id.org/citizenship/v1
we should as well from our own defined URL https://w3id.org/traceability/v1
The above will be merged in the coming days but it is essentially the same as https://knox-networks.github.io/schema/bankaccount/v1.jsonld.

SSI currently has the fields hardcoded but it should read from the schema as schemas change and we add more schemas.

The fields from the bankaccount VC should come from the above context- we should not get the fields from our own repo, code or config files.
Context based validation would be required, similar to https://json-ld.org/playground/ would

@LuisOsta LuisOsta changed the title SSI- Get VC fields from the Context URL Add Context-Based Validation To VC & VP Creation Dec 13, 2022
@LuisOsta LuisOsta added the enhancement New feature or request label Dec 13, 2022
@fkim7
Copy link
Collaborator Author

fkim7 commented Jan 4, 2023

Can we also update SSI context value to https://w3id.org/traceability/v1

pub const BANK_ACCOUNT_CREDENTIAL_CONTEXT: &str =

@LuisOsta LuisOsta linked a pull request Jan 5, 2023 that will close this issue
@LuisOsta
Copy link
Contributor

LuisOsta commented Jan 5, 2023

@fkim7 There are some complications with this that make me think we should revisit this later or at least have a conversation about it. We need to have a discussion about JSON-LD processing and the JSON-LD playground

@LuisOsta
Copy link
Contributor

LuisOsta commented Jan 5, 2023

@echenknox How do you think is the best way to detect whether a document adheres to a JSON-LD context? Most implementations I have seen don't exactly have a strict mode and hence you end up just getting back whatever does match.

The playground does have a strict mode (I think) but it behaves strangely upon testing

@LuisOsta
Copy link
Contributor

LuisOsta commented Jan 6, 2023

@fkim7 I tried to get a credential from the sandbox but couldn't. Can you paste one of the examples of a BankAccount credential you were using

@fkim7
Copy link
Collaborator Author

fkim7 commented Jan 6, 2023

@fkim7 I tried to get a credential from the sandbox but couldn't. Can you paste one of the examples of a BankAccount credential you were using

https://www.notion.so/Sample-BankAccount-VC-50e1bcc600c14ab79a78f8bfb0e5ec8b

@fkim7
Copy link
Collaborator Author

fkim7 commented Jan 6, 2023

@echenknox How do you think is the best way to detect whether a document adheres to a JSON-LD context? Most implementations I have seen don't exactly have a strict mode and hence you end up just getting back whatever does match.

The playground does have a strict mode (I think) but it behaves strangely upon testing

I think different libraries do behave differently- ex JSON Gold for golang may throw error even though the playground might just remove the field.. I think certainly the context needs to be correct, and the JSON LD has to be properly formed. My initial opinion for the scope of this ticket is to ensure the context is check and its a proper JSON LD.. The fields i'm curious to see what you see in cred adapter with JSON Gold but I think either erroring or removing the field isnt too bad either way? I think the most thing is to become aware when there is critical things missing and if the fields missing are silent in some cases its not good but can live with it for now..

@fkim7
Copy link
Collaborator Author

fkim7 commented Jan 10, 2023

If we ever wanted to do data schema validation, we can look at enforcing https://www.w3.org/TR/vc-data-model/#data-schemas including how it works w ZKP but not a priority right now

@LuisOsta
Copy link
Contributor

Opened an issue on the json-ld library repo to discuss a very cryptic error we're seeing - timothee-haudebourg/json-ld#56

@LuisOsta LuisOsta reopened this Jan 17, 2023
@fkim7
Copy link
Collaborator Author

fkim7 commented Nov 16, 2023

@LuisOsta lets take a quick look at this and write down what is relevant and we can decide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants