Consistency improvements to `Link` and removal of `SecureLink` type in untp-core
Created by: absoludity
Note: Originally reported in #327 (closed) but for different reasons (that issue was closed because the reason for which I wrote it - linking of conformityEvidence
was a non-issue).
I'm re-opening this topic after reading the VC Data Integrity's Resource Integrity section, which specifies how the integrity of external resource links is handled in VerifiableCredentials, which is much neater, less verbose and more standard.
In summary, rather than the following two models:
Link
#noRoutes
linkURL:URI
linkName:Text
linkType:Text
SecureLink:Link
#localSupers
hashDigest:Text
hashMethod:Code(hashMethodCode)
encryptionMethod:Code(encryptionMethodCode)
we can instead use a single Link
model:
Link
id:URI
linkName:Text
linkType:Text
digestMultibase: vc:digestMultibase
The two changes are:
- Use
id
for the Link URI (as per #327 (closed)), so that it is the unique identifier for the link and as a result, multiple data with the same id will be referring to the same node (as well as being a requirement for the VC resource integrity use ofdigestMultibase
below), and - Use
digestMultibase
as an optional fully-self-described field, instead of the separate entity with secure link fields. More about howdigestMultibase
encodes the type of encoding, the hash function as well as the hash content can be found in the Multibase and Multihash sections of the Controlled Identifiers spec, or externally on the community GH pages for Multibase and Multihash. This would additionally mean we can remove two code tables (hashType and encryptionMethod - though it's not clear to me how we were planning to use encryptionMethod with a link here, but regardless, multikey is also coming).
Additionally, I think linkName
should be just name
. I'm guessing linkType
can't be just type
since that's already aliased to @type
globally by the VCDM context, so perhaps linkType
is best, though I'm unsure why its type is Text
when the description indicates it comes from a vocabulary (shouldn't it be an external code table?)