This DIP discusses the several types of unique identifiers that may be used in specification of a word.
There will be two categories of unique identifiers:
- locally unique identifiers (usually human readable)
- universally unique identifiers (e.g. a cryptographic hash; non human readable)
Locally unique means that within a specified graph, there is no other word with the same identifier. Usually, locally unique identifiers will be human readable.
One of the criteria of a concept graph is that wordData.slug
serves as a locally unique identifier (local to the concept graph).
In some cases, a concept may have some additional identifier (in addition to wordData.slug
) that is locally unique within the concept, e.g. playerData.jerseyNumber
.
The requirement of local uniqueness is specified by setting the unique
field in the appropriate property to true
.
Typically takes the form of a cryptographic hash. Prominent examples include:
- a nostr event id used to publish the word, as per DIP-101
- IPFS hash
- IPNS name
Cryptographic identifiers are not required by the DCoSL protocol, but their use is recommended. More than one type of unique identifier can be used for each word. They may be mutable or immutable; there are advantages and disadvantages to each of these types.
Immutable identifiers frequently used in this document will include: nostr event id; file hash; or IPFS hash.
Mutable identifiers frequently used in this document will include: IPNS name.
The suggested practice is to attach an IPNS name to each word as in the example above, to record it under metaData, and to use it when necessary to ensure uniqueness of the slug.
Mutable identifiers, like the IPNS name, can be placed inside the word itself. Typically this will go into metaData
. Immutable identifiers like the IPFS hash or the nostr id cannot be placed into the word itself, for obvious reasons. Therefore, the only universal identifiers that will be found inside the word itself (inside metaData) will be mutable identifiers. Mutable identifiers are always under the control of an author, who is responsible for updating the content. The metaData will therefore optionally also contain a reference to the author of the mutable identifier.
By convention, locally unique identifiers will be found in wordData
.
Universally unique identifiers will be found under metaData
.
Every top-level domain (wordData
, widgetData
, userData
, etc) has default properties, one of which is slug. By default, the value of slug is a string and is unique, meaning that within the context of the graph
or conceptGraph
in question, there are no two words with the same fooData.slug
. By default, wordData.slug
is required. Bu default, fooData.slug
is optional for all domains other than fooData
= wordData
.
In the example below, fooBar_e12345
is a locally unique identifier, whereas abcde12345
is a universally unique (mutable) identifier.
{
"wordData": {
"slug": "fooBar_e12345",
"name": "foo bar",
"title": "Foo Bar",
},
...
"metaData": {
"IPNS": "abcde12345",
"author": {
"ipfsHandle": "vwxyz67890",
},
},
}