-
Notifications
You must be signed in to change notification settings - Fork 6
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
Using PortableDid
to import did to sign VC, removing kid as default value
#130
Conversation
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.
We made a new issue to update the credentials create() but this one will work for now (since kt the only one that consumes it)
and yup make sure web5-js works and bump the spec hash of web5-js 👍
PortableDid
to import did to sign VC, removing kid as default value
"x": "DdtN8W6x_34pB_nkxR0e1tmDkNnsJeusBAEPzKWgf_Y", | ||
"y": "u3W135inodLqtcEb9jNGS3JsM_uFKmkJSb8Trc9luWI", | ||
"alg": "ES256K" | ||
"signerPortableDid": { |
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.
I am hesitant to make this change because I am not sure portable did is a concept that should be exposed in the spec.
the spec serves mainly to facilitate interop, and the serialization format of DIDs seems to be an internal feature to the SDKs. if we have a use case to enable interoperability via portable DID that would help change my mind here.
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.
That's fair... I made this change because this test is about importing an existing did, signing a VC with the equivalent bearer did, and checking that the vcjwt created is what we expect.
In your view, how could we test this aspect of credential creation but still keep interop top of mind?
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.
We could still define input keys (or key seeds) and expected outputs without having a common bearer did structure.
The DID working group argued about a similar concept for a while and agreed to not define a serializable representation of private keys as to avoid recommending doing it, since it's a security risk to transmit private keys.
Some DID methods do provide private keys. Others provide public keys and test for common identifier generation and document expansion, like did key: https://w3c-ccg.github.io/did-method-key/#ed25519-x25519
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.
hmm... it seems like you may not be onboard with the idea of PortableDid
existing in general, because its purpose is basically to transmit private key (imo)?
if that's the case, then we need to have a bigger discussion around why portabledid should or should not exist. i'd appreciate it if you could raise it as a ticket in this repo and document your concern around it.
as far as this test vector is concerned, would you feel more comfortable if i got rid of the signerPortableDid
key, and have uri
, privateKeys
, document
directly under input
key? then it's not really introducing the concept of portabledid to the test vectors, but allows the test vector consumer to still have the necessary info to create a did they can then sign the VC with to produce the same expected vector.output
vcJwt?
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.
as far as this test vector is concerned, would you feel more comfortable if i got rid of the
signerPortableDid
key, and haveuri
,privateKeys
,document
directly underinput
key? then it's not really introducing the concept of portabledid to the test vectors, but allows the test vector consumer to still have the necessary info to create a did they can then sign the VC with to produce the same expectedvector.output
vcJwt?
yes this works!
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.
I think we probably have a number of existing test vectors which have implementation-specific assumptions, such as the concept of a "portable DID" so even under the working assumption "portable DID" is not something to be within the web5 spec (that's my working stance) I think it pragmatic to expect to commit to a work item at some point to twease apart our test vectors for vectors which are spec-specific vs our-implementations-specific
TL;DR I agree test-vectors/portable_did/*
shouldn't be where it is but we can come back later b/c we need to review all test vectors
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.
hmm, so there seems to be a couple opinions emerging on what test vectors should do -
-
allow for interop with external repos that want to make sure their way of building and using DIDs and VCs is consistent with ours (this comment)
-
allow for interop between our per-language sdk implementations to make sure we are all building and using DIDs and VCs consistent with (each other) this comment
i think it should do both, which is why i pulled out the portableDid
concept out of this test vector for VC creation, and created a new test-vectors/portable_did/parse.json
test vector for parsing in a portable did and importing into a bearerdid.
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.
if we have a use case to enable interoperability via portable DID that would help change my mind here.
we do. right now across our sdks, you can port a did around using PortableDid
. trying to better understand how inclusion of portableDid
prevents interop. couldn't third parties just ignore the "portableDid" property and go straight to private keys if desired? asking because leaving it out makes it more confusing / a bit awkward when consuming the vectors in our own sdks
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.
ok. i reverted back the changes to make it easier for other sdks to consume the portabledid when writing tests against this vector.
i think this needs a bit more discussion so wrote an issue here: #142
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.
you can port a did around using PortableDid
I believe this has security risks and we should not support it, though I acknowledge it's useful for test vectors. Happy to continue the discussion in #142.
…into 234-changes
… do not introduce the concept of portabledid to test vectors
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.
lgtm. ty for testing this in both JS and KT
… also adding portable_did parse.json
@kirahsapong are you aware of this PR? Will the changes here impact web5-swift? |
test-vectors/credentials/create.json
Outdated
} | ||
], | ||
"document": { | ||
"id": "did:key:z6MkfUhjsZUJkzioGDULpcqxXFSNs6McMJo31txYnEaqn9dY", |
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.
is it too much to ask to use a did:jwk
instead? since we deprecated did:key
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.
this test vector specifically tests for creating a VC as a jwt with a did:key
so i'd like to keep it here :)
@@ -117,8 +112,7 @@ | |||
"crv": "secp256k1", | |||
"x": "1_o0IKHGNamet8-3VYNUTiKlhVK-LilcKrhJSPHSNP0", | |||
"y": "qzU8qqh0wKB6JC_9HCu8pHE-ZPkDpw4AdJ-MsV2InVY", | |||
"alg": "ES256K", | |||
"kid": "0GkvkdCGu3DL7Mkv0W1DhTMCBT9-z0CkFqZoJQtw7vw" |
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.
so what was the rationale for removing these kid
's in this file?
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.
the kid
is now not populated by default and computed whenever it is necessary. the test vector (previously using JWK) assumed that it would be populated by default so the test would fail.
same for alg - alg also isn't populated by default, since crv (a required field) is more accurate anyway.
…r and the corresponding test
test vector changes for decentralized-identity/web5-kt#262