w3c / vc-data-model

W3C Verifiable Credentials v2.0 Specification
https://w3c.github.io/vc-data-model/
Other
297 stars 106 forks source link

Protocol buffer support #642

Closed richburdon closed 5 years ago

richburdon commented 5 years ago

Was any thought given to the fact this new protocol cannot be expressed using protocol buffers (or as natural objects/structs in most programming languages) because of the use of the non-standard "@" character?

I think this pretty much guarantees the fragmentation of the protocol with folks having to substitute @context with things like _context, _at_context, etc.

(Reference: https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#letters_and_digits)

(The npm module https://www.npmjs.com/package/protobufjs alone has more than 1.7MM weekly downloads, and I would have thought this was the most likely audience for this kind of technology).

msporny commented 5 years ago

Was any thought given to the fact this new protocol cannot be expressed using protocol buffers (or as natural objects/structs in most programming languages) because of the use of the non-standard "@" character?

Yes, a few:

So, fundamentally, there is nothing serious that prevents serialization/deserialization to protobuf and we'd welcome a serialization profile that supports to/from protobuf. Are you interested in writing that spec or README?

I think this pretty much guarantees the fragmentation of the protocol with folks having to substitute @context with things like _context, _at_context, etc.

To be clear, the spec is a data model and suggested serializations... it's not a protocol. To prevent fragmentation wrt. the @ symbol it seems like the only thing that would be required is a single serialization/deserialization rule. We're happy to write that up in the Implementation Guidance if you want to provide an implementation that serializes/deserializes to/from protobuf?

(The npm module https://www.npmjs.com/package/protobufjs alone has more than 1.7MM weekly downloads, and I would have thought this was the most likely audience for this kind of technology).

It doesn't seem to be the "mose likely" audience, given that the 300+ participants in the work to date have not identified protobuf as a target syntax. That said, if there is interested, we're more than happy to figure out a way of publishing interop specs for protobuf... given that the issue you've identified is the only one, I can't imagine it would be that difficult.

Are there other issues that you feel would be non-starters for a protobuf serialization?

burnburn commented 5 years ago

From the VCWG call on 11 June 2019:

RESOLUTION: The Working Group has discussed issue 642 and decided to make no changes to the specification. A response to the issue submitter should instruct them to create a separate serialization specification that maps the data model to and from the serialization that they desire.

msporny commented 5 years ago

Hi @richburdon, just following up with you on this. Here's a record of the WG discussion of the issue that you raised:


https://github.com/w3c/vc-data-model/issues/642 manu: next is 642, protocol buffer support ... why didn't you do protocol buffers? The @ character isn't supported in protobufs ... from and to different serializations can be done. ... suggestion is to change nothing. ... we can change the text to mention protocol buffers. Justin_R, you wanted to discuss serialization manu: commenter hasn't responded. I think the spec is clear already. If someone wants to add it, then add protocol buffer support and mention mappings will need to be made. Justin_R: serialization isn't really handled in the spec. this same approach should apply to protocol buffers. ... to use any serialization, you need another spec to say how to do that in either direction. ... this spec is the wrong place, but we need a family of specs that very clearly state how to do that. manu: are you saying, let's add language that points out that need for more specs? Justin_R: not suggesting we add that, it is already there. manu: you're saying no change to the spec https://w3c.github.io/vc-data-model/#syntaxes Justin_R: I'm saying our response to the issue needs to be "any necessary transforms to support protocol buffers requires a different spec." Current text: A conforming document is any concrete expression of the data model that complies with the normative statements in this specification. Specifically, all relevant normative statements in Sections § 4. Basic Concepts, § 5. Advanced Concepts, and § 6. Syntaxes of this document MUST be enforced. A serialization format for the conforming document MUST be deterministic, bi-directional, and lossless as described in § 6. Syntaxes. The conforming document MAY [CUT] burn, you wanted to say we have not defined how extension to new syntaxes should occur burn: Justin is right. we didn't say how extensions should occur. We have provided examples. ... syntaxes have been described, but not serializations ... perhaps distracting now. Response to issue should be: our expectation is that a new syntax should be written that contains the serialization rules. PROPOSAL: The Working Group has discussed issue 642 and decided to make no changes to the specification. A response to the issue submitter should instruct them to create a separate serialization specification that maps the data model to and from the serialization that they desire. manu: any objections? wfm RESOLUTION: The Working Group has discussed issue 642 and decided to make no changes to the specification. A response to the issue submitter should instruct them to create a separate serialization specification that maps the data model to and from the serialization that they desire.
msporny commented 5 years ago

I'll try to translate that for you in the event that you're new to the standardization process. It basically comes down to this statement you made:

I think this pretty much guarantees the fragmentation of the protocol with folks having to substitute @context with things like _context, _at_context, etc.

The thing that prevents fragmentation of the protocol is for someone to define how the Verifiable Credentials Data Model is translated to/from protobuf. We have defined this for how one takes the VC Data Model and converts to/from JSON-LD. We did the same for JWTs and the JOSE stack. The expectation is that if someone wants to do this with protobuf, then they would define a fairly lightweight specification and tell folks how to convert a VC to/from protobuf. One rule that spec would have in it is how to convert from @context to _at_context or whatever you feel would be appropriate.

An example of this sort of mini-spec can be found here:

https://w3c.github.io/vc-data-model/#json-web-token

msporny commented 5 years ago

Marking this issue as having responded to the issue commenter with a 7 day close pending if no objection from the issue submitter.