2. Names
Each resource (see the following section) has a name, which uniquely identifies it, and is unique across the entire system. The current resource representation can be retrieved at any time with a HTTP GET request to the endpoint using the name as path. All names are URL-safe with no need for percent encoding.
Names are immutable - once created, the resource keeps its name.
Names consist of ID segments, alternating between collection IDs and resource IDs.
Basic IDs are constrained to have non-zero length, and consist of alphanumeric characters, dashes or underscores. The regular expression [A-Za-z0-9_-]+
captures this requirement. Note that these are URL-safe, and coincide with bare keys in TOML.
Collection IDs are always basic IDs (the plural form of the resource type), resource IDs may have an extension suffix separated by +
(see below).
Basic Names
The simplest names are those for non-nested resources without extensions. They conform to {collection_id}/{resource_id}
, where {collection_id}
is the collection ID of the resource type, and {resource_id}
is the resource ID of the specific resource.
Example: The User
resource has collection ID given by users
, and names given by users/{user_id}
, where {user_id}
is the user's ID. For instance:
users/joe
is a user with IDjoe
Some resources are naturally nested under a parent resource. They conform to {parent_collection_id}/{parent_resource_id}/{collection_id}/{resource_id}
.
Example: The Address
resource has the Chain
resource as parent. For instance:
chains/ETH/addresses/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
is the address of the USDC contract on Ethereum
ID Extensions
Some resources may need to be distinguished, despite having the same natural resource ID. For these, a ID extension is set, delimited by a plus sign.
Example: The Address
resource on Cosmos chains has the notion of "memo", which allows exchanges to use a single deposit address for an asset and many customers. For instance:
chains/ATOM/addresses/cosmos1h3rw202ava6r4xg6jh3gkfjnpjn9zu9gf6sjj3+123
is the Cosmos addresschains/ATOM/addresses/cosmos1h3rw202ava6r4xg6jh3gkfjnpjn9zu9gf6sjj3
with memo set to123