zcap-spec
zcap-spec copied to clipboard
Why don't zcaps have a type?
We're looking into passing zcaps and invocations over CHAPI and I was surprised to see that this specification doesn't have a "type" value to uniquely identify the ZCAP as ZCAP.
Is the type string just TBD or am I missing something?
Earlier revisions of the spec had any objects / resources essentially using a polymorphic design where objects / resources were their own "root capabilities". This lead to a desire to not to specify any special type for a zcap. After getting implementation experience with that approach, the spec was changed to cleanly separate objects / resources from zcaps (and a "root capability" is no longer the object / resource itself).
After this separation occurred, there wasn't any immediate need to add a type back in -- but it is now a possibility. At least one reason to add a type would be to make it easier to differentiate a zcap from other objects referenced in a graph of information. At least one reason not to add a type would be the increase in size it brings.
So -- it's something to consider. Personally, I think it's probably worth adding the type for clarity -- and if size is a problem, CBOR-LD can be used to greatly reduce the size of a zcap because it uses @context
as a built-in compression / semantic dictionary.