-
Notifications
You must be signed in to change notification settings - Fork 28
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: public credentials and asset DIDs #677
Conversation
I just recalled, there’s a new guy on the block: |
@arty-name @rflechtner I consider this PR ready to be merged. There is something seemingly broken with CType verification, which will be tackled in a different PR. For now, the test for that check is skipped, and we can enable it again once we have a fix for the CTypes. I tested the |
I approve the code and leave the higher level decisions to Raphael |
Looking at the updated error message in the latest commit, I started thinking that the ID of the public credential is its hash of a kind. If we use this more specific word "hash" (as we do for CType), we won’t have to explain to other developers what are the IDs of public credentials, and how we generate them, and what a mismatching ID means. Because many developers already know these facts about hashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a suggestion or two but I think we're done here!
Fixes https://github.com/KILTprotocol/ticket/issues/2092 and fixes https://github.com/KILTprotocol/ticket/issues/2175.
Original draft document (might not be entirely up to date with what's implemented here) -> https://hackmd.io/@EAX5fDsURyKJJ3GahxyZbA/Skoh424wq.
What is this
This PR adds support for the long-awaited public credentials and asset DIDs.
A public credential behaves differently than a traditional KILT credential since it is publicly accessible by anyone that has access to a full archive node.
A credential is not stored inside the blockchain state, but a pointer to the block number in which it was created is stored instead.
When retrieving a credential, two operations must be performed:
How are credentials supposed to be used and shared [SEE PR DISCUSSION BELOW FOR NEWER INFORMATION]
I envisioned that public credentials would never be shared directly between parties, because they are public. They would be used in one of the following two ways:
Most of the code has been inspired by how credentials and attestations have been modelled in the SDK, since a public credential is kind of a combination of both.
What about AssetDIDs
Since they are simply a wrapper over CAIP-19 identifier, which are simply "regexable", the new package does not do much. Eventually, we will develop an AssetDID resolver that can attach additional information to an AssetDID, such as the credentials linked to it, but I think that is out of scope from this PR, which represents already a good-enough PoC.