Specification for Cabal URIs (aka cabal keys, or identified by cabal://
)
Cabal's basic URI scheme is composed of the cabal://
protocol identifier, followed by a 64 character long base16
-encoded identifier. See the Basic scheme below.
Basic: cabal://[0-9A-Fa-f]{64}
To support Cabal's subjective moderation system, we decided on an extended scheme (inspired by & compatible with HTTP's query string). See the Extended scheme below.
Extended: cabal://[0-9A-Fa-f]{64}?<key1>=<value>&<key2>=<value>
for any amount of key-value pairs (i.e. parity with HTTP)
Two examples of Cabal URIs:
cabal://1eef9ad64e284691b7c6f6310e39204b5f92765e36102046caaa6a7ff8c02d74
cabal://1eef9ad64e284691b7c6f6310e39204b5f92765e36102046caaa6a7ff8c02d74?admin=1211400f1aa2e3076a3f17f4521b2cc41e258c446cdaa44742afe6e1b9fd5f82
Example 1 is a simple cabal key without any parameters. Example 2 extends example 1 with an admin
key, identifying the public key of the subjective administrator to be applied upon joining a cabal.
Additionally, there is support in Cabal's chat clients for a DNS shortname system. The DNS shortname system allows aliasing a cabal key by creating a well-known record or setting a TXT record, as will now be explained.
In these cases, the section following the protocol identifier is a domain name where the cabal key may be fetched. This is accomplished either by quering a well-known record at the domain name, i.e. the file http[s]://example.com/.well-known/cabal
, for the domain example.com
, or by querying a TXT record on the domain. The TXT record should be named cabalkey
and its contents should conform to the Basic and Extended schemes above.
The first line of the .well-known/cabal
file contains the cabal key, as described by the Basic and Extended schemes above. The second line contains a TTL in milliseconds, in the format of ttl=<milliseconds>
. Additional newline-delimited "key=value" entries may be defined, but as of yet Cabal only has support for the mentioned TTL.
DNS: cabal://<valid-domain.tld>
, e.g. cabal://example.com
Thus, Cabal's URIs are either identified by the Extended scheme above (which is a superset of the Basic scheme) or the DNS scheme, just explained.